Skip to content

CICD: GoReleaser version #2 #12

CICD: GoReleaser version #2

CICD: GoReleaser version #2 #12

Workflow file for this run

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
jobs:
build:
runs-on: ubuntu-latest
container:
image: golang:1.21
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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:
distribution: goreleaser
version: latest
args: build --snapshot