mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #15861 from serathius/go-version-release-3.4
[release-3.4] Move go version to dedicated .go-version file
This commit is contained in:
commit
2db96e817f
9
.github/workflows/go-version.yaml
vendored
9
.github/workflows/go-version.yaml
vendored
@ -1,8 +1,5 @@
|
|||||||
name: Go version setup
|
name: Go version setup
|
||||||
|
|
||||||
env:
|
|
||||||
GO_VERSION: "1.19.9"
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
outputs:
|
outputs:
|
||||||
@ -14,9 +11,11 @@ jobs:
|
|||||||
name: Set Go version variable for all the workflows
|
name: Set Go version variable for all the workflows
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
goversion: ${{ steps.step1.outputs.goversion }}
|
goversion: ${{ steps.goversion.outputs.goversion }}
|
||||||
steps:
|
steps:
|
||||||
- id: step1
|
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
||||||
|
- id: goversion
|
||||||
run: |
|
run: |
|
||||||
|
GO_VERSION=$(cat .go-version)
|
||||||
echo "Go Version: $GO_VERSION"
|
echo "Go Version: $GO_VERSION"
|
||||||
echo "goversion=$GO_VERSION" >> $GITHUB_OUTPUT
|
echo "goversion=$GO_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
1
.go-version
Normal file
1
.go-version
Normal file
@ -0,0 +1 @@
|
|||||||
|
1.19.9
|
@ -83,10 +83,10 @@ main() {
|
|||||||
# Check go version.
|
# Check go version.
|
||||||
log_callout "Checking go version"
|
log_callout "Checking go version"
|
||||||
local go_version current_go_version
|
local go_version current_go_version
|
||||||
go_version="go$(grep -oP '(?<=GO_VERSION:\s")[^"]*' .github/workflows/go-version.yaml | tr -d ' ')"
|
go_version="go$(cat .go-version)"
|
||||||
current_go_version=$(go version | awk '{ print $3 }')
|
current_go_version=$(go version | awk '{ print $3 }')
|
||||||
if [[ "${current_go_version}" != "${go_version}" ]]; then
|
if [[ "${current_go_version}" != "${go_version}" ]]; then
|
||||||
log_error "Current go version is ${current_go_version}, but etcd ${RELEASE_VERSION} requires ${go_version} (see .github/workflows/tests.yaml)."
|
log_error "Current go version is ${current_go_version}, but etcd ${RELEASE_VERSION} requires ${go_version} (see .go-version)."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user