CICD: GoReleaser version #2 #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "PR: Run all tests" | |
on: | |
pull_request: | |
workflow_dispatch: | |
env: | |
cache-key: 1639697695 #Change to force cache reset `pwsh > Get-Date -UFormat %s` | |
go-mod-path: /go/pkg/mod | |
BIND_DOMAIN: example.com | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: stable | |
- name: restore_cache | |
uses: actions/[email protected] | |
with: | |
key: linux-go-${{ hashFiles('go.sum') }}-${{ env.cache-key }} | |
restore-keys: linux-go-${{ hashFiles('go.sum') }}-${{ env.cache-key }} | |
path: ${{ env.go-mod-path }} | |
# Stringer is needed because .goreleaser includes "go generate ./..." | |
- name: Install stringer | |
run: | | |
go install golang.org/x/tools/cmd/stringer@latest | |
- | |
id: build_binaries_not_tagged | |
name: Build binaries (not tagged) | |
if: github.ref_type != 'tag' | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
args: build --snapshot |