Skip to content

Commit

Permalink
Run GoReleaser on pull-requests and main
Browse files Browse the repository at this point in the history
To ensure that the GoReleaser configuration is correct, run the binary
build on every pull-request and commit, but only actually release on
tags.
  • Loading branch information
arbourd committed Apr 2, 2024
1 parent 86df184 commit a8e373a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ jobs:
- run: go build .
- run: ./git-get github.com/arbourd/git-get

release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
bin:
needs: [test]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand All @@ -45,12 +44,20 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- run: go mod download

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
- uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
install-only: true

- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: goreleaser release --clean --snapshot

# Release binaries on release tags
- if: startsWith(github.ref, 'refs/tags/v')
run: goreleaser release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}

0 comments on commit a8e373a

Please sign in to comment.