From 2e10ba08e6e08f7fbf15557bce7169915ac7c996 Mon Sep 17 00:00:00 2001 From: cpacker Date: Sun, 21 Dec 2025 20:47:50 -0800 Subject: [PATCH] fix: respect version_type input when releasing from prerelease MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/release.yml | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75c6f66..a2b51ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,25 +66,21 @@ 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 - if [ "$VERSION_TYPE" = "major" ]; then - MAJOR=$((MAJOR + 1)) - MINOR=0 - PATCH=0 - elif [ "$VERSION_TYPE" = "minor" ]; then - MINOR=$((MINOR + 1)) - PATCH=0 - else + # Always bump based on version_type + if [ "$VERSION_TYPE" = "major" ]; then + MAJOR=$((MAJOR + 1)) + MINOR=0 + PATCH=0 + elif [ "$VERSION_TYPE" = "minor" ]; then + 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}"