-
Notifications
You must be signed in to change notification settings - Fork 23
44 lines (36 loc) · 1.19 KB
/
build-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Build Go binaries and upload to release
on:
release:
types:
- published
jobs:
build:
name: Build Go binaries
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin]
goarch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.6'
- name: Build binary
run: |
mkdir -p build
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/weave-${{ matrix.goos }}-${{ matrix.goarch }}
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.goos }}-${{ matrix.goarch }}-binary
path: build/${{ matrix.goos }}-${{ matrix.goarch }}/weave
# - name: Upload binaries to GitHub release
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: build/weave-${{ matrix.goos }}-${{ matrix.goarch }}
# asset_name: weave-${{ matrix.goos }}-${{ matrix.goarch }}
# asset_content_type: application/octet-stream