Skip to content

Commit c99e7cf

Browse files
authored
fix: update to go1.25.8, and use separate .go-version file (#2246)
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>
1 parent 0794660 commit c99e7cf

14 files changed

Lines changed: 61 additions & 12 deletions

File tree

.github/workflows/build.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
branches: ['main']
66

7+
env:
8+
GOTOOLCHAIN: local
9+
710
jobs:
811

912
build:
@@ -14,7 +17,7 @@ jobs:
1417
- uses: actions/checkout@v6
1518
- uses: actions/setup-go@v6
1619
with:
17-
go-version-file: go.mod
20+
go-version-file: '.go-version'
1821

1922
- run: |
2023
go build ./...

.github/workflows/bump-deps.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ permissions:
99
contents: write
1010
pull-requests: write
1111

12+
env:
13+
GOTOOLCHAIN: local
14+
1215
jobs:
1316
bump-deps:
1417
name: Bump Deps
@@ -21,7 +24,7 @@ jobs:
2124
- uses: actions/checkout@v6
2225
- uses: actions/setup-go@v6
2326
with:
24-
go-version-file: go.mod
27+
go-version-file: '.go-version'
2528

2629
- run: ./hack/bump-deps.sh
2730
- name: Create Pull Request

.github/workflows/e2e.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
branches: ['main']
66

7+
env:
8+
GOTOOLCHAIN: local
9+
710
jobs:
811
e2e:
912
strategy:
@@ -19,7 +22,7 @@ jobs:
1922
- uses: actions/checkout@v6
2023
- uses: actions/setup-go@v6
2124
with:
22-
go-version-file: go.mod
25+
go-version-file: '.go-version'
2326

2427
- name: crane append to an image, set the entrypoint, run it locally, roundtrip it
2528
shell: bash

.github/workflows/ecr-auth.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ permissions:
1010
# This lets us mint identity tokens.
1111
id-token: write
1212

13+
env:
14+
GOTOOLCHAIN: local
15+
1316
jobs:
1417
krane:
1518
runs-on: ubuntu-latest
@@ -21,7 +24,7 @@ jobs:
2124
- uses: actions/checkout@v6
2225
- uses: actions/setup-go@v6
2326
with:
24-
go-version-file: go.mod
27+
go-version-file: '.go-version'
2528

2629
- name: Install krane
2730
working-directory: ./cmd/krane
@@ -60,7 +63,7 @@ jobs:
6063
- uses: actions/checkout@v6
6164
- uses: actions/setup-go@v6
6265
with:
63-
go-version-file: go.mod
66+
go-version-file: '.go-version'
6467

6568
- name: Install crane
6669
working-directory: ./cmd/crane

.github/workflows/ghcr-auth.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ permissions:
1010
contents: read
1111
packages: read
1212

13+
env:
14+
GOTOOLCHAIN: local
15+
1316
jobs:
1417
krane:
1518
runs-on: ubuntu-latest
1619
steps:
1720
- uses: actions/checkout@v6
1821
- uses: actions/setup-go@v6
1922
with:
20-
go-version-file: go.mod
23+
go-version-file: '.go-version'
2124

2225
- name: Install krane
2326
working-directory: ./cmd/krane

.github/workflows/presubmit.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ on:
2020
pull_request:
2121
branches: ['main']
2222

23+
env:
24+
GOTOOLCHAIN: local
25+
2326
jobs:
2427
presubmit:
2528
name: Presubmit
@@ -29,5 +32,5 @@ jobs:
2932
- uses: actions/checkout@v6
3033
- uses: actions/setup-go@v6
3134
with:
32-
go-version-file: go.mod
35+
go-version-file: '.go-version'
3336
- run: ./hack/presubmit.sh

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
tags: ['*']
66

7+
env:
8+
GOTOOLCHAIN: local
9+
710
jobs:
811
goreleaser:
912
permissions:
@@ -17,8 +20,9 @@ jobs:
1720
run: git fetch --prune --unshallow
1821
- uses: actions/setup-go@v6
1922
with:
20-
go-version: 1.25
21-
check-latest: true
23+
go-version-file: '.go-version'
24+
check-latest: true # no-op if full version is specified
25+
cache: false
2226
- uses: goreleaser/goreleaser-action@v7.0.0
2327
id: run-goreleaser
2428
with:

.github/workflows/style.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
branches: ['main']
66

7+
env:
8+
GOTOOLCHAIN: local
9+
710
jobs:
811

912
goimports:
@@ -13,7 +16,7 @@ jobs:
1316
- uses: actions/checkout@v6
1417
- uses: actions/setup-go@v6
1518
with:
16-
go-version-file: go.mod
19+
go-version-file: '.go-version'
1720
- uses: chainguard-dev/actions/goimports@main
1821

1922
lint:
@@ -24,7 +27,7 @@ jobs:
2427
- uses: actions/checkout@v6
2528
- uses: actions/setup-go@v6
2629
with:
27-
go-version-file: go.mod
30+
go-version-file: '.go-version'
2831
- uses: golangci/golangci-lint-action@v9.2.0
2932
with:
3033
version: v2.10

.github/workflows/test.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: ['main']
88

9+
env:
10+
GOTOOLCHAIN: local
11+
912
jobs:
1013
test:
1114
name: Unit Tests
@@ -14,7 +17,7 @@ jobs:
1417
- uses: actions/checkout@v6
1518
- uses: actions/setup-go@v6
1619
with:
17-
go-version-file: go.mod
20+
go-version-file: '.go-version'
1821

1922
- run: go test -coverprofile=coverage.txt -covermode=atomic -race ./...
2023

.go-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.25.8

0 commit comments

Comments
 (0)