Skip to content

Commit b81389a

Browse files
committed
Added separate action to publish versioned binaries.
Also cleaned up the existing action to avoid unnecessary runs.
1 parent e7d4d00 commit b81389a

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

.github/workflows/build.yaml

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
name: Test and build Go
1+
name: Unit tests
22

33
on:
44
push:
55
branches:
66
- master
7+
paths:
8+
- '**.go'
9+
- 'go.**'
10+
- .github/workflows/build.yaml
711
pull_request:
12+
paths:
13+
- '**.go'
14+
- 'go.**'
15+
- .github/workflows/build.yaml
816

917
jobs:
1018
test:
@@ -39,7 +47,8 @@ jobs:
3947
- name: Check out
4048
uses: actions/checkout@v4
4149

42-
- uses: wangyoucao577/go-release-action@v1
50+
- name: Build latest
51+
uses: wangyoucao577/go-release-action@v1
4352
with:
4453
github_token: ${{ secrets.GITHUB_TOKEN }}
4554
goos: ${{ matrix.os }}

.github/workflows/publish.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish version
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Create release
13+
uses: softprops/action-gh-release@v1
14+
15+
publish:
16+
runs-on: ubuntu-latest
17+
needs: release
18+
strategy:
19+
matrix:
20+
os: [ linux, darwin ]
21+
arch: [ amd64, arm64 ]
22+
23+
steps:
24+
- name: Check out
25+
uses: actions/checkout@v4
26+
27+
- name: Publish binaries
28+
uses: wangyoucao577/go-release-action@v1
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
goos: ${{ matrix.os }}
32+
goarch: ${{ matrix.arch }}
33+
release_tag: ${{ github.ref_name }}
34+
asset_name: gobbler-${{ matrix.os }}-${{ matrix.arch }}
35+
overwrite: true
36+
compress_assets: false

0 commit comments

Comments
 (0)