Skip to content

Commit

Permalink
Added separate action to publish versioned binaries.
Browse files Browse the repository at this point in the history
Also cleaned up the existing action to avoid unnecessary runs.
  • Loading branch information
LTLA committed Feb 16, 2024
1 parent e7d4d00 commit b81389a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
name: Test and build Go
name: Unit tests

on:
push:
branches:
- master
paths:
- '**.go'
- 'go.**'
- .github/workflows/build.yaml
pull_request:
paths:
- '**.go'
- 'go.**'
- .github/workflows/build.yaml

jobs:
test:
Expand Down Expand Up @@ -39,7 +47,8 @@ jobs:
- name: Check out
uses: actions/checkout@v4

- uses: wangyoucao577/go-release-action@v1
- name: Build latest
uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.os }}
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish version

on:
push:
tags:
- "*"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Create release
uses: softprops/action-gh-release@v1

publish:
runs-on: ubuntu-latest
needs: release
strategy:
matrix:
os: [ linux, darwin ]
arch: [ amd64, arm64 ]

steps:
- name: Check out
uses: actions/checkout@v4

- name: Publish binaries
uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.os }}
goarch: ${{ matrix.arch }}
release_tag: ${{ github.ref_name }}
asset_name: gobbler-${{ matrix.os }}-${{ matrix.arch }}
overwrite: true
compress_assets: false

0 comments on commit b81389a

Please sign in to comment.