From f2870bd23b8eb5ad7d0f71cfabb22b62d5762d3a Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Tue, 4 Nov 2025 12:16:32 -0800 Subject: [PATCH 1/2] fix(scripts): add --tag next to npm publish for prereleases --- scripts/publish.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/publish.sh b/scripts/publish.sh index 954d52ad8..e8770b3cb 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -105,12 +105,17 @@ cat CHANGELOG.md >> "${RELEASE_NOTES_FILE}" echo "Made the release notes." echo "Publishing to npm..." +PUBLISH_ARGS="" if [[ $DRY_RUN != "" ]]; then echo "DRY RUN: running publish with --dry-run" - npm publish --dry-run -else - npm publish + PUBLISH_ARGS="--dry-run" fi + +if [[ $PRE_RELEASE != "" ]]; then + PUBLISH_ARGS="$PUBLISH_ARGS --tag next" +fi + +npm publish $PUBLISH_ARGS echo "Published to npm." if [[ $PRE_RELEASE != "" ]]; then From 810b5cbcb9d2c15da3c656cfa298fa08ee7ba345 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Tue, 4 Nov 2025 12:28:44 -0800 Subject: [PATCH 2/2] fix(scripts): use bash array for publish args and idiomatic checks --- scripts/publish.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/publish.sh b/scripts/publish.sh index e8770b3cb..2eeb87bd5 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -105,17 +105,17 @@ cat CHANGELOG.md >> "${RELEASE_NOTES_FILE}" echo "Made the release notes." echo "Publishing to npm..." -PUBLISH_ARGS="" -if [[ $DRY_RUN != "" ]]; then +PUBLISH_ARGS=() +if [[ -n "$DRY_RUN" ]]; then echo "DRY RUN: running publish with --dry-run" - PUBLISH_ARGS="--dry-run" + PUBLISH_ARGS+=(--dry-run) fi -if [[ $PRE_RELEASE != "" ]]; then - PUBLISH_ARGS="$PUBLISH_ARGS --tag next" +if [[ -n "$PRE_RELEASE" ]]; then + PUBLISH_ARGS+=(--tag next) fi -npm publish $PUBLISH_ARGS +npm publish "${PUBLISH_ARGS[@]}" echo "Published to npm." if [[ $PRE_RELEASE != "" ]]; then