fix: update to go1.25.8, and use separate .go-version file#2246
fix: update to go1.25.8, and use separate .go-version file#2246Subserial merged 1 commit intogoogle:mainfrom
Conversation
| env: | ||
| GOTOOLCHAIN: local |
There was a problem hiding this comment.
Setting GOTOOLCHAIN: local, which isn't set by go-setup action; without it, you may see go-setup action installing version X, then running go --version which automatically downloads a newer version if set in go.mod 🫠
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #2246 +/- ##
===========================================
- Coverage 71.67% 52.74% -18.94%
===========================================
Files 123 164 +41
Lines 9935 11113 +1178
===========================================
- Hits 7121 5861 -1260
- Misses 2115 4546 +2431
- Partials 699 706 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thank you! I was going to try manually setting the version instead of the file. Could you add the comment to |
|
Yeah, probably never hurts to be explicit and to prevent someone accidentally updating; let me try draft a comment 😅 |
1c003b6 to
aa572e6
Compare
|
OK; done! Let me know if the wording looks good to you; happy do update 😅 |
| @@ -19,6 +22,7 @@ jobs: | |||
| with: | |||
| go-version: 1.25 | |||
There was a problem hiding this comment.
Is there a reason the releaser action should use a different fixed version? I think it should be fine to use the global version.
There was a problem hiding this comment.
Oh, no, don't think there is, but I probably missed it when searching?
Let me look when I get back at my computer
Commit bf0f710 removed the patch version from go.mod, but overlooked that the go-setup action in github actions workflows were configured to use 'go.mod' for its version. Unfortunately, go-setup action (incorrectly) uses the specified version as an exact version, not as minimum, which meant that actions (and release flows) would now downgrade to go1.25.0; Run actions/setup-go@v6 Setup go version spec 1.25.0 Attempting to download 1.25.0... matching 1.25.0... Acquiring 1.25.0 from https://github.com/actions/go-versions/releases/download/1.25.0-16925932082/go-1.25.0-linux-x64.tar.gz Extracting Go... ... go version go1.25.0 linux/amd64 This patch: - Adds a dedicated `.go-version` file, which specifies the version of go to use, independently from the version in `go.mod` (which defines the minimum supported version). - Sets GOTOOLCHAIN=local to prevent changes in `go.mod` from implicitly updating the go version to a newer version. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
aa572e6 to
9088874
Compare
| with: | ||
| go-version: 1.25 | ||
| check-latest: true | ||
| go-version-file: '.go-version' | ||
| check-latest: true # no-op if full version is specified | ||
| cache: false |
There was a problem hiding this comment.
I updated the release as well; so what I THINK was the thought behind it;
- go.mod specifying the version to run in CI
- release to be specified without patch version, then leaving it to
go-setup-actionto find "latest patch"
Advantage is that releases would be built with latest patch available at the time (in case it was forgotten to update the version).
Downside is that A) it's not deterministic, B) CI would have tested a different version than the release uses.
But there's clearly pros/cons to either. I left the check-latest: true in place, but it would be a no-op if a full version is specified, but probably won't hurt to have either.
Commit bf0f710 removed the patch version from go.mod, but overlooked that the go-setup action in github actions workflows were configured to use 'go.mod' for its version.
Unfortunately, go-setup action (incorrectly) uses the specified version as an exact version, not as minimum, which meant that actions (and release flows) would now downgrade to go1.25.0;
This patch:
.go-versionfile, which specifies the version of go to use, independently from the version ingo.mod(which defines the minimum supported version).go.modfrom implicitly updating the go version to a newer version.