Skip to content

Commit

Permalink
Merge pull request #18 from WillAbides/dotzero
Browse files Browse the repository at this point in the history
support .0 releases starting with 1.21.0
  • Loading branch information
WillAbides authored Aug 3, 2023
2 parents 5f7ab31 + baaad2a commit c24c7eb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ jobs:
matrix:
os:
- ubuntu-20.04
- ubuntu-18.04
- ubuntu-22.04
- windows-2019
- macos-10.15
- windows-2022
- macos-11
runs-on: ${{ matrix.os }}
defaults:
run:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- windows-2019
- ubuntu-22.04
- windows-2022
runs-on: ${{ matrix.os }}
defaults:
run:
Expand Down Expand Up @@ -37,9 +37,10 @@ jobs:
matrix:
os:
- ubuntu-20.04
- ubuntu-18.04
- ubuntu-22.04
- windows-2019
- macos-10.15
- windows-2022
- macos-11
runs-on: ${{ matrix.os }}
defaults:
run:
Expand Down
8 changes: 8 additions & 0 deletions src/lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ sub go_version_string {
my $major_v = $$v{"major"};
my $minor_v = $$v{"minor"};
my $patch_v = $$v{"patch"};

# For 1.21 and above with no pre-release, always return major.minor.patch
if ( $major_v > 1 || ( $major_v == 1 && $minor_v >= 21 ) ) {
if ( $$v{"pre_release"} eq "" ) {
return "$major_v.$minor_v.$patch_v";
}
}

$patch_v = "" if $patch_v == 0;
$minor_v = "" if $minor_v == 0 && $patch_v eq "";
my $st = "$$v{'major'}";
Expand Down
3 changes: 3 additions & 0 deletions src/lib_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ test_select_go_version() {
do_test_select_go_version "" "x" "1.14beta1"
do_test_select_go_version "0" "x" "0"
do_test_select_go_version "" "1.2.3"
do_test_select_go_version "1.21.0" "1.21.x" "1.21.0"
do_test_select_go_version "1.21.0" "1.21" "1.21.0"
do_test_select_go_version "1.20" "1.20.x" "1.20.0"
}

test_select_remote_version() {
Expand Down

0 comments on commit c24c7eb

Please sign in to comment.