Skip to content

Commit 5a8cac9

Browse files
Merge pull request #27 from brackendawson/fix-version-file
The Go VERSION file now also contains a timestamp
2 parents 56b98be + 7aa787b commit 5a8cac9

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
restore-keys: |
3939
${{ runner.os }}-prebuild-
4040
- run: ./gimme module | grep ^export | tee -a "${GITHUB_ENV}"
41+
- uses: actions/setup-go@v5
42+
with:
43+
go-version: 'stable'
4144
- run: make gimme-generate
4245
- uses: actions/upload-artifact@v3
4346
with:
@@ -84,6 +87,9 @@ jobs:
8487
restore-keys: |
8588
${{ runner.os }}-${{ matrix.env.target }}-${{ matrix.env.version }}-test-
8689
${{ runner.os }}-${{ matrix.env.target }}-
90+
- uses: actions/setup-go@v5
91+
with:
92+
go-version: 'stable'
8793
- uses: actions/download-artifact@v3
8894
with:
8995
name: gimme-generate-${{ runner.os }}

.testdata/sample-versions.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
#
1414

15-
1.19.3
16-
1.18.8
17-
1.17.13
18-
1.16.15
19-
1.15.15
15+
1.23.3
16+
1.22.9
17+
1.21.13
18+
1.20.14
19+
1.19.13

gimme

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ set -o pipefail
5555

5656
[[ ${GIMME_DEBUG} ]] && set -x
5757

58-
readonly GIMME_VERSION="v1.8.0"
58+
readonly GIMME_VERSION="v1.8.1"
5959
readonly GIMME_COPYRIGHT="Copyright (c) 2022 gimme contributors"
6060
readonly GIMME_LICENSE_URL="https://raw.githubusercontent.com/urfave/gimme/${GIMME_VERSION}/LICENSE"
6161
export GIMME_VERSION
@@ -523,13 +523,13 @@ _list_versions() {
523523
local current_version
524524
current_version="$(go env GOROOT 2>/dev/null)"
525525
current_version="${current_version##*/go}"
526-
current_version="${current_version%%.${GIMME_OS}.*}"
526+
current_version="${current_version%%."${GIMME_OS}".*}"
527527

528528
# 1.1 1.10 1.2 is bad; zsh has `setopt numeric_glob_sort` but bash
529529
# doesn't appear to have anything like that.
530530
for d in "${GIMME_VERSION_PREFIX}/go"*".${GIMME_OS}."*; do
531531
local cleaned="${d##*/go}"
532-
cleaned="${cleaned%%.${GIMME_OS}.*}"
532+
cleaned="${cleaned%%."${GIMME_OS}".*}"
533533
echo "${cleaned}"
534534
done | _version_sort | while read -r cleaned; do
535535
echo -en "${cleaned}"
@@ -652,7 +652,7 @@ _get_curr_stable() {
652652
_update_stable "${stable}"
653653
fi
654654

655-
cat "${stable}"
655+
head -n 1 "${stable}"
656656
}
657657

658658
_get_old_stable() {

0 commit comments

Comments
 (0)