Skip to content

Guard against mistakes when running the release action - #6138

Merged
stefanhaller merged 2 commits into
masterfrom
take-release-go-version-from-go-mod
Oct 16, 2026
Merged

stefanhaller merged 2 commits into
masterfrom
take-release-go-version-from-go-mod

Conversation

@stefanhaller

Copy link
Copy Markdown
Collaborator

Releases are run from stefanhaller's fork, but if that fork is not up to date with jesseduffield's, bad things can happen. Guard against this by checking that the release.yml file in both is identical.

Also take the go version to build with from the go.mod file in the branch that is being released from, rather than hard-code it in release.yml; this could be relevant when making a release from a 0.66.3 branch when the go version has already been bumped on master.

stefanhaller and others added 2 commits October 16, 2026 14:22
Releases run the release workflow of the stefanhaller/lazygit fork, but
build the code of jesseduffield/lazygit. If the fork's master is behind,
its copy of release.yml can differ from upstream's, and the release
runs with outdated steps. This may only show up after the new tag has
already been pushed.

Stop the release right after checking out the code if the running
release.yml differs from the one on jesseduffield/lazygit's master.
Compare with master rather than with the branch being released. A
patch release from a branch off an older tag carries an older
release.yml, and it should still be released with the current workflow.

This means that changes to release.yml can no longer be tried out in
the fork before they land upstream.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
release.yml installs a fixed Go version for building a release, and it
must match the release.yml on master. A patch release from a branch off
an older tag is therefore built with master's Go version, not with the
one that branch uses. For example, once master moves to Go 1.27, a
v0.66.3 built from a branch off v0.66.2 would no longer run on macOS
12, although v0.66.2 does.

Read the version from the go line of the checked-out go.mod instead,
and add ".x" so that setup-go installs the latest patch release.
setup-go's go-version-file input can't do this; for "go 1.26.0" it
installs exactly 1.26.0. Read the version before pushing the tag, so
that a go.mod without a go line stops the release early.

This also removes release.yml from the files to edit when updating Go.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@stefanhaller stefanhaller added the maintenance For refactorings, CI changes, tests, version bumping, etc label Oct 16, 2026
@stefanhaller
stefanhaller merged commit 4b38f6f into master Oct 16, 2026
13 checks passed
@stefanhaller
stefanhaller deleted the take-release-go-version-from-go-mod branch October 16, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance For refactorings, CI changes, tests, version bumping, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant