-
Notifications
You must be signed in to change notification settings - Fork 23
41 lines (33 loc) · 1.04 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
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: List files in build directory
run: ls -l build/
- name: Upload binaries to GitHub release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/${{ matrix.goos }}-${{ matrix.goarch }}/weave
asset_name: weave-${{ matrix.goos }}-${{ matrix.goarch }}
asset_content_type: application/octet-stream