Skip to content

Commit c0dd5cc

Browse files
committed
Add release workflow for Go binary distribution
1 parent e9dc4aa commit c0dd5cc

2 files changed

Lines changed: 32 additions & 3 deletions

File tree

.github/workflows/go.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will build a golang project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3-
41
name: Go
52

63
on:

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: release.yml
2+
on:
3+
release:
4+
types: [created]
5+
6+
permissions:
7+
contents: write
8+
packages: write
9+
10+
jobs:
11+
releases-matrix:
12+
name: Release Go Binary
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
# build and publish in parallel: linux/amd64, linux/arm64, windows/amd64, darwin/amd64, darwin/arm64
17+
goos: [linux, windows, darwin]
18+
goarch: ["386", amd64, arm64]
19+
exclude:
20+
- goarch: "386"
21+
goos: darwin
22+
- goarch: "386"
23+
goos: windows
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: wangyoucao577/go-release-action@v1
27+
with:
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
goos: ${{ matrix.goos }}
30+
goarch: ${{ matrix.goarch }}
31+
project_path: "./cmd/hammerclock"
32+
binary_name: "hammerclock"

0 commit comments

Comments
 (0)