From a21d49c900c3a9c5af8eb243f08e4f78ebaa78a9 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Wed, 1 Oct 2014 16:01:32 -0700 Subject: [PATCH] chore(npm): publish artifacts to npm Closes #2877 --- scripts/bower/publish.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/bower/publish.sh b/scripts/bower/publish.sh index 7af024b78c93..b7505092e441 100755 --- a/scripts/bower/publish.sh +++ b/scripts/bower/publish.sh @@ -73,6 +73,8 @@ function prepare { cd $TMP_DIR/bower-$repo replaceJsonProp "bower.json" "version" ".*" "$NEW_VERSION" replaceJsonProp "bower.json" "angular.*" ".*" "$NEW_VERSION" + replaceJsonProp "package.json" "version" ".*" "$NEW_VERSION" + replaceJsonProp "package.json" "angular.*" ".*" "$NEW_VERSION" git add -A @@ -90,6 +92,18 @@ 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 + # publish releases as "latest" + npm publish + else + # publish prerelease builds with the beta tag + npm publish --tag=beta + fi + fi + cd $SCRIPT_DIR done }