Skip to content

Commit ae49aff

Browse files
committed
actions: use go version from Makefile
1 parent c655891 commit ae49aff

File tree

6 files changed

+35
-14
lines changed

6 files changed

+35
-14
lines changed

.github/ISSUE_TEMPLATE/kubernetes_bump.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ run the Cluster API controllers on the new Kubernetes version.
5757
* Prior art: periodic jobs: https://github.com/kubernetes/test-infra/pull/27326
5858
* [ ] Bump the Go version in Cluster API: (if Kubernetes is using a new Go minor version)
5959
* Search for the currently used Go version across the repository and update it
60-
* We have to at least modify it in: `.github/workflows`, `hack/ensure-go.sh`, `.golangci.yml`, `cloudbuild*.yaml`, `go.mod`, `Makefile`, `netlify.toml`, `Tiltfile`
60+
* We have to at least modify it in: `hack/ensure-go.sh`, `.golangci.yml`, `cloudbuild*.yaml`, `go.mod`, `Makefile`, `netlify.toml`, `Tiltfile`
6161
* Prior art: #7135
6262
* [ ] Bump controller-runtime
6363
* [ ] Bump controller-tools

.github/workflows/dependabot.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ jobs:
1717
name: Build
1818
runs-on: ubuntu-latest
1919
steps:
20-
- name: Set up Go 1.x
21-
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # tag=v3.5.0
22-
with:
23-
go-version: '1.19'
24-
id: go
2520
- name: Check out code into the Go module directory
2621
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.3.0
22+
- name: Calculate go version
23+
id: vars
24+
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
25+
- name: Set up Go
26+
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # tag=v3.5.0
27+
with:
28+
go-version: ${{ steps.vars.outputs.go_version }}
2729
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # tag=v3.2.3
2830
name: Restore go cache
2931
with:

.github/workflows/golangci-lint.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ jobs:
1919
- hack/tools
2020
steps:
2121
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.3.0
22-
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # tag=v3.5.0
22+
- name: Calculate go version
23+
id: vars
24+
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
25+
- name: Set up Go
26+
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # tag=v3.5.0
2327
with:
24-
go-version: 1.19
28+
go-version: ${{ steps.vars.outputs.go_version }}
2529
- name: golangci-lint
2630
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # tag=v3.4.0
2731
with:

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ jobs:
2020
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.3.0
2121
with:
2222
fetch-depth: 0
23-
- name: Install go
23+
- name: Calculate go version
24+
id: vars
25+
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
26+
- name: Set up Go
2427
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # tag=v3.5.0
2528
with:
26-
go-version: '^1.19'
29+
go-version: ${{ steps.vars.outputs.go_version }}
2730
- name: generate release artifacts
2831
run: |
2932
make release

.github/workflows/scan.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ jobs:
1919
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3.3.0
2020
with:
2121
ref: ${{ matrix.branch }}
22-
- name: Setup go
23-
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # tag=v3.4.0
22+
- name: Calculate go version
23+
id: vars
24+
run: echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
25+
- name: Set up Go
26+
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # tag=v3.5.0
2427
with:
25-
go-version: 1.19
28+
go-version: ${{ steps.vars.outputs.go_version }}
2629
- name: Run verify container script
27-
run: make verify-container-images
30+
run: make verify-container-images

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,3 +1208,12 @@ $(GOLANGCI_LINT): .github/workflows/golangci-lint.yml # Download golangci-lint u
12081208

12091209
$(GINKGO): # Build ginkgo from tools folder.
12101210
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(GINKGO_PKG) $(GINKGO_BIN) $(GINGKO_VER)
1211+
1212+
## --------------------------------------
1213+
## Helpers
1214+
## --------------------------------------
1215+
1216+
##@ helpers:
1217+
1218+
go-version: ## Print the go version we use to compile our binaries and images
1219+
@echo $(GO_VERSION)

0 commit comments

Comments
 (0)