Skip to content

Commit b0f5205

Browse files
authored
Read the Go version from go.mod in this repo's own workflows (#144)
check, release, and tag-release pinned a floating "1.26" in five places; they now read go.mod, which carries a toolchain directive at go1.26.5, so a patch bump is one line. The reusable workflow keeps the floating constraint on purpose and now says why: it sets up Go in the adopter's checkout, where go-version-file would read their go.mod, not ours.
1 parent a581638 commit b0f5205

5 files changed

Lines changed: 17 additions & 12 deletions

File tree

.github/workflows/aixgo.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ jobs:
9191
- name: Set up Go
9292
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
9393
with:
94+
# Floating on purpose, unlike this repo's own workflows: this job
95+
# checks out the ADOPTER's repository, so go-version-file would read
96+
# their go.mod, not ours. The CLI needs whatever the newest 1.26.x
97+
# is; setup-go resolves that from the floating constraint.
9498
go-version: "1.26"
9599

96100
- name: Install Aixgo CLI
@@ -181,6 +185,10 @@ jobs:
181185
- name: Set up Go
182186
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
183187
with:
188+
# Floating on purpose, unlike this repo's own workflows: this job
189+
# checks out the ADOPTER's repository, so go-version-file would read
190+
# their go.mod, not ours. The CLI needs whatever the newest 1.26.x
191+
# is; setup-go resolves that from the floating constraint.
184192
go-version: "1.26"
185193

186194
- name: Install Aixgo CLI

.github/workflows/check.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@ permissions:
1616
jobs:
1717
check:
1818
runs-on: ubuntu-latest
19-
strategy:
20-
fail-fast: false
21-
matrix:
22-
go-version: ["1.26"]
2319
steps:
2420
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2521
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
2622
with:
27-
go-version: ${{ matrix.go-version }}
23+
go-version-file: 'go.mod'
2824
- run: make check
2925
- name: Upload coverage reports to Codecov
3026
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0

.github/workflows/release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@ jobs:
1010
permissions:
1111
contents: read
1212
runs-on: ubuntu-latest
13-
strategy:
14-
fail-fast: false
15-
matrix:
16-
go-version: ["1.26"]
1713
steps:
1814
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1915
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
2016
with:
21-
go-version: ${{ matrix.go-version }}
17+
go-version-file: 'go.mod'
2218
- run: make check
2319

2420
release:
@@ -30,7 +26,7 @@ jobs:
3026
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3127
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
3228
with:
33-
go-version: "1.26"
29+
go-version-file: 'go.mod'
3430
- name: Extract release notes
3531
id: notes
3632
run: |

.github/workflows/tag-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
- name: Set up Go
5050
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
5151
with:
52-
go-version: "1.26"
52+
go-version-file: 'go.mod'
5353

5454
- name: Verify the release is ready
5555
env:

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ module github.com/aixgo-dev/code
22

33
go 1.26
44

5+
// The single Go pin for this repo's own CI: check, release, and
6+
// tag-release read this file via go-version-file. The reusable workflow
7+
// floats on "1.26" instead, because it runs in adopter checkouts.
8+
toolchain go1.26.5
9+
510
// v0.1.2 was tagged from the wrong commit (the release-prep commit was not yet
611
// pulled), so its version strings and workflow pins point at v0.1.1. The tag
712
// could not be re-pointed: proxy.golang.org and sum.golang.org had already

0 commit comments

Comments
 (0)