fix: respect version_type input when releasing from prerelease

Previously, going from prerelease → stable would ignore the version_type
input and just drop the suffix. Now major/minor bumps are always respected,
and only patch releases from prerelease skip the bump.

🤖 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>
This commit is contained in:
cpacker
2025-12-21 20:47:50 -08:00
parent 3cbfaa66d1
commit 2e10ba08e6

View File

@@ -66,13 +66,7 @@ jobs:
MINOR=${VERSION_PARTS[1]}
PATCH=${VERSION_PARTS[2]}
# Determine if we should bump the base version
# - Stable → Stable: bump
# - Stable → Prerelease: bump
# - Prerelease → Stable: no bump (just drop suffix)
# - Prerelease → Prerelease: no bump (just increment prerelease number)
if [ "$OLD_IS_PRERELEASE" = "false" ]; then
# Bump based on type
# Always bump based on version_type
if [ "$VERSION_TYPE" = "major" ]; then
MAJOR=$((MAJOR + 1))
MINOR=0
@@ -81,10 +75,12 @@ jobs:
MINOR=$((MINOR + 1))
PATCH=0
else
# patch - only bump if not coming from prerelease
# (prerelease → stable with patch just drops the suffix)
if [ "$OLD_IS_PRERELEASE" = "false" ]; then
PATCH=$((PATCH + 1))
fi
fi
# If old version is prerelease, we keep the same base version
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"