mirror of
https://github.com/grafana/grafana.git
synced 2024-12-25 08:21:46 -06:00
ci: use go.mod as source of truth for actions/setup-go action (#87574)
* ci: use go.mod as source of truth for actions/setup-go action Signed-off-by: Dave Henderson <dave.henderson@grafana.com> * updating upgrading-go-version.md doc Signed-off-by: Dave Henderson <dave.henderson@grafana.com> --------- Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
This commit is contained in:
parent
49cd917b08
commit
c6a0175c04
2
.github/workflows/alerting-swagger-gen.yml
vendored
2
.github/workflows/alerting-swagger-gen.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
- name: Set go version
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.22.3'
|
||||
go-version-file: go.mod
|
||||
- name: Build swagger
|
||||
run: |
|
||||
make -C pkg/services/ngalert/api/tooling post.json api.json
|
||||
|
2
.github/workflows/bump-version.yml
vendored
2
.github/workflows/bump-version.yml
vendored
@ -58,7 +58,7 @@ jobs:
|
||||
# Go is required for also updating the schema versions as part of the precommit hook:
|
||||
- uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.22.3'
|
||||
go-version-file: go.mod
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
|
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@ -48,7 +48,7 @@ jobs:
|
||||
name: Set go version
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.22.3'
|
||||
go-version-file: go.mod
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
2
.github/workflows/pr-codeql-analysis-go.yml
vendored
2
.github/workflows/pr-codeql-analysis-go.yml
vendored
@ -36,7 +36,7 @@ jobs:
|
||||
- name: Set go version
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.22.3'
|
||||
go-version-file: go.mod
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
|
2
.github/workflows/pr-go-workspace-check.yml
vendored
2
.github/workflows/pr-go-workspace-check.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
||||
- name: Set go version
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.22.3'
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Workspace Sync
|
||||
run: go work sync
|
||||
|
2
.github/workflows/publish-kinds-next.yml
vendored
2
.github/workflows/publish-kinds-next.yml
vendored
@ -36,7 +36,7 @@ jobs:
|
||||
- name: "Setup Go"
|
||||
uses: "actions/setup-go@v4"
|
||||
with:
|
||||
go-version: '1.22.3'
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: "Verify kinds"
|
||||
run: go run .github/workflows/scripts/kinds/verify-kinds.go
|
||||
|
2
.github/workflows/publish-kinds-release.yml
vendored
2
.github/workflows/publish-kinds-release.yml
vendored
@ -39,7 +39,7 @@ jobs:
|
||||
- name: "Setup Go"
|
||||
uses: "actions/setup-go@v4"
|
||||
with:
|
||||
go-version: '1.22.3'
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: "Verify kinds"
|
||||
run: go run .github/workflows/scripts/kinds/verify-kinds.go
|
||||
|
2
.github/workflows/verify-kinds.yml
vendored
2
.github/workflows/verify-kinds.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
||||
- name: "Setup Go"
|
||||
uses: "actions/setup-go@v4"
|
||||
with:
|
||||
go-version: '1.22.3'
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: "Verify kinds"
|
||||
run: go run .github/workflows/scripts/kinds/verify-kinds.go
|
||||
|
@ -6,17 +6,15 @@ Example PR: https://github.com/grafana/grafana/pull/79329
|
||||
|
||||
## The main areas that need to change during the upgrade are:
|
||||
|
||||
- https://github.com/grafana/grafana/blob/d8ecea4ed93efb2e4d64a5ee24bc08f3805f413d/scripts/drone/variables.star#L6
|
||||
- https://github.com/grafana/grafana/blob/d8ecea4ed93efb2e4d64a5ee24bc08f3805f413d/Makefile#L264
|
||||
- https://github.com/grafana/grafana/blob/d8ecea4ed93efb2e4d64a5ee24bc08f3805f413d/Dockerfile#L6
|
||||
- [`go.mod`](/go.mod#L3)
|
||||
- [`go.work`](/go.work#L1)
|
||||
- [`scripts/drone/variables.star`](/scripts/drone/variables.star#L6)
|
||||
- [`Makefile`](/Makefile#L12)
|
||||
- [`Dockerfile`](/Dockerfile#L6)
|
||||
|
||||
Make sure to run `make drone` so that changes to `.star` files are reflected and `drone.yml` is generated.
|
||||
Then, run `go mod tidy` and `go work sync`. Also run `make drone` so changes to `.star` files are reflected and `drone.yml` is updated.
|
||||
|
||||
### Additional files to change
|
||||
|
||||
- Take a look in `.github/workflows` folder for what `go` version is being used there in various workflows.
|
||||
- Make sure to create a PR with the corresponding changes in `grafana/grafana-enterprise` repository.
|
||||
|
||||
## Updating the go.mod file
|
||||
|
||||
Please avoid updating the `go.mod` to the newest version unless really necessary. This ensures backwards compatibility and introduces less breaking changes. Always upgrade Go version in the runtime files above first, let them run for a couple of weeks and only then consider updating the `go.mod` file if necessary.
|
||||
|
Loading…
Reference in New Issue
Block a user