Skip to content

Commit

Permalink
[Build][kubectl-plugin] Add release script for kubectl plugin
Browse files Browse the repository at this point in the history
Closes: ray-project#2406
Signed-off-by: Chi-Sheng Liu <[email protected]>
  • Loading branch information
MortalHappiness committed Sep 27, 2024
1 parent 9c37889 commit 852e98a
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 5 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: release
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
release-kubectl-plugin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: 'goreleaser'
version: latest
args: release --clean
workdir: 'kubectl-plugin'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update new version in krew-index
uses: rajatjindal/[email protected]
36 changes: 36 additions & 0 deletions .krew.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: ray
spec:
version: {{ .TagName }}
homepage: https://github.com/ray-project/kuberay/kubectl-plugin
platforms:
- selector:
matchLabels:
os: darwin
arch: amd64
{{addURIAndSha "https://github.com/ray-project/kuberay/releases/download/{{ .TagName }}/kubectl-ray_{{ .TagName }}_darwin_amd64.tar.gz" .TagName }}
bin: kubectl-ray
- selector:
matchLabels:
os: darwin
arch: arm64
{{addURIAndSha "https://github.com/ray-project/kuberay/releases/download/{{ .TagName }}/kubectl-ray_{{ .TagName }}_darwin_arm64.tar.gz" .TagName }}
bin: kubectl-ray
- selector:
matchLabels:
os: linux
arch: amd64
{{addURIAndSha "https://github.com/ray-project/kuberay/releases/download/{{ .TagName }}/kubectl-ray_{{ .TagName }}_linux_amd64.tar.gz" .TagName }}
bin: kubectl-ray
- selector:
matchLabels:
os: linux
arch: arm64
{{addURIAndSha "https://github.com/ray-project/kuberay/releases/download/{{ .TagName }}/kubectl-ray_{{ .TagName }}_linux_arm64.tar.gz" .TagName }}
bin: kubectl-ray
shortDescription: Ray kubectl plugin
description: |
Kubectl plugin/extension for Kuberay CLI that provides the ability to manage ray resources.
Read more documentation at: https://github.com/ray-project/kuberay/tree/master/kubectl-plugin
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
args: [--allow-multiple-documents]
exclude: ^helm-chart/|^mkdocs.yml$|^benchmark/perf-tests/
exclude: ^helm-chart/|^mkdocs\.yml$|^benchmark/perf-tests/|^\.krew\.yaml$
- id: check-added-large-files
- id: check-merge-conflict
- id: check-case-conflict
Expand Down
6 changes: 2 additions & 4 deletions docs/development/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,8 @@ Now, we have the Docker images and Helm charts for v0.5.0.
#### Step 8. Generate release
* Click "Create release" to create release for the tag v0.5.0 ([link](https://github.com/ray-project/kuberay/tags)).
* Update `VERSION` in the [Makefile](https://github.com/ray-project/kuberay/blob/master/cli/Makefile) to `vX.Y.Z`.
* Run `make release` in cli folder and generate `kuberay-$VERSION-darwin-amd64.zip` and `kuberay-$VERSION-linux-amd64.zip` files. Upload them to the GitHub release.
* Follow the [instructions](../release/changelog.md) to generate release notes and add notes in the GitHub release.
* Currently, a GitHub release will be generated by CI automatically if a semver tag is pushed to the repository.
* Follow the [instructions](../release/changelog.md) to generate release notes and add notes in the GitHub release.
#### Step 9. Announce the release on the KubeRay slack!
Expand Down
2 changes: 2 additions & 0 deletions kubectl-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
kubectl-ray

dist/
40 changes: 40 additions & 0 deletions kubectl-plugin/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: 2

before:
hooks:
- go mod tidy

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
main: ./cmd
binary: kubectl-ray

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .Binary }}_
{{- .Tag }}_
{{- .Os }}_
{{- if eq .Arch "amd64" }}amd64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

0 comments on commit 852e98a

Please sign in to comment.