Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(workflows/publish): split in two jobs #757

Merged
merged 3 commits into from
Aug 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,34 @@ on:
push:

jobs:
build:
name: GoReleaser build
tests:
name: Unit Tests
runs-on: ubuntu-latest

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
fetch-depth: 0 # See: https://goreleaser.com/ci/actions/

- name: Setup Go environment
uses: actions/setup-go@v3
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
check-latest: true
- run: go version

- name: Execute the tests
run: go test -race ./...

release:
needs: tests
name: GoReleaser Build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # See: https://goreleaser.com/ci/actions/
- uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
check-latest: true
- run: go version
- name: Run GoReleaser
if: startsWith(github.ref, 'refs/tags/')
uses: goreleaser/goreleaser-action@v3
with:
version: latest
Expand Down