Skip to content

Commit b16673b

Browse files
committed
test and build against both supported Go lines
The go directive is the compatibility floor, not the toolchain to validate or ship with. Tests and the goreleaser dry run now run a matrix over 1.25 and 1.26: the floor proves go install works for the oldest supported toolchain, the newest is what releases build with. The publishing build pins 1.26 explicitly -- with the directive lowered, go-version-file would have silently downgraded official binaries to the floor toolchain. Lint stays on the floor, where typechecking is strictest for the module's declared language version.
1 parent a07fc5d commit b16673b

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,32 @@ jobs:
2929
fail-fast: false
3030
matrix:
3131
os: [ubuntu-latest, macos-latest, windows-latest]
32+
# The floor declared by go.mod and the newest stable line: the floor
33+
# proves go install works for the oldest supported toolchain, the
34+
# newest is what releases build with.
35+
go: ["1.25", "1.26"]
3236
runs-on: ${{ matrix.os }}
3337
steps:
3438
- uses: actions/checkout@v7
3539
- uses: actions/setup-go@v6
3640
with:
37-
go-version-file: go.mod
41+
go-version: ${{ matrix.go }}
3842
- run: go build ./...
3943
- run: go test -race ./...
4044

4145
release-dry-run:
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
go: ["1.25", "1.26"]
4250
runs-on: ubuntu-latest
4351
steps:
4452
- uses: actions/checkout@v7
4553
with:
4654
fetch-depth: 0
4755
- uses: actions/setup-go@v6
4856
with:
49-
go-version-file: go.mod
57+
go-version: ${{ matrix.go }}
5058
- uses: docker/setup-qemu-action@v4
5159
- uses: docker/setup-buildx-action@v4
5260
- uses: goreleaser/goreleaser-action@v7

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ jobs:
2020
fetch-depth: 0
2121
- uses: actions/setup-go@v6
2222
with:
23-
go-version-file: go.mod
23+
# Pinned to the newest CI-tested line rather than go.mod: the
24+
# directive there is the compatibility floor, not the toolchain
25+
# official binaries should be built with.
26+
go-version: "1.26"
2427
# Release builds are hermetic: the Actions cache is writable from
2528
# any PR branch, so restoring it here would let a poisoned cache
2629
# entry reach the publishing build.

0 commit comments

Comments
 (0)