From 6bce231e152a06717b27b081a3d6229b03411dd1 Mon Sep 17 00:00:00 2001 From: xobotyi Date: Wed, 15 Jul 2026 15:15:08 +0200 Subject: [PATCH] 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. --- .github/workflows/ci.yml | 12 ++++++++++-- .github/workflows/release.yml | 5 ++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dad6b63..6540389 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,16 +29,24 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] + # The floor declared by go.mod and the newest stable line: the floor + # proves go install works for the oldest supported toolchain, the + # newest is what releases build with. + go: ["1.25", "1.26"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7 - uses: actions/setup-go@v6 with: - go-version-file: go.mod + go-version: ${{ matrix.go }} - run: go build ./... - run: go test -race ./... release-dry-run: + strategy: + fail-fast: false + matrix: + go: ["1.25", "1.26"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 @@ -46,7 +54,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v6 with: - go-version-file: go.mod + go-version: ${{ matrix.go }} - uses: docker/setup-qemu-action@v4 - uses: docker/setup-buildx-action@v4 - uses: goreleaser/goreleaser-action@v7 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 18ea492..dadab87 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,10 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v6 with: - go-version-file: go.mod + # Pinned to the newest CI-tested line rather than go.mod: the + # directive there is the compatibility floor, not the toolchain + # official binaries should be built with. + go-version: "1.26" # Release builds are hermetic: the Actions cache is writable from # any PR branch, so restoring it here would let a poisoned cache # entry reach the publishing build.