diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 269ace9..a71b0a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index d928100..316a8e5 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -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: @@ -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: diff --git a/src/lib.pl b/src/lib.pl index 8a6c0ed..c7b7800 100644 --- a/src/lib.pl +++ b/src/lib.pl @@ -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'}"; diff --git a/src/lib_test.sh b/src/lib_test.sh index 86c6dac..56f9c2f 100755 --- a/src/lib_test.sh +++ b/src/lib_test.sh @@ -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() {