Skip to content

Commit 7c2a43e

Browse files
committed
add a 'build release binaries' workflow
1 parent c43cebb commit 7c2a43e

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build Release Binaries
2+
3+
on:
4+
release:
5+
types: [created, published, edited]
6+
7+
jobs:
8+
build:
9+
name: Build for ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
include:
14+
- os: ubuntu-latest
15+
artifact_name: agentapi
16+
asset_name: agentapi-linux-amd64
17+
goarch: amd64
18+
goos: linux
19+
- os: macos-latest
20+
artifact_name: agentapi
21+
asset_name: agentapi-darwin-amd64
22+
goarch: amd64
23+
goos: darwin
24+
- os: macos-latest
25+
artifact_name: agentapi
26+
asset_name: agentapi-darwin-arm64
27+
goarch: arm64
28+
goos: darwin
29+
- os: windows-latest
30+
artifact_name: agentapi.exe
31+
asset_name: agentapi-windows-amd64.exe
32+
goarch: amd64
33+
goos: windows
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Set up Go
39+
uses: actions/setup-go@v5
40+
with:
41+
go-version: 'stable'
42+
43+
- name: Build
44+
env:
45+
GOOS: ${{ matrix.goos }}
46+
GOARCH: ${{ matrix.goarch }}
47+
run: go build -v -o ${{ matrix.artifact_name }} .
48+
49+
- name: Upload Release Asset
50+
uses: actions/upload-release-asset@v1
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
with:
54+
upload_url: ${{ github.event.release.upload_url }}
55+
asset_path: ./${{ matrix.artifact_name }}
56+
asset_name: ${{ matrix.asset_name }}
57+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)