From 9fc171e1f2912c72cddd17790521e04deb0812a2 Mon Sep 17 00:00:00 2001 From: Rob Marsal Date: Tue, 6 Oct 2026 15:43:05 +0100 Subject: [PATCH] ci: derive RC version from latest release tag --- .github/workflows/publish-rc.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-rc.yaml b/.github/workflows/publish-rc.yaml index aefd14d..94cf47e 100644 --- a/.github/workflows/publish-rc.yaml +++ b/.github/workflows/publish-rc.yaml @@ -53,13 +53,10 @@ jobs: - name: Compute RC version id: version run: | - BASE=$(jq -r '.info.version' openapi.json) - TAGS=$(git ls-remote --tags --refs origin) - - # Staging may not be bumped yet; target the next unreleased patch - while echo "$TAGS" | grep -q "refs/tags/${BASE}$"; do - BASE=$(echo "$BASE" | awk -F. -v OFS=. '{$3++; print}') - done + # Staging spec version is not semver; target the patch after the latest release + LATEST=$(git ls-remote --tags --refs origin \ + | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1) + BASE=$(echo "$LATEST" | awk -F. -v OFS=. '{$3++; print}') N=$(git ls-remote --tags --refs origin "refs/tags/${BASE}-rc.*" | wc -l) VERSION="${BASE}-rc.$((N + 1))"