From 45d8cb254e1d00041b99039529ff3ff297f622f4 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Tue, 9 May 2023 12:18:29 +0200 Subject: [PATCH] Move go version to dedicated .go-version file Signed-off-by: Marek Siarkowicz --- .github/workflows/go-version.yaml | 9 ++++----- .go-version | 1 + scripts/release | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 .go-version diff --git a/.github/workflows/go-version.yaml b/.github/workflows/go-version.yaml index f109a78f105..12831ed7715 100644 --- a/.github/workflows/go-version.yaml +++ b/.github/workflows/go-version.yaml @@ -1,8 +1,5 @@ name: Go version setup -env: - GO_VERSION: "1.19.9" - on: workflow_call: outputs: @@ -14,9 +11,11 @@ jobs: name: Set Go version variable for all the workflows runs-on: ubuntu-latest outputs: - goversion: ${{ steps.step1.outputs.goversion }} + goversion: ${{ steps.goversion.outputs.goversion }} steps: - - id: step1 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - id: goversion run: | + GO_VERSION=$(cat .go-version) echo "Go Version: $GO_VERSION" echo "goversion=$GO_VERSION" >> $GITHUB_OUTPUT diff --git a/.go-version b/.go-version new file mode 100644 index 00000000000..ec581960fd8 --- /dev/null +++ b/.go-version @@ -0,0 +1 @@ +1.19.9 \ No newline at end of file diff --git a/scripts/release b/scripts/release index 0b881073a22..543559782d8 100755 --- a/scripts/release +++ b/scripts/release @@ -112,10 +112,10 @@ main() { # Check go version. log_callout "Check 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 }') if [[ "${current_go_version}" != "${go_version}" ]]; then - log_error "Current go version is ${current_go_version}, but etcd ${RELEASE_VERSION} requires ${go_version} (see .travis.yml)." + log_error "Current go version is ${current_go_version}, but etcd ${RELEASE_VERSION} requires ${go_version} (see .go-version)." exit 1 fi