File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and upload release artifact
2
+
3
+ on :
4
+ release :
5
+ types : [created]
6
+
7
+ env :
8
+ RELEASE_VERSION : ${{ github.event.release.tag_name }}
9
+
10
+ jobs :
11
+ build :
12
+ runs-on : ubuntu-latest
13
+
14
+ steps :
15
+ - name : Checkout code
16
+ uses : actions/checkout@v4
17
+
18
+ - name : Set Release Version
19
+ run : echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
20
+
21
+ - name : Set up Go
22
+ uses : actions/setup-go@v4
23
+ with :
24
+ go-version : ' 1.21'
25
+
26
+ - name : Build
27
+ run : |
28
+ BUILD=$(git log --format='%H' -n 1)
29
+ VERSION=$RELEASE_VERSION
30
+ OSES="linux darwin"
31
+ ARCHS="amd64 arm64"
32
+ IFS=" "
33
+
34
+ for OS in $OSES; do
35
+ for ARCH in $ARCHS; do
36
+ echo "OS: ${OS} and ARCH: ${ARCH}"
37
+ GOOS=${OS} GOARCH=${ARCH} go build -ldflags "-w -s -X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Build=$BUILD\
38
+ -X github.com/nginxinc/nginx-k8s-supportpkg/pkg/version.Version=$VERSION"\
39
+ -o release/kubectl-nic-supportpkg_${VERSION}_${OS}_${ARCH}/kubectl-nic-supportpkg
40
+ cp LICENSE release/kubectl-nic-supportpkg_${VERSION}_${OS}_${ARCH}/
41
+ tar czvf release/kubectl-nic-supportpkg_${VERSION}_${OS}_${ARCH}.tar.gz -C release kubectl-nic-supportpkg_${VERSION}_${OS}_${ARCH}
42
+ done; done
43
+
44
+ - name : Upload release binaries
45
+
46
+ env :
47
+ GITHUB_TOKEN : ${{ github.token }}
48
+ with :
49
+ asset_paths : ' ["./release/*.gz"]'
You can’t perform that action at this time.
0 commit comments