Skip to content

Commit 854b2d2

Browse files
committed
Publish release candidates under the NPM latest tag
1 parent 592457e commit 854b2d2

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

publish.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
cd reactfire/pub/reactfire
22

3+
# TODO once we go 2.0.0 stable, uncomment
4+
# LATEST_TEST="^[^-]*$"
5+
6+
# Publish -rc tags on @latest for now
7+
LATEST_TEST="^[^-]*-rc"
8+
39
if test $NPM_TOKEN; then
410

511
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
@@ -10,7 +16,14 @@ if test $NPM_TOKEN; then
1016

1117
if test $TAG_NAME; then
1218
npm version $(echo $TAG_NAME | sed 's/^v\(.*\)$/\1/')
13-
npm publish . --tag next
19+
20+
if [[ $TAG_NAME =~ $LATEST_TEST]]; then
21+
NPM_TAG=latest
22+
else
23+
NPM_TAG=next
24+
fi
25+
26+
npm publish . --tag $NPM_TAG
1427
ret=$?
1528
else
1629
npm version $(npm version | sed -n "s/^ reactfire: '\(.*\)',/\1/p")-canary.$SHORT_SHA

0 commit comments

Comments
 (0)