From 17ba31ef8f1db0c7b9ffc044ab6ddf546955b8ec Mon Sep 17 00:00:00 2001 From: cetteup Date: Wed, 11 Jan 2023 12:25:05 +0100 Subject: [PATCH] feat: Accept minor release version string as goversion --- .github/workflows/autotest.yml | 4 ++-- README.md | 2 +- setup-go.sh | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autotest.yml b/.github/workflows/autotest.yml index 6955884..c23f0e0 100644 --- a/.github/workflows/autotest.yml +++ b/.github/workflows/autotest.yml @@ -79,7 +79,7 @@ jobs: goos: [linux] goarch: [amd64] # "" means default - goversion: ["", "1.19", "https://golang.org/dl/go1.16.1.linux-amd64.tar.gz"] + goversion: ["", "1.19", "1.19.5", "https://golang.org/dl/go1.16.1.linux-amd64.tar.gz"] steps: # - name: Wait release docker build for release branches # if: contains(github.ref, 'release') @@ -157,4 +157,4 @@ jobs: build_flags: -v overwrite: true release_tag: v0.1-test-assets - compress_assets: ${{ matrix.compress_assets }} \ No newline at end of file + compress_assets: ${{ matrix.compress_assets }} diff --git a/README.md b/README.md index cfc2c64..1232a3a 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ jobs: | goos | **Mandatory** | `GOOS` is the running program's operating system target: one of `darwin`, `freebsd`, `linux`, and so on. | | goarch | **Mandatory** | `GOARCH` is the running program's architecture target: one of `386`, `amd64`, `arm`, `arm64`, `s390x`, `loong64` and so on. | | goamd64 | **Optional** | `GOAMD64` is the running programs amd64 microarchitecture level, which is available since `go1.18`. It should only be used when `GOARCH` is `amd64`: one of `v1`, `v2`, `v3`, `v4`. | -| goversion | **Optional** | The `Go` compiler version. `latest`([check it here](https://go.dev/VERSION?m=text)) by default, optional `1.13`, `1.14`, `1.15`, `1.16`, `1.17`, `1.18`, `1.19`.
It also takes download URL instead of version string if you'd like to use more specified version. But make sure your URL is `linux-amd64` package, better to find the URL from [Go - Downloads](https://go.dev/dl/).
E.g., `https://dl.google.com/go/go1.13.1.linux-amd64.tar.gz`. | +| goversion | **Optional** | The `Go` compiler version. `latest`([check it here](https://go.dev/VERSION?m=text)) by default, optional `1.13`, `1.14`, `1.15`, `1.16`, `1.17`, `1.18`, `1.19`. You can also define a specific minor release, such as `1.19.5`.
Alternatively takes a download URL instead of version string. Make sure your URL references the `linux-amd64` package. You can find the URL on [Go - Downloads](https://go.dev/dl/).
e.g., `https://dl.google.com/go/go1.13.1.linux-amd64.tar.gz`. | | project_path | **Optional** | Where to run `go build`.
Use `.` by default. | | binary_name | **Optional** | Specify another binary name if do not want to use repository basename.
Use your repository's basename if not set. | | pre_command | **Optional** | Extra command that will be executed before `go build`. You may want to use it to solve dependency if you're NOT using [Go Modules](https://github.com/golang/go/wiki/Modules). | diff --git a/setup-go.sh b/setup-go.sh index 0751fec..7fa9302 100755 --- a/setup-go.sh +++ b/setup-go.sh @@ -18,6 +18,8 @@ elif [[ ${INPUT_GOVERSION} == "1.13" ]]; then GO_LINUX_PACKAGE_URL="https://go.dev/dl/go1.13.15.linux-${ARCH}.tar.gz" elif [[ ${INPUT_GOVERSION} == http* ]]; then GO_LINUX_PACKAGE_URL=${INPUT_GOVERSION} +elif [[ -n ${INPUT_GOVERSION} ]]; then + GO_LINUX_PACKAGE_URL="https://go.dev/dl/go${INPUT_GOVERSION}.linux-${ARCH}.tar.gz" fi wget --progress=dot:mega ${GO_LINUX_PACKAGE_URL} -O go-linux.tar.gz