-
Notifications
You must be signed in to change notification settings - Fork 136
Update Go to 1.24 #688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Go to 1.24 #688
Conversation
Signed-off-by: Jeff Mendoza <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use default setup-go action settings that will pull from go mod
I don't think that happens by default.
actions/setup-go#523
go.mod
Outdated
go 1.23.0 | ||
go 1.24 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.24.0
?
1.24
assumes a .0
and works with current tooling but I remember the initial tooling in Go 1.21 or 1.22 throwing errors at this format.
.github/workflows/pr.yaml
Outdated
with: | ||
go-version: '1.21' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's also a stable
alias if that helps.
Signed-off-by: Stephen Augustus <[email protected]>
This instructs action/setup-go to pull the Golang version from go.mod. This should make future upgrades more predictable than using `go-version: stable`. ref: https://github.com/actions/setup-go?tab=readme-ov-file#getting-go-version-from-the-gomod-file Signed-off-by: Stephen Augustus <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jeffmendoza and @spencerschrock!
I stacked two commits on top:
- 7242a07 — drops
toolchain
directive, which can cause problems for consumers - f6550e4 — uses
go.mod
to determine the version for actions/setup-go
Here's an actions/setup-go snippet from a successful run:
Run actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
with:
go-version-file: go.mod
check-latest: false
token: ***
cache: true
Setup go version spec 1.24
Attempting to download 1.24...
matching 1.24...
Acquiring 1.24.3 from https://github.com/actions/go-versions/releases/download/1.24.3-14875263452/go-1.24.3-linux-x64.tar.gz
Extracting Go...
/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/8390be88-c2cc-4c44-82b3-155163c7b452 -f /home/runner/work/_temp/9102d775-9e54-4898-a9ad-7a0a519c81f0
Successfully extracted go to /home/runner/work/_temp/8390be88-c2cc-4c44-82b3-155163c7b452
Adding to the cache ...
Successfully cached go to /opt/hostedtoolcache/go/1.24.3/x64
Added go to the path
Successfully set up Go version 1.24
/opt/hostedtoolcache/go/1.24.3/x64/bin/go env GOMODCACHE
/opt/hostedtoolcache/go/1.24.3/x64/bin/go env GOCACHE
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
Cache is not found
go version go1.24.3 linux/amd64
Use default setup-go action settings that will pull from go mod
I'll mess with cloud build later (will remove the build there).