-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (51 loc) · 1.9 KB
/
release.yaml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
name: Release
permissions:
contents: write
packages: write
on:
release:
types:
- published
jobs:
release:
name: release binaries
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
name: Checkout repository
- uses: actions/setup-go@v4
name: Setup go environment
with:
go-version: "1.20"
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
install-only: true
- name: Build libraries
run: |
./build.sh
- name: Get latest release tag
run: |
repo_user=$(echo ${{ github.repository }} | cut -d'/' -f1 | tr '[:upper:]' '[:lower:]')
repo_name=$(echo ${{ github.repository }} | cut -d'/' -f2 | tr '[:upper:]' '[:lower:]')
release_url="https://api.github.com/repos/$repo_user/$repo_name/releases/latest"
release_tag=$(curl -sH "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$release_url" | jq -r ".tag_name")
if [[ -z "$release_tag" ]]; then echo "variable release_tag is empty!" && exit 1; fi
echo "LATEST_RELEASE_TAG=$release_tag" >> $GITHUB_ENV
- name: Upload release assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ env.LATEST_RELEASE_TAG }} ./dist/kubectl-node_ssm-${{ env.LATEST_RELEASE_TAG }}-*.tar.gz
gh release upload ${{ env.LATEST_RELEASE_TAG }} ./dist/kubectl-node_ssm-${{ env.LATEST_RELEASE_TAG }}-*.zip
gh release upload ${{ env.LATEST_RELEASE_TAG }} ./dist/kubectl-node_ssm-${{ env.LATEST_RELEASE_TAG }}-*.sha256
publish:
needs: release
name: bump krew-index version
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
name: Checkout repository
- uses: rajatjindal/[email protected]
name: Publish new version in krew-index