Skip to content

Commit c7a1ac2

Browse files
committed
fix: add package version promotion for stable releases
- Add sf package version promote command for stable releases - All new package versions are created as beta by default - Stable releases now get promoted to released status automatically - Beta releases remain as beta versions - Fixes issue where stable releases were incorrectly marked as beta
1 parent f7eaef7 commit c7a1ac2

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/create-release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,19 @@ jobs:
8282
NEW="$MAJOR.$MINOR.$PATCH"
8383
fi
8484
85+
# Debug: Show all input values
86+
echo "🔍 DEBUG: Input values:"
87+
echo " bump: '${{ github.event.inputs.bump }}'"
88+
echo " custom_version: '${{ github.event.inputs.custom_version }}'"
89+
echo " release_type: '${{ github.event.inputs.release_type }}'"
90+
echo " Calculated NEW before beta check: '$NEW'"
91+
8592
# Add beta suffix if release type is beta
8693
if [ "${{ github.event.inputs.release_type }}" == "beta" ]; then
8794
NEW="${NEW}-beta"
95+
echo " Added beta suffix: '$NEW'"
96+
else
97+
echo " No beta suffix added (release_type is not 'beta')"
8898
fi
8999
90100
echo "current=$CUR" >> $GITHUB_OUTPUT
@@ -412,6 +422,29 @@ jobs:
412422
echo "✅ Created package version: $PACKAGE_VERSION_ID"
413423
echo "Production URL: $PRODUCTION_URL"
414424
echo "Sandbox URL: $SANDBOX_URL"
425+
426+
# Promote package version to released status if it's a stable release
427+
if [ "${{ steps.version.outputs.release_type }}" == "stable" ]; then
428+
echo "🚀 Promoting package version to released status..."
429+
PROMOTE_OUTPUT=$(sf package version promote \
430+
--package "$SF_PACKAGE1_ID@$PACKAGE_VERSION_ID" \
431+
--target-dev-hub pkgorg \
432+
--json 2>&1)
433+
PROMOTE_EXIT_CODE=$?
434+
435+
echo "Package version promote exit code: $PROMOTE_EXIT_CODE"
436+
echo "Package version promote output:"
437+
echo "$PROMOTE_OUTPUT"
438+
439+
if [ $PROMOTE_EXIT_CODE -eq 0 ]; then
440+
echo "✅ Successfully promoted package version to released status"
441+
else
442+
echo "⚠️ WARNING: Failed to promote package version to released status"
443+
echo "Package will remain as beta version"
444+
fi
445+
else
446+
echo "ℹ️ Package version remains as beta (release_type is beta)"
447+
fi
415448
else
416449
echo "❌ ERROR: Failed to create package version"
417450
echo "Exit code: $PACKAGE_VERSION_EXIT_CODE"

0 commit comments

Comments
 (0)