diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bcefe6b..7370dbc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,6 +38,9 @@ jobs: restore-keys: | ${{ runner.os }}-prebuild- - run: ./gimme module | grep ^export | tee -a "${GITHUB_ENV}" + - uses: actions/setup-go@v5 + with: + go-version: 'stable' - run: make gimme-generate - uses: actions/upload-artifact@v3 with: @@ -84,6 +87,9 @@ jobs: restore-keys: | ${{ runner.os }}-${{ matrix.env.target }}-${{ matrix.env.version }}-test- ${{ runner.os }}-${{ matrix.env.target }}- + - uses: actions/setup-go@v5 + with: + go-version: 'stable' - uses: actions/download-artifact@v3 with: name: gimme-generate-${{ runner.os }} diff --git a/.testdata/sample-versions.txt b/.testdata/sample-versions.txt index 672b6af..d36758c 100644 --- a/.testdata/sample-versions.txt +++ b/.testdata/sample-versions.txt @@ -12,8 +12,8 @@ # -1.19.3 -1.18.8 -1.17.13 -1.16.15 -1.15.15 +1.23.3 +1.22.9 +1.21.13 +1.20.14 +1.19.13 diff --git a/gimme b/gimme index d984db8..49df494 100755 --- a/gimme +++ b/gimme @@ -55,7 +55,7 @@ set -o pipefail [[ ${GIMME_DEBUG} ]] && set -x -readonly GIMME_VERSION="v1.8.0" +readonly GIMME_VERSION="v1.8.1" readonly GIMME_COPYRIGHT="Copyright (c) 2022 gimme contributors" readonly GIMME_LICENSE_URL="https://raw.githubusercontent.com/urfave/gimme/${GIMME_VERSION}/LICENSE" export GIMME_VERSION @@ -523,13 +523,13 @@ _list_versions() { local current_version current_version="$(go env GOROOT 2>/dev/null)" current_version="${current_version##*/go}" - current_version="${current_version%%.${GIMME_OS}.*}" + current_version="${current_version%%."${GIMME_OS}".*}" # 1.1 1.10 1.2 is bad; zsh has `setopt numeric_glob_sort` but bash # doesn't appear to have anything like that. for d in "${GIMME_VERSION_PREFIX}/go"*".${GIMME_OS}."*; do local cleaned="${d##*/go}" - cleaned="${cleaned%%.${GIMME_OS}.*}" + cleaned="${cleaned%%."${GIMME_OS}".*}" echo "${cleaned}" done | _version_sort | while read -r cleaned; do echo -en "${cleaned}" @@ -652,7 +652,7 @@ _get_curr_stable() { _update_stable "${stable}" fi - cat "${stable}" + head -n 1 "${stable}" } _get_old_stable() {