From a7f3903322a06f85372adb1c7b215d67cd49e2ed Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 17 Jul 2024 14:02:18 +0200 Subject: [PATCH 1/3] if prerelease is also compare make a simple string compare of metadata --- version.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/version.go b/version.go index 54e4829..1459f54 100644 --- a/version.go +++ b/version.go @@ -141,7 +141,11 @@ func (v *Version) Compare(other *Version) int { return -1 } - return comparePrereleases(preSelf, preOther) + if comp := comparePrereleases(preSelf, preOther); comp != 0 { + return comp + } else { + return strings.Compare(v.metadata, other.metadata) + } } // Get the highest specificity (hS), or if they're equal, just use segmentSelf length From 90a3b2fa88b68a4a0547b6a6bed7f1f01cad0e24 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 17 Jul 2024 14:13:34 +0200 Subject: [PATCH 2/3] fix lint --- version.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/version.go b/version.go index 5443ea3..4ca416b 100644 --- a/version.go +++ b/version.go @@ -148,9 +148,8 @@ func (v *Version) Compare(other *Version) int { if comp := comparePrereleases(preSelf, preOther); comp != 0 { return comp - } else { - return strings.Compare(v.metadata, other.metadata) } + return strings.Compare(v.metadata, other.metadata) } // Get the highest specificity (hS), or if they're equal, just use segmentSelf length From 3437d78cfe18e5532ef89628d38250e94560e814 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 17 Jul 2024 14:24:38 +0200 Subject: [PATCH 3/3] update ci tools --- .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9fa402a..75a0ff6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,10 +9,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Test run: go test ./... diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e6ea0d4..ccc4387 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: 1.18.x - name: Checkout code @@ -20,11 +20,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - version: v1.59.1 + uses: golangci/golangci-lint-action@v6 test: strategy: