Skip to content

Commit d990a4e

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 d990a4e

1 file changed

Lines changed: 26 additions & 9 deletions

File tree

.github/workflows/release.yaml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,40 @@
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:
18+
fail-fast: false
1519
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 }}
20+
include:
21+
# Linux builds
22+
- goos: linux
23+
goarch: amd64
24+
- goos: linux
25+
goarch: arm64
26+
# macOS builds
27+
- goos: darwin
28+
goarch: amd64
29+
- goos: darwin
30+
goarch: arm64
31+
# Windows builds
32+
- goos: windows
33+
goarch: amd64
34+
- goos: windows
35+
goarch: arm64
36+
name: release ${{ matrix.goos }}/${{ matrix.goarch }}
37+
runs-on: ubuntu-latest
2138
steps:
2239
- uses: actions/checkout@v3
2340
- uses: wangyoucao577/go-release-action@v1
@@ -27,5 +44,5 @@ jobs:
2744
goarch: ${{ matrix.goarch }}
2845
md5sum: false
2946
sha256sum: true
30-
asset_name: "lp-api-${{github.ref_name}}-${{ matrix.goos }}-${{ matrix.goarch }}-${{ matrix.os }}"
47+
asset_name: "lp-api-${{github.ref_name}}-${{ matrix.goos }}-${{ matrix.goarch }}"
3148
ldflags: "-s -w"

0 commit comments

Comments
 (0)