diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 98c12d5..d852daa 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -137,3 +137,43 @@ jobs: [[ "$(go version)" == *"1.13"* ]] [[ '${{steps.setup_go_1_13_x.outputs.GOROOT}}' == *"1.13"* ]] [[ '${{steps.setup_go_1_13_x.outputs.GOTOOLDIR}}' == *"1.13"* ]] + + - id: setup_go_1_21 + name: install 1.21 + uses: ./ + with: + go-version: '1.21' + ignore-local: true + debug: true + - name: outputs + run: | + echo '*********** env ************' + env + echo '*********** go env ***********' + go env + echo '${{ toJson( steps.setup_go_1_21.outputs ) }}' | jq . + go version + set -ex + [[ "$(go version)" == *"1.21.0"* ]] + [[ '${{steps.setup_go_1_21.outputs.GOROOT}}' == *"1.21.0"* ]] + [[ '${{steps.setup_go_1_21.outputs.GOTOOLDIR}}' == *"1.21.0"* ]] + + - id: setup_go_1_21_0 + name: install 1.21.0 + uses: ./ + with: + go-version: '1.21.0' + ignore-local: true + debug: true + - name: outputs + run: | + echo '*********** env ************' + env + echo '*********** go env ***********' + go env + echo '${{ toJson( steps.setup_go_1_21.outputs ) }}' | jq . + go version + set -ex + [[ "$(go version)" == *"1.21.0"* ]] + [[ '${{steps.setup_go_1_21.outputs.GOROOT}}' == *"1.21.0"* ]] + [[ '${{steps.setup_go_1_21.outputs.GOTOOLDIR}}' == *"1.21.0"* ]] \ No newline at end of file diff --git a/README.md b/README.md index 9e91cd8..22dfc40 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,11 @@ It's like actions/setup-go but faster. ## A Note About Go 1.21.0 -**Use setup-go-faster@v1.9.0 or later** if you want to install Go 1.21.0. +**Use setup-go-faster@v1.9.1 or later** if you want to install Go 1.21.0. -With the release of go1.21.0, the Go team has changed the way they publish -dot-zero releases. They used to be styles go1.N, but now that are go1.N.0. This -caused issues with earlier versions of setup-go-faster. - -**Do not user go-version: 1.21**. Use `go-version: 1.21.0` -or `go-version: 1.21.x` instead. - -I should fix these inconsistencies soon. +With the release of go1.21.0, the Go team has changed the way they style +dot-zero releases. They used to be styled like `go1.N`, but now they are +`go1.N.0`. This caused issues with earlier versions of setup-go-faster. ### Faster diff --git a/action.yml b/action.yml index 43a09ff..08fc1c1 100644 --- a/action.yml +++ b/action.yml @@ -69,9 +69,9 @@ runs: - id: run working-directory: ${{ github.action_path }} env: - DEBUG: "" IGNORE_LOCAL_GO: ${{ inputs.ignore-local }} GO_VERSION: ${{ inputs.go-version }} + DEBUG: "" shell: bash run: src/run branding: diff --git a/bindown.yml b/bindown.yml index 664c5b8..aca16f2 100644 --- a/bindown.yml +++ b/bindown.yml @@ -1,6 +1,6 @@ systems: -- darwin/amd64 -- linux/amd64 + - darwin/amd64 + - linux/amd64 dependencies: action-doc: template: action-doc#action-doc @@ -16,7 +16,7 @@ dependencies: vars: version: 3.1.0 required_vars: - - version + - version shellcheck: template: origin#shellcheck vars: @@ -27,39 +27,37 @@ dependencies: vars: ref: ebc4baa08f045b7ef0f45c4b7d6f34f08d732f3d required_vars: - - ref + - ref templates: action-doc#action-doc: url: https://github.com/WillAbides/action-doc/releases/download/v{{.version}}/action-doc_{{.version}}_{{.os}}_{{.arch}}.tar.gz - required_vars: - - version systems: - - darwin/amd64 - - linux/386 - - linux/amd64 + - darwin/amd64 + - linux/386 + - linux/amd64 + required_vars: + - version origin#octo: url: https://github.com/octo-cli/octo-cli/releases/download/v{{.version}}/octo-cli_{{.version}}_{{.os}}_{{.arch}}.tar.gz archive_path: octo{{.archivepathsuffix}} bin: octo vars: archivepathsuffix: "" - required_vars: - - version overrides: - - matcher: - os: - - windows - dependency: - vars: - archivepathsuffix: .exe - - matcher: - arch: - - arm64 - os: - - darwin - dependency: - vars: - arch: amd64 + - matcher: + os: + - windows + dependency: + vars: + archivepathsuffix: .exe + - matcher: + arch: + - arm64 + os: + - darwin + dependency: + vars: + arch: amd64 substitutions: arch: "386": i386 @@ -69,33 +67,35 @@ templates: linux: Linux windows: Windows systems: - - darwin/386 - - darwin/amd64 - - darwin/arm64 - - linux/386 - - linux/amd64 - - windows/386 - - windows/amd64 + - darwin/386 + - darwin/amd64 + - darwin/arm64 + - linux/386 + - linux/amd64 + - windows/386 + - windows/amd64 + required_vars: + - version origin#shellcheck: url: https://github.com/koalaman/shellcheck/releases/download/v{{.version}}/shellcheck-v{{.version}}.{{.os}}.{{.arch}}.tar.xz archive_path: shellcheck-v{{.version}}/shellcheck bin: shellcheck - required_vars: - - version overrides: - - matcher: - os: - - windows - dependency: - url: https://github.com/koalaman/shellcheck/releases/download/v{{.version}}/shellcheck-v{{.version}}.zip - archive_path: shellcheck-v{{.version}}.exe + - matcher: + os: + - windows + dependency: + url: https://github.com/koalaman/shellcheck/releases/download/v{{.version}}/shellcheck-v{{.version}}.zip + archive_path: shellcheck-v{{.version}}.exe substitutions: arch: amd64: x86_64 systems: - - darwin/amd64 - - linux/amd64 - - windows/amd64 + - darwin/amd64 + - linux/amd64 + - windows/amd64 + required_vars: + - version template_sources: action-doc: https://raw.githubusercontent.com/WillAbides/action-doc/main/bindown.yml origin: https://raw.githubusercontent.com/WillAbides/bindown-templates/master/bindown.yml diff --git a/script/bindown b/script/bindown index 6d225db..fb11d9d 100755 --- a/script/bindown +++ b/script/bindown @@ -6,6 +6,6 @@ CDPATH="" cd -- "$(dirname -- "$(dirname -- "$0")")" mkdir -p bin -[ -f bin/bindown ] || sh -c "$(curl -sfL https://github.com/WillAbides/bindown/releases/download/v3.10.1/bootstrap-bindown.sh)" +[ -f bin/bindown ] || sh -c "$(curl -sfL https://github.com/WillAbides/bindown/releases/download/v4.6.0/bootstrap-bindown.sh)" exec bin/bindown "$@" diff --git a/src/lib b/src/lib index 2d381b3..edcfaad 100755 --- a/src/lib +++ b/src/lib @@ -72,6 +72,7 @@ download_go_url() { install_go() { local go_version="$1" local target_dir="$2" + debug_out "installing go $go_version to $target_dir" rm -rf "$target_dir" mkdir -p "$(dirname "$target_dir")" tmpdir="$(init_tmpdir)" @@ -113,8 +114,9 @@ exe_name() { } is_precise_version() { - [[ $1 =~ ^[0-9]+(.[0-9]+(.[0-9]+)?)?([A-Za-z0-9]+)?$ ]] && return - return 1 + [[ $1 =~ ^[0-9]+(.([0-9]+)(.[0-9]+)?)?([A-Za-z0-9]+)?$ ]] || return 1 + # false when minor is >= 21 and patch is empty + [ -z "${BASH_REMATCH[2]}" ] || [ "${BASH_REMATCH[2]}" -lt 21 ] || [ -n "${BASH_REMATCH[3]}" ] } select_go_version() { diff --git a/src/lib_test.sh b/src/lib_test.sh index 56f9c2f..16c3a39 100755 --- a/src/lib_test.sh +++ b/src/lib_test.sh @@ -40,6 +40,8 @@ test_is_precise_version() { 9999.9999.9999 1.15beta1 1.16rc1 +1.21.0 +1.21.1 ' for v in $versions; do @@ -48,6 +50,7 @@ test_is_precise_version() { done not_versions=' +1.21 * 1.x 1.15.x