File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77jobs :
88 build :
99 runs-on : ubuntu-latest
10+ strategy :
11+ matrix :
12+ goarch : [amd64, arm64]
1013
1114 steps :
1215 - name : Checkout
1316 uses : actions/checkout@v5
1417
15- - name : Build
16- run : go build -o observer .
18+ - name : Set up Go
19+ uses : actions/setup-go@v4
20+ with :
21+ go-version : ' 1.24'
22+
23+ - name : Build binary
24+ run : |
25+ echo "Building for ${{ matrix.goarch }}"
26+ GOOS=linux GOARCH=${{ matrix.goarch }} go build -o observer-${{ matrix.goarch }} .
27+
28+ - name : Package binary as tar.gz with release tag
29+ run : |
30+ TAG=${GITHUB_REF#refs/tags/}
31+ tar -czf observer-${{ matrix.goarch }}-$TAG.tar.gz observer-${{ matrix.goarch }}
1732
18- - name : Release
33+ - name : Upload artifact
34+ uses : actions/upload-artifact@v3
35+ with :
36+ name : observer-${{ matrix.goarch }}-${GITHUB_REF#refs/tags/}.tar.gz
37+ path : observer-${{ matrix.goarch }}-${GITHUB_REF#refs/tags/}.tar.gz
38+
39+ release :
40+ needs : build
41+ runs-on : ubuntu-latest
42+ steps :
43+ - name : Download artifacts
44+ uses : actions/download-artifact@v3
45+ with :
46+ path : .
47+
48+ - name : Create GitHub Release
1949 uses : softprops/action-gh-release@v2
2050 if : github.ref_type == 'tag'
2151 with :
22- files : observer
52+ files : |
53+ observer-amd64-${GITHUB_REF#refs/tags/}.tar.gz
54+ observer-arm64-${GITHUB_REF#refs/tags/}.tar.gz
55+
You can’t perform that action at this time.
0 commit comments