From af180b75c5b6e757b1a9a2a59c366cd841decb6f Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Sat, 9 May 2026 19:58:14 +0100 Subject: [PATCH] fix(release): tag bot-api marker before library version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit semver-generator picks the chronologically most-recent tag as the version base. The previous order tagged the lib version first, then bot-api-vX.Y, leaving the bot-api tag as the most recent. semver- generator then treated 'vX.Y' as the base, couldn't parse it as full SemVer (no patch number), and silently restarted numbering from v0.0.x — causing surprise version downgrades like v1.1.1 -> v0.0.4 and v0.1.1 -> v0.0.2. Tagging bot-api-vX.Y first and the library version last keeps the library tag as the chronologically last one, so subsequent runs see it as the version base and bump correctly. --- .github/workflows/ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57f58b7..f29be88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -247,9 +247,14 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git tag -a "$LIB_TAG" -m "Release $LIB_TAG" - git push origin "$LIB_TAG" + # Tag the bot-api marker FIRST, then the library version LAST. + # Order matters: semver-generator picks the chronologically most + # recent tag as the version base. With bot-api-vX.Y created after + # the library tag, semver-generator sees "vX.Y", can't parse it + # as full SemVer, and silently restarts numbering from v0.0.x. + # Tagging the lib version last keeps it as the most-recent tag + # so subsequent runs bump from it correctly. if [ -n "$API_TAG" ]; then # Force-update the bot-api tag so it always points at the latest # release that supports that API version. @@ -262,6 +267,9 @@ jobs: fi fi + git tag -a "$LIB_TAG" -m "Release $LIB_TAG" + git push origin "$LIB_TAG" + - name: Run GoReleaser if: github.event_name != 'workflow_dispatch' || inputs.dry-run-release == false uses: goreleaser/goreleaser-action@v6