mirror of
https://github.com/lukaszraczylo/go-telegram.git
synced 2026-06-05 22:43:59 +00:00
fix(release): tag bot-api marker before library version
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user