Skip to content

fix(goreleaser): read the Go version from go.mod - #137

Merged
duynhne merged 1 commit into
mainfrom
fix/goreleaser-go-version-file
Oct 1, 2026
Merged

duynhne merged 1 commit into
mainfrom
fix/goreleaser-go-version-file

Conversation

@duynhne

@duynhne duynhne commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Why

All 10 service tags cut today for Go 1.27.1 (user v2.5.0 … checkout v0.13.0) failed in release-binary / release:

release failed: failed to get module path: exit status 1:
go: go.mod requires go >= 1.27.1 (running go 1.26.8; GOTOOLCHAIN=local)

goreleaser.yml defaulted go-version: '1.26', while go-check and govulncheck read go.mod. Images were built, pushed and signed; only the GitHub Release (tarball, checksums, cosign signature, SBOM) is missing.

What

  • go-version now defaults to '', and a new go-version-file input defaults to go.mod. With go-version empty, setup-go reads the version from the file, so the release binary uses the same toolchain CI tested.
  • Passing go-version explicitly still overrides it.

actionlint passes. No caller passes go-version today, so every caller picks this up when it re-pins.

Note, not changed here: sonarqube.yml's go-version input (default '1.25') is unused, because that workflow has no setup-go step.

The release job pinned go-version '1.26' while every other job reads
go.mod. GoReleaser runs with GOTOOLCHAIN=local, so once the services
moved to go 1.27.1 it stopped with "go.mod requires go >= 1.27.1
(running go 1.26.8)" on every v* tag, and no GitHub Release was cut.

go-version now defaults to empty and setup-go reads go-version-file
(go.mod), so the binary is built with the toolchain CI tested. An
explicit go-version still overrides it.
@duynhne
duynhne requested a review from duyhenryer as a code owner October 1, 2026 11:52
@duynhne
duynhne merged commit 28cee20 into main Oct 1, 2026
1 check passed
@duynhne
duynhne deleted the fix/goreleaser-go-version-file branch October 1, 2026 11:53
duynhne added a commit that referenced this pull request Oct 2, 2026
docs/workflows.md still gave goreleaser's go-version default as 1.26;
since #137 it is empty and setup-go reads go-version-file (go.mod), so
the page now says that and lists the new input.

sonarqube.yml declared a go-version input (default 1.25) that nothing
read: the workflow has no setup-go step. No caller passes it (checked
across the 26 workflow files that call it), so it is removed along
with its doc row.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant