File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Release Binaries
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ tags :
8+ - ' v*'
9+ workflow_dispatch :
10+
11+ env :
12+ PLUGIN_NAME : kubectl-cycle
13+
14+ jobs :
15+ build-and-release :
16+ runs-on : ubuntu-latest
17+ permissions :
18+ contents : write # This is crucial for creating releases
19+ steps :
20+ - name : Checkout code
21+ uses : actions/checkout@v3
22+
23+ - name : Set up Go
24+ uses : actions/setup-go@v5
25+ with :
26+ go-version : ' 1.22'
27+
28+ - name : Build for Linux (amd64)
29+ run : |
30+ GOOS=linux GOARCH=amd64 go build -o ${{ env.PLUGIN_NAME }}-linux-amd64 ./cmd/cli/main.go
31+
32+ - name : Build for Linux (arm64)
33+ run : |
34+ GOOS=linux GOARCH=arm64 go build -o ${{ env.PLUGIN_NAME }}-linux-arm64 ./cmd/cli/main.go
35+
36+ - name : Create/Update GitHub Release (for tags)
37+ if : startsWith(github.ref, 'refs/tags/')
38+ uses : softprops/action-gh-release@v1
39+ with :
40+ tag_name : ${{ github.ref_name }}
41+ name : Release ${{ github.ref_name }}
42+ draft : false
43+ prerelease : false
44+ files : |
45+ ${{ env.PLUGIN_NAME }}-linux-amd64
46+ ${{ env.PLUGIN_NAME }}-linux-arm64
47+
48+ - name : Upload Artifacts (for master branch)
49+ if : github.ref == 'refs/heads/master'
50+ uses : actions/upload-artifact@v4
51+ with :
52+ name : kubectl-cycle-binaries-master
53+ path : |
54+ ${{ env.PLUGIN_NAME }}-linux-amd64
55+ ${{ env.PLUGIN_NAME }}-linux-arm64
You can’t perform that action at this time.
0 commit comments