Skip to content

Commit

Permalink
Merge pull request #27 from brackendawson/fix-version-file
Browse files Browse the repository at this point in the history
The Go VERSION file now also contains a timestamp
  • Loading branch information
brackendawson authored Nov 27, 2024
2 parents 56b98be + 7aa787b commit 5a8cac9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand Down
10 changes: 5 additions & 5 deletions .testdata/sample-versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions gimme
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -652,7 +652,7 @@ _get_curr_stable() {
_update_stable "${stable}"
fi

cat "${stable}"
head -n 1 "${stable}"
}

_get_old_stable() {
Expand Down

0 comments on commit 5a8cac9

Please sign in to comment.