From c98fddbd03c95d0da3295528e2b253ab24c3b656 Mon Sep 17 00:00:00 2001 From: Jesper Noordsij <45041769+jnoordsij@users.noreply.github.com> Date: Mon, 23 Feb 2026 15:08:05 +0100 Subject: [PATCH] Simplify Go version refs in CI templates --- .github/workflows/build.yaml | 5 ++--- .github/workflows/codeql.yml | 1 + .github/workflows/experimental.yaml | 5 ++--- .github/workflows/release.yaml | 6 ++---- .github/workflows/test-integration.yaml | 13 ++++++------- .github/workflows/test-unit.yaml | 11 ++++------- .github/workflows/validate.yaml | 13 ++++++------- go.mod | 7 ++++++- 8 files changed, 29 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 64d9493a8..6db3a2a8e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,7 +10,6 @@ on: - 'script/gcg/**' env: - GO_VERSION: '1.25' CGO_ENABLED: 0 jobs: @@ -55,12 +54,12 @@ jobs: with: fetch-depth: 0 - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 env: ImageOS: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.goarm }} with: - go-version: ${{ env.GO_VERSION }} + go-version-file: 'go.mod' check-latest: true - name: Artifact webui diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b0db53ca3..583023498 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -35,6 +35,7 @@ jobs: if: ${{ matrix.language == 'go' }} with: go-version-file: 'go.mod' + check-latest: true # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/experimental.yaml b/.github/workflows/experimental.yaml index 78b5c24d9..6e4a7f384 100644 --- a/.github/workflows/experimental.yaml +++ b/.github/workflows/experimental.yaml @@ -7,7 +7,6 @@ on: - v* env: - GO_VERSION: '1.25' CGO_ENABLED: 0 jobs: @@ -27,12 +26,12 @@ jobs: with: fetch-depth: 0 - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 env: ImageOS: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.goarm }} with: - go-version: ${{ env.GO_VERSION }} + go-version-file: 'go.mod' check-latest: true - name: Build diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f7e8acdf8..91a9a0aea 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,7 +6,6 @@ on: - 'v*.*.*' env: - GO_VERSION: '1.25' CGO_ENABLED: 0 VERSION: ${{ github.ref_name }} TRAEFIKER_EMAIL: "traefiker@traefik.io" @@ -34,13 +33,13 @@ jobs: with: fetch-depth: 0 - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 env: # Ensure cache consistency on Linux, see https://github.com/actions/setup-go/pull/383 ImageOS: ${{ matrix.os }} with: - go-version: ${{ env.GO_VERSION }} + go-version-file: 'go.mod' check-latest: true - name: Artifact webui @@ -133,4 +132,3 @@ jobs: gh release create ${VERSION} ./dist/**/traefik*.{zip,tar.gz} ./dist/traefik*.{tar.gz,txt} --repo traefik/traefik --title ${VERSION} --notes ${VERSION} --latest=false ./script/deploy.sh - diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index 4bcbb61c1..f903cc409 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -10,7 +10,6 @@ on: - 'script/gcg/**' env: - GO_VERSION: '1.25' CGO_ENABLED: 0 jobs: @@ -24,10 +23,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: 'go.mod' check-latest: true - name: Avoid generating webui @@ -41,7 +40,7 @@ jobs: with: path: | ~/.cache/go-build - key: ${{ runner.os }}-go-build-cache-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.mod', '**/go.sum') }} - name: Artifact traefik binary uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 @@ -66,10 +65,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: 'go.mod' check-latest: true - name: Avoid generating webui @@ -89,7 +88,7 @@ jobs: with: path: | ~/.cache/go-build - key: ${{ runner.os }}-go-build-cache-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }} + key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.mod', '**/go.sum') }} - name: Generate go test Slice id: test_split diff --git a/.github/workflows/test-unit.yaml b/.github/workflows/test-unit.yaml index 80a1dcdab..7b9b01d4e 100644 --- a/.github/workflows/test-unit.yaml +++ b/.github/workflows/test-unit.yaml @@ -9,9 +9,6 @@ on: - '**.md' - 'script/gcg/**' -env: - GO_VERSION: '1.25' - jobs: generate-packages: @@ -25,10 +22,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: 'go.mod' check-latest: true - name: Generate matrix @@ -51,10 +48,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: 'go.mod' check-latest: true - name: Avoid generating webui diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 57104ea3a..f48a8213d 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -6,7 +6,6 @@ on: - '*' env: - GO_VERSION: '1.25' GOLANGCI_LINT_VERSION: v2.10.1 MISSPELL_VERSION: v0.7.0 @@ -21,10 +20,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: 'go.mod' check-latest: true - name: golangci-lint @@ -41,10 +40,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: 'go.mod' check-latest: true - name: Install misspell ${{ env.MISSPELL_VERSION }} @@ -65,10 +64,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Go ${{ env.GO_VERSION }} + - name: Set up Go uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 with: - go-version: ${{ env.GO_VERSION }} + go-version-file: 'go.mod' check-latest: true - name: go generate diff --git a/go.mod b/go.mod index 73df81318..2b0569879 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,11 @@ module github.com/traefik/traefik/v2 -go 1.25.0 +// Only specify the major.minor version here. +// CI workflows read this value via go-version-file and use check-latest +// to automatically pick up the newest patch release. +// Pinning a patch version would defeat that mechanism and require manual +// bumps for every Go patch release. +go 1.25 require ( github.com/BurntSushi/toml v1.5.0