Skip to content

Commit 7f435e2

Browse files
authored
fix(scripts): add --tag next to npm publish for prereleases (#1761)
* fix(scripts): add --tag next to npm publish for prereleases * fix(scripts): use bash array for publish args and idiomatic checks
1 parent ae70695 commit 7f435e2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

scripts/publish.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,17 @@ cat CHANGELOG.md >> "${RELEASE_NOTES_FILE}"
105105
echo "Made the release notes."
106106

107107
echo "Publishing to npm..."
108-
if [[ $DRY_RUN != "" ]]; then
108+
PUBLISH_ARGS=()
109+
if [[ -n "$DRY_RUN" ]]; then
109110
echo "DRY RUN: running publish with --dry-run"
110-
npm publish --dry-run
111-
else
112-
npm publish
111+
PUBLISH_ARGS+=(--dry-run)
113112
fi
113+
114+
if [[ -n "$PRE_RELEASE" ]]; then
115+
PUBLISH_ARGS+=(--tag next)
116+
fi
117+
118+
npm publish "${PUBLISH_ARGS[@]}"
114119
echo "Published to npm."
115120

116121
if [[ $PRE_RELEASE != "" ]]; then

0 commit comments

Comments
 (0)