diff --git a/.github/actions/setup-go-tip/action.yml b/.github/actions/setup-go-tip/action.yml index 4ee364a..d557da3 100644 --- a/.github/actions/setup-go-tip/action.yml +++ b/.github/actions/setup-go-tip/action.yml @@ -1,10 +1,11 @@ +# Inspired by https://github.com/actions/setup-go/issues/21#issuecomment-997208686 name: 'Install Go Tip' description: 'Install Go Tip toolchain' runs: using: "composite" steps: - - name: Try to download Go Tip - id: try-to-download-go-tip + - name: Download Go Tip + id: download-go-tip shell: bash run: | set -euo pipefail @@ -25,7 +26,7 @@ runs: echo "download_status=${success}" >> $GITHUB_OUTPUT - name: Install Go Tip - if: steps.try-to-download-go-tip.outputs.download_status == 'true' + if: steps.download-go-tip.outputs.download_status == 'true' shell: bash run: | echo "Downloaded bundle:" @@ -38,21 +39,19 @@ runs: echo "GOROOT=$GOROOT" >> $GITHUB_ENV echo "GOPATH=$GOPATH" >> $GITHUB_ENV echo "PATH=$PATH" >> $GITHUB_ENV - echo "Active Go version:" - go version - name: Build Go Tip from source - if: steps.try-to-download-go-tip.outputs.download_status == 'false' + if: steps.download-go-tip.outputs.download_status == 'false' shell: bash run: | go install golang.org/dl/gotip@latest gotip download echo "GOROOT=$(go env GOROOT)" >> $GITHUB_ENV echo "GOTIP_BIN=$(go env GOPATH)/bin/gotip" >> $GITHUB_ENV - - - name: Fail if Go Tip is not installed - if: steps.try-to-download-go-tip.outputs.download_status == 'false' && failure() + + - name: Check Go Version shell: bash run: | - echo "Both downloading and building Go Tip failed." - exit 1 + echo "Active Go version:" + go version +