Skip to content

Commit 6ea201a

Browse files
committed
Update release workflow to support multiple OS and architectures
- Trigger on push to main branch and all tags - Build for Linux, macOS, and Windows - Support amd64 and arm64 architectures for each OS
1 parent 5788170 commit 6ea201a

1 file changed

Lines changed: 25 additions & 9 deletions

File tree

.github/workflows/release.yaml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,39 @@
11
name: Release prebuilt binary
22

33
on:
4-
release:
5-
types: [created]
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
69

710
permissions:
811
contents: read
912

1013
jobs:
11-
release-linux-amd64:
14+
release:
1215
permissions:
1316
contents: write
1417
strategy:
1518
matrix:
16-
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
17-
goos: [linux]
18-
goarch: [amd64, arm64]
19-
name: release ${{ matrix.os }} ${{ matrix.goos }}/${{ matrix.goarch }}
20-
runs-on: ${{ matrix.os }}
19+
include:
20+
# Linux builds
21+
- goos: linux
22+
goarch: amd64
23+
- goos: linux
24+
goarch: arm64
25+
# macOS builds
26+
- goos: darwin
27+
goarch: amd64
28+
- goos: darwin
29+
goarch: arm64
30+
# Windows builds
31+
- goos: windows
32+
goarch: amd64
33+
- goos: windows
34+
goarch: arm64
35+
name: release ${{ matrix.goos }}/${{ matrix.goarch }}
36+
runs-on: ubuntu-latest
2137
steps:
2238
- uses: actions/checkout@v3
2339
- uses: wangyoucao577/go-release-action@v1
@@ -27,5 +43,5 @@ jobs:
2743
goarch: ${{ matrix.goarch }}
2844
md5sum: false
2945
sha256sum: true
30-
asset_name: "lp-api-${{github.ref_name}}-${{ matrix.goos }}-${{ matrix.goarch }}-${{ matrix.os }}"
46+
asset_name: "lp-api-${{github.ref_name}}-${{ matrix.goos }}-${{ matrix.goarch }}"
3147
ldflags: "-s -w"

0 commit comments

Comments
 (0)