From 96256df6c458d0e769464e03f1f785b6e6daa963 Mon Sep 17 00:00:00 2001 From: Michi Mutsuzaki Date: Wed, 18 Oct 2023 20:01:36 +0000 Subject: [PATCH] go.mod: Let Renovate manage Go version Configure Renovate to update Go version in go.mod, and modify workflow files to use go.mod to get the Go version to reduce the number of places Renovate needs to update. Ref: https://github.com/cilium/tetragon/pull/1579 Signed-off-by: Michi Mutsuzaki --- .github/renovate.json5 | 9 +++++++++ .github/workflows/go.yaml | 3 +-- .github/workflows/kind.yaml | 6 ++---- .github/workflows/multicluster.yaml | 3 +-- .github/workflows/release.yaml | 3 +-- go.mod | 1 + 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 7dbbf7effa..00d00f9b49 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -186,6 +186,15 @@ "\/\/ renovate: datasource=(?.*?)\\s+.+Image = \"(?.*):(?.*)@(?sha256:[a-f0-9]+)\"", "\/\/ renovate: datasource=(?.*?) depName=(?.*?)\\s+Version = \"(?.*)\"" ] + }, + { + "customType": "regex", + "fileMatch": [ + "^go\\.mod$" + ], + "matchStrings": [ + "// renovate: datasource=(?.*?) depName=(?.*?)\\s+go (?.*)" + ] } ] } diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 770b67a530..2def131acd 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -21,8 +21,7 @@ jobs: - name: Set up Go uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: - # renovate: datasource=golang-version depName=go - go-version: 1.21.3 + go-version-file: 'go.mod' - name: Run static checks uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 diff --git a/.github/workflows/kind.yaml b/.github/workflows/kind.yaml index f3fd61daa0..1f8856d400 100644 --- a/.github/workflows/kind.yaml +++ b/.github/workflows/kind.yaml @@ -45,8 +45,7 @@ jobs: - name: Set up Go uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: - # renovate: datasource=golang-version depName=go - go-version: 1.21.3 + go-version-file: 'go.mod' - name: Set up Go for root run: | @@ -241,8 +240,7 @@ jobs: - name: Set up Go uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: - # renovate: datasource=golang-version depName=go - go-version: 1.21.3 + go-version-file: 'go.mod' - name: Set up Go for root run: | diff --git a/.github/workflows/multicluster.yaml b/.github/workflows/multicluster.yaml index 1caa633ec5..827ea5d926 100644 --- a/.github/workflows/multicluster.yaml +++ b/.github/workflows/multicluster.yaml @@ -84,8 +84,7 @@ jobs: - name: Set up Go uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: - # renovate: datasource=golang-version depName=go - go-version: 1.21.3 + go-version-file: 'go.mod' - name: Set up job variables id: vars diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f1e23f4d57..04880a8898 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,8 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: - # renovate: datasource=golang-version depName=go - go-version: 1.21.3 + go-version-file: 'go.mod' - name: Generate the artifacts run: make release diff --git a/go.mod b/go.mod index 9584b23c05..3a50057955 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,6 @@ module github.com/cilium/cilium-cli +// renovate: datasource=golang-version depName=go go 1.21.1 // Replace directives from github.com/cilium/cilium. Keep in sync when updating Cilium!