Skip to content

Commit

Permalink
run GoReleaser as a separate job
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Apr 9, 2024
1 parent 949b9f8 commit 9cc9f3d
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,33 @@ on:
- "**"

jobs:
publish:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.20', '1.21', '1.22' ]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- run: go test -v ./...
- run: go test -v ./...

- name: Fetch all tags
run: git fetch --force --tags
publish:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Fetch all tags
run: git fetch --force --tags

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 9cc9f3d

Please sign in to comment.