Skip to content

ci: gate the release build in the PR, not at the tag - #248

Merged
skyoo2003 merged 1 commit into
mainfrom
ci/gate-the-release-build
Sep 6, 2026
Merged

ci: gate the release build in the PR, not at the tag#248
skyoo2003 merged 1 commit into
mainfrom
ci/gate-the-release-build

Conversation

@skyoo2003

Copy link
Copy Markdown
Owner

Pull Request

Description

Follow-up to #247. That PR fixed the broken .goreleaser.yaml line; this one closes the hole that let it reach a tag unnoticed.

The v1.6.0 tag build failed on a config every CI gate had passed. Two separate holes were needed for that:

  1. .goreleaser.yaml was not in the path filter. A PR touching only that file ran no CI at all — which is exactly what fix: build the acor package, not main.go alone, in the release #247 did, merging on a green labeler and nothing else.
  2. No CI step reads that file. So even with the filter, nothing would have compiled it. make build builds ./cmd/acor; GoReleaser builds whatever .goreleaser.yaml names. For v1.6.0 those were different things, which is why a green main proved nothing about the tag.

Adding only the path entry would have been theater: CI would have run, make build would have passed, and the file-vs-package bug would still merge. Both halves are needed, so both are here.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Test update

CI-only change — none of the above.

What the new step does

- name: Verify the release build
  if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.26'
  uses: goreleaser/goreleaser-action@f06c13b...  # v7, same pin as release.yaml
  with:
    args: build --snapshot --clean --single-target

build, not release: publishes nothing and needs no tokens, so it is safe on a fork PR. --single-target keeps it to the host platform — enough to fail a config that cannot compile, without paying for the nine-target matrix on every PR. Pinned to one matrix leg, matching tidy-check, license-check, and api-check above it.

Verification

Reintroduced the exact bug locally and ran the step's command:

$ sed -i '' 's|main: ./cmd/acor|main: cmd/acor/main.go|' .goreleaser.yaml
$ goreleaser build --snapshot --clean --single-target
    │ build failed: exit status 1: # command-line-arguments
    │ cmd/acor/main.go:224:10: undefined: dispatchDictionary

That is the tag build's own error, produced in a PR-time check. Restored the file and reconfirmed the build passes; git status shows this PR touches ci.yaml only.

Checklist

  • Tests pass (make test) — no Go files changed; pre-commit skipped the Go hooks for that reason
  • Vet/make vet — same
  • Linting passes (make lint) — same
  • Build succeeds (make build) — same
  • Documentation updated if needed — N/A
  • Changelog fragment added (changie new) — deliberately skipped: CI-only, per the rule stated on this template
  • Commit messages follow guidelines

Additional Notes

Unlike #247, this PR will run full CI, since .github/workflows/*.yaml was already in the filter — so the new step gets exercised on its own PR.


By submitting this PR, I agree that my contributions will be licensed under the Apache License 2.0.

The v1.6.0 tag build failed on a config that every CI gate had passed:
.goreleaser.yaml named `cmd/acor/main.go`, a file, so GoReleaser compiled
main.go alone and dropped dictionary.go alongside it.

Two holes let that reach a tag. .goreleaser.yaml was not in the path filter,
so a PR touching only it ran no CI at all; and CI ran no builder that reads
that file, so even with the filter nothing would have compiled it. `make build`
builds ./cmd/acor — a different build than the release's, which is precisely
why a green main proved nothing about the tag.

Adds both halves: the path entry, and a `goreleaser build --snapshot
--single-target` step on one matrix leg. build rather than release, so it needs
no tokens and publishes nothing; single-target keeps it to the host platform,
which is enough to fail a config that cannot compile.

Verified by reintroducing the bug locally: the step fails with the tag build's
own error, `undefined: dispatchDictionary`.
@github-actions github-actions Bot added the github_actions Pull requests that update Github_actions code label Sep 6, 2026
@skyoo2003
skyoo2003 merged commit 39f65e1 into main Sep 6, 2026
7 checks passed
@skyoo2003
skyoo2003 deleted the ci/gate-the-release-build branch September 6, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update Github_actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant