Skip to content

Commit 55fe16a

Browse files
committed
chore: Use pre tag on npm for prerelease
1 parent 12a0f23 commit 55fe16a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sdk/scripts/release.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ show_help() {
2626
echo " 5. Performs a comprehensive smoke test on the packed tarball:"
2727
echo " - Verifies the packed \`dist\` contents match the local build via checksum."
2828
echo " - Runs \`npx rw-scripts smoke-tests\` in a temporary project."
29-
echo " 6. If smoke tests pass, publishes the .tgz tarball to npm."
29+
echo " 6. If smoke tests pass, publishes the .tgz tarball to npm (using --tag pre for prereleases and --tag test for test builds)."
3030
echo " 7. On successful publish (for non-prereleases):"
3131
echo " - Updates dependencies in the monorepo."
3232
echo " - Amends the initial commit with dependency updates."
@@ -44,9 +44,9 @@ show_help() {
4444
echo " pnpm release patch # 0.1.0 -> 0.1.1"
4545
echo " pnpm release minor # 0.1.1 -> 0.2.0"
4646
echo " pnpm release major # 0.2.0 -> 1.0.0"
47-
echo " pnpm release preminor # 0.0.80 -> 0.1.0-alpha.0"
48-
echo " pnpm release preminor --preid beta # 0.0.80 -> 0.1.0-beta.0"
49-
echo " pnpm release prepatch --preid rc # 0.1.0 -> 0.1.1-rc.0"
47+
echo " pnpm release preminor # 0.0.80 -> 0.1.0-alpha.0 (published as @pre)"
48+
echo " pnpm release preminor --preid beta # 0.0.80 -> 0.1.0-beta.0 (published as @pre)"
49+
echo " pnpm release prepatch --preid rc # 0.1.0 -> 0.1.1-rc.0 (published as @pre)"
5050
echo " pnpm release test # 1.0.0 -> 1.0.0-test.0 (published as @test)"
5151
echo " pnpm release patch --dry # Show what would happen"
5252
exit 0
@@ -279,13 +279,17 @@ echo -e "\n🚀 Publishing version $NEW_VERSION..."
279279
if [[ "$DRY_RUN" == true ]]; then
280280
if [[ "$VERSION_TYPE" == "test" ]]; then
281281
echo " [DRY RUN] npm publish '$TARBALL_PATH' --tag test"
282+
elif [[ "$VERSION_TYPE" == "prepatch" || "$VERSION_TYPE" == "preminor" || "$VERSION_TYPE" == "premajor" ]]; then
283+
echo " [DRY RUN] npm publish '$TARBALL_PATH' --tag pre"
282284
else
283285
echo " [DRY RUN] npm publish '$TARBALL_PATH'"
284286
fi
285287
else
286288
PUBLISH_CMD="npm publish \"$TARBALL_PATH\""
287289
if [[ "$VERSION_TYPE" == "test" ]]; then
288290
PUBLISH_CMD="$PUBLISH_CMD --tag test"
291+
elif [[ "$VERSION_TYPE" == "prepatch" || "$VERSION_TYPE" == "preminor" || "$VERSION_TYPE" == "premajor" ]]; then
292+
PUBLISH_CMD="$PUBLISH_CMD --tag pre"
289293
fi
290294
if ! eval $PUBLISH_CMD; then
291295
echo -e "\n❌ Publish failed. Rolling back version commit..."

0 commit comments

Comments
 (0)