Skip to content

Commit e391771

Browse files
authored
Use latest Go version when building gotip (#7445)
1 parent 4d8db07 commit e391771

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.github/actions/setup-go-tip/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,18 @@ runs:
4141
4242
# If download failed, we will try to build tip from source.
4343
# This requires Go toolchain, so install it first.
44+
- name: Determine latest Go version
45+
if: steps.download.outputs.success == 'false'
46+
id: get_go_version
47+
run: |
48+
LATEST_GO_VERSION=$(curl -s "https://go.dev/VERSION?m=text")
49+
echo "LATEST_GO_VERSION=$LATEST_GO_VERSION" >> $GITHUB_OUTPUT
50+
4451
- name: Install Go toolchain
4552
if: steps.download.outputs.success == 'false'
4653
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
4754
with:
48-
go-version: 1.24.x
55+
go-version: ${{ steps.get_go_version.outputs.LATEST_GO_VERSION }}
4956

5057
- name: Build Go Tip from source
5158
if: steps.download.outputs.success == 'false'

scripts/lint/check-go-version.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,15 @@ for file in $(find . -type f -name go.mod | grep -v '^./go.mod'); do
9191
if [[ $file == "./idl/go.mod" ]]; then
9292
continue
9393
fi
94+
if [[ $file == "./idl/internal/tools/go.mod" ]]; then
95+
continue
96+
fi
9497
check "$file" "^go\s\+$version_regex" "$go_latest_version"
9598
done
9699

97100
check scripts/build/docker/debug/Dockerfile "^.*golang:$version_regex" "$go_latest_version"
98101

99-
IFS='|' read -r -a gha_workflows <<< "$(grep -rl go-version .github | tr '\n' '|')"
102+
IFS='|' read -r -a gha_workflows <<< "$(grep -rl go-version .github/workflows | tr '\n' '|')"
100103
for gha_workflow in "${gha_workflows[@]}"; do
101104
check "$gha_workflow" "^\s*go-version:\s\+$version_regex" "$go_latest_version"
102105
done

0 commit comments

Comments
 (0)