Skip to content

Commit 0b0fdc4

Browse files
committed
feat: build release github action
1 parent e120d04 commit 0b0fdc4

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/build-release.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build Go binaries for release
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
build:
10+
name: Build Go binaries
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
goos: [linux, darwin]
16+
goarch: [amd64, arm64] # You can modify this if you want other architectures like ARM
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v4
24+
with:
25+
go-version: '1.22.6' # Set to Go version 1.22.6
26+
27+
- name: Build binary
28+
run: |
29+
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/${{ matrix.goos }}-${{ matrix.goarch }}/weave
30+
31+
- name: Upload binaries
32+
uses: actions/upload-artifact@v3
33+
with:
34+
name: ${{ matrix.goos }}-${{ matrix.goarch }}-binary
35+
path: build/${{ matrix.goos }}-${{ matrix.goarch }}/weave

0 commit comments

Comments
 (0)