From 17d8a520caeecdafd55d26326ef869c888493176 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Thu, 20 Nov 2014 14:26:03 -0800 Subject: [PATCH] chore(scripts): publish 1.2.x releases to npm with correct tag --- scripts/bower/publish.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/bower/publish.sh b/scripts/bower/publish.sh index 24d79e04..5b6fd813 100755 --- a/scripts/bower/publish.sh +++ b/scripts/bower/publish.sh @@ -88,6 +88,24 @@ function publish { cd $TMP_DIR/bower-$repo git push origin master git push origin v$NEW_VERSION + + # don't publish every build to npm + if [ "${NEW_VERSION/+sha}" = "$NEW_VERSION" ] ; then + if [ "${NEW_VERSION/-}" = "$NEW_VERSION" ] ; then + if [[ $NEW_VERSION =~ ^1\.2\.[0-9]+$ ]] ; then + # publish 1.2.x releases with the appropriate tag + # this ensures that `npm install` by default will not grab `1.2.x` releases + npm publish --tag=1.2.x + else + # publish releases as "latest" + npm publish + fi + else + # publish prerelease builds with the beta tag + npm publish --tag=beta + fi + fi + cd $SCRIPT_DIR done }