Skip to content

Commit df2b098

Browse files
committed
feat: expand gh actions
1 parent 9e5e15b commit df2b098

1 file changed

Lines changed: 37 additions & 4 deletions

File tree

.github/workflows/release.yaml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,49 @@ on:
77
jobs:
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+

0 commit comments

Comments
 (0)