forked from ray-project/kuberay
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.24 KB
/
kubectl-plugin-release.yaml
File metadata and controls
42 lines (40 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: release-kubectl-plugin
on:
workflow_dispatch:
jobs:
release-kubectl-plugin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Error if not a tag
uses: actions/github-script@v7
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
script: core.setFailed('This action can only be run on tags')
- name: Check if stable release
id: check_stable
run: |
if [[ "${GITHUB_REF_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "is_stable=true" >> "$GITHUB_OUTPUT"
else
echo "is_stable=false" >> "$GITHUB_OUTPUT"
fi
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
- 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
if: ${{ steps.check_stable.outputs.is_stable == 'true' }}
uses: rajatjindal/krew-release-bot@v0.0.46