From f0e146e23f83501821ffddd538a1bf404e74a4e7 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Tue, 8 Aug 2023 15:48:17 -0500 Subject: [PATCH 1/7] 1.21 integration tests --- .github/workflows/integration.yml | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 98c12d5..8f29fe6 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -137,3 +137,41 @@ 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 + - 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 + - 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 From 6cf05559c06ee1b020ac4707fd886cb3db44480f Mon Sep 17 00:00:00 2001 From: Will Roden Date: Tue, 8 Aug 2023 15:50:38 -0500 Subject: [PATCH 2/7] debug --- .github/workflows/integration.yml | 2 ++ action.yml | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8f29fe6..d852daa 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -144,6 +144,7 @@ jobs: with: go-version: '1.21' ignore-local: true + debug: true - name: outputs run: | echo '*********** env ************' @@ -163,6 +164,7 @@ jobs: with: go-version: '1.21.0' ignore-local: true + debug: true - name: outputs run: | echo '*********** env ************' diff --git a/action.yml b/action.yml index 43a09ff..c9d0519 100644 --- a/action.yml +++ b/action.yml @@ -47,6 +47,11 @@ inputs: of checking whether a newer version is available for download. With ignore-local, the action will always check for a newer version available for download. Set this to any non-empty value to enable. + + debug: + required: false + description: | + Set this to any non-empty value to enable debug logging. outputs: GOCACHE: description: output of `go env GOCACHE` @@ -69,9 +74,9 @@ runs: - id: run working-directory: ${{ github.action_path }} env: - DEBUG: "" IGNORE_LOCAL_GO: ${{ inputs.ignore-local }} GO_VERSION: ${{ inputs.go-version }} + DEBUG: ${{ inputs.debug }} shell: bash run: src/run branding: From 5d13eafa5905c97783d24cdbed53e52fbe6e12a0 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Tue, 8 Aug 2023 15:53:23 -0500 Subject: [PATCH 3/7] generate --- README.md | 5 +++ bindown.yml | 86 +++++++++++++++++++++++++------------------------- script/bindown | 2 +- 3 files changed, 49 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 9e91cd8..4578651 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,11 @@ action will always check for a newer version available for download. Set this to to enable. +### debug + +Set this to any non-empty value to enable debug logging. + + ## Outputs ### GOCACHE 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 "$@" From beea216aef02ff54f5652fab2e2d77a258be4679 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Tue, 8 Aug 2023 15:57:27 -0500 Subject: [PATCH 4/7] debug install_go --- .github/workflows/integration.yml | 58 +++++++++++++++---------------- src/lib | 1 + 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index d852daa..4a7fcf5 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,35 +1,35 @@ name: integration on: [ push, workflow_dispatch ] jobs: - install_go_tip: - name: install tip - strategy: - fail-fast: false - matrix: - os: - - ubuntu-22.04 - - windows-2022 - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash - steps: - - uses: actions/checkout@v3.3.0 - - id: setup_go - name: install tip - uses: ./ - with: - go-version: tip - - name: outputs - run: | - echo '*********** env ************' - env - echo '*********** go env ***********' - go env - echo '${{ toJson( steps.setup_go.outputs ) }}' | jq . - go version - set -ex - [[ "$(go version)" == *"devel"* ]] +# install_go_tip: +# name: install tip +# strategy: +# fail-fast: false +# matrix: +# os: +# - ubuntu-22.04 +# - windows-2022 +# runs-on: ${{ matrix.os }} +# defaults: +# run: +# shell: bash +# steps: +# - uses: actions/checkout@v3.3.0 +# - id: setup_go +# name: install tip +# uses: ./ +# with: +# go-version: tip +# - name: outputs +# run: | +# echo '*********** env ************' +# env +# echo '*********** go env ***********' +# go env +# echo '${{ toJson( steps.setup_go.outputs ) }}' | jq . +# go version +# set -ex +# [[ "$(go version)" == *"devel"* ]] install_go: name: install go strategy: diff --git a/src/lib b/src/lib index 2d381b3..b1402a3 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)" From a6863d5712650f2e6a11beb42b5fbc99ef447a46 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Tue, 8 Aug 2023 16:13:11 -0500 Subject: [PATCH 5/7] 1.21 is not a precise version --- src/lib | 5 +++-- src/lib_test.sh | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib b/src/lib index b1402a3..edcfaad 100755 --- a/src/lib +++ b/src/lib @@ -114,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 From 2c4fb94571a7584349513aa4cedc482955f4053d Mon Sep 17 00:00:00 2001 From: Will Roden Date: Tue, 8 Aug 2023 16:20:03 -0500 Subject: [PATCH 6/7] revert debug changes --- .github/workflows/integration.yml | 58 +++++++++++++++---------------- README.md | 5 --- action.yml | 7 +--- 3 files changed, 30 insertions(+), 40 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4a7fcf5..d852daa 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,35 +1,35 @@ name: integration on: [ push, workflow_dispatch ] jobs: -# install_go_tip: -# name: install tip -# strategy: -# fail-fast: false -# matrix: -# os: -# - ubuntu-22.04 -# - windows-2022 -# runs-on: ${{ matrix.os }} -# defaults: -# run: -# shell: bash -# steps: -# - uses: actions/checkout@v3.3.0 -# - id: setup_go -# name: install tip -# uses: ./ -# with: -# go-version: tip -# - name: outputs -# run: | -# echo '*********** env ************' -# env -# echo '*********** go env ***********' -# go env -# echo '${{ toJson( steps.setup_go.outputs ) }}' | jq . -# go version -# set -ex -# [[ "$(go version)" == *"devel"* ]] + install_go_tip: + name: install tip + strategy: + fail-fast: false + matrix: + os: + - ubuntu-22.04 + - windows-2022 + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v3.3.0 + - id: setup_go + name: install tip + uses: ./ + with: + go-version: tip + - name: outputs + run: | + echo '*********** env ************' + env + echo '*********** go env ***********' + go env + echo '${{ toJson( steps.setup_go.outputs ) }}' | jq . + go version + set -ex + [[ "$(go version)" == *"devel"* ]] install_go: name: install go strategy: diff --git a/README.md b/README.md index 4578651..9e91cd8 100644 --- a/README.md +++ b/README.md @@ -117,11 +117,6 @@ action will always check for a newer version available for download. Set this to to enable. -### debug - -Set this to any non-empty value to enable debug logging. - - ## Outputs ### GOCACHE diff --git a/action.yml b/action.yml index c9d0519..08fc1c1 100644 --- a/action.yml +++ b/action.yml @@ -47,11 +47,6 @@ inputs: of checking whether a newer version is available for download. With ignore-local, the action will always check for a newer version available for download. Set this to any non-empty value to enable. - - debug: - required: false - description: | - Set this to any non-empty value to enable debug logging. outputs: GOCACHE: description: output of `go env GOCACHE` @@ -76,7 +71,7 @@ runs: env: IGNORE_LOCAL_GO: ${{ inputs.ignore-local }} GO_VERSION: ${{ inputs.go-version }} - DEBUG: ${{ inputs.debug }} + DEBUG: "" shell: bash run: src/run branding: From 5d033a128325fe3992e2dc2a01673653fe9ae165 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Tue, 8 Aug 2023 16:23:52 -0500 Subject: [PATCH 7/7] update README.md --- README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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