Skip to content

Commit

Permalink
go.mod: Let Renovate manage Go version
Browse files Browse the repository at this point in the history
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: cilium/tetragon#1579

Signed-off-by: Michi Mutsuzaki <[email protected]>
  • Loading branch information
michi-covalent committed Oct 18, 2023
1 parent bbebbfa commit 96256df
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
9 changes: 9 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@
"\/\/ renovate: datasource=(?<datasource>.*?)\\s+.+Image = \"(?<depName>.*):(?<currentValue>.*)@(?<currentDigest>sha256:[a-f0-9]+)\"",
"\/\/ renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)\\s+Version = \"(?<currentValue>.*)\""
]
},
{
"customType": "regex",
"fileMatch": [
"^go\\.mod$"
],
"matchStrings": [
"// renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)\\s+go (?<currentValue>.*)"
]
}
]
}
3 changes: 1 addition & 2 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/multicluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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!
Expand Down

0 comments on commit 96256df

Please sign in to comment.