From 044daa670c576164a302ac123057cd3eaed69700 Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Sat, 27 Jan 2024 12:03:12 +0000 Subject: [PATCH 1/3] fix: regex not work --- setup-go.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-go.sh b/setup-go.sh index b0d0b3e..8ad558c 100755 --- a/setup-go.sh +++ b/setup-go.sh @@ -7,7 +7,7 @@ GO_LINUX_PACKAGE_URL="https://go.dev/dl/$(curl https://go.dev/VERSION?m=text | h if [[ "${INPUT_GOVERSION##*/}" == "go.mod" ]]; then INPUT_GOVERSION=$(grep -e '^go' -m 1 ${INPUT_GOVERSION} | sed -e 's/go //g') fi -if [[ ${INPUT_GOVERSION} =~ "^1\.[0-9]+" ]]; then +if [[ ${INPUT_GOVERSION} =~ ^1\.[0-9]+ ]]; then LATEST_MINOR_GOVERSION=$(curl -s https://go.dev/dl/ | grep -oP "go${INPUT_GOVERSION}\.\d+" | head -n 1 | cut -c 3-) GO_LINUX_PACKAGE_URL="https://go.dev/dl/go${LATEST_MINOR_GOVERSION}.linux-${ARCH}.tar.gz" elif [[ ${INPUT_GOVERSION} == http* ]]; then From 1475ce0a9f6baf114aba669956032fe12b7596b1 Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Sat, 27 Jan 2024 12:04:28 +0000 Subject: [PATCH 2/3] chore: test with 1.21 --- .github/workflows/autotest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autotest.yml b/.github/workflows/autotest.yml index 5e8b0fb..be17f37 100644 --- a/.github/workflows/autotest.yml +++ b/.github/workflows/autotest.yml @@ -89,7 +89,7 @@ jobs: goos: [linux] goarch: [amd64] # "" means default - goversion: ["", "1.19", "1.19.7", "https://go.dev/dl/go1.19.7.linux-amd64.tar.gz"] + goversion: ["", "1.21", "1.21.1", "https://go.dev/dl/go1.21.6.linux-amd64.tar.gz"] steps: # - name: Wait release docker build for release branches # if: contains(github.ref, 'release') From fd37a289fdd2642eaa5b787d83bb329af8e97126 Mon Sep 17 00:00:00 2001 From: Jay Zhang Date: Sat, 27 Jan 2024 12:12:09 +0000 Subject: [PATCH 3/3] fix: too many match --- setup-go.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-go.sh b/setup-go.sh index 8ad558c..f7552b6 100755 --- a/setup-go.sh +++ b/setup-go.sh @@ -7,7 +7,7 @@ GO_LINUX_PACKAGE_URL="https://go.dev/dl/$(curl https://go.dev/VERSION?m=text | h if [[ "${INPUT_GOVERSION##*/}" == "go.mod" ]]; then INPUT_GOVERSION=$(grep -e '^go' -m 1 ${INPUT_GOVERSION} | sed -e 's/go //g') fi -if [[ ${INPUT_GOVERSION} =~ ^1\.[0-9]+ ]]; then +if [[ ${INPUT_GOVERSION} =~ ^1\.[0-9]+$ ]]; then LATEST_MINOR_GOVERSION=$(curl -s https://go.dev/dl/ | grep -oP "go${INPUT_GOVERSION}\.\d+" | head -n 1 | cut -c 3-) GO_LINUX_PACKAGE_URL="https://go.dev/dl/go${LATEST_MINOR_GOVERSION}.linux-${ARCH}.tar.gz" elif [[ ${INPUT_GOVERSION} == http* ]]; then