Browse Source

Merge pull request #720 from herby/working-script-sans-publish

Working script sans publish
Nicolas Petton 10 years ago
parent
commit
77d095ae1a
2 changed files with 38 additions and 29 deletions
  1. 34 0
      cli/support/release-worker.sh
  2. 4 29
      cli/support/release.sh

+ 34 - 0
cli/support/release-worker.sh

@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# ATTENTION: Be logged into npm before running this script,
+# as a user with write access to amber npm package.
+
+git reset --hard
+git checkout master
+git clean -d -x -f
+npm install
+echo -n "Which version are you going to publish [0 to skip]? "
+VER=`head -n 1`
+if [ "$VER" = "0" ]; then :; else
+	echo "Publishing version $VER"
+	cli/support/setversion.sh "$VER"
+	cp package.json package.json.bak
+	sed -e 's@/amber.git.*"@/amber.git#'"$VER"'"@' package.json.bak >package.json
+	rm package.json.bak
+	git add package.json
+	git commit -a -m "Release version $VER"
+	git tag -a "$VER" -m "Release version $VER"
+# bower does not publish explicitly but implictly via semver tag
+	echo npm publish
+fi
+echo -n "Which version are you going to work on? "
+VERF=`head -n 1`
+VER="${VERF}-pre"
+echo "Setting version $VER"
+cli/support/setversion.sh "$VER"
+cp package.json package.json.bak
+sed -e 's@/amber.git.*"@/amber.git"@' package.json.bak >package.json
+rm package.json.bak
+git add package.json
+git commit -a -m "Working on $VERF"
+git push --tags

+ 4 - 29
cli/support/release.sh

@@ -3,32 +3,7 @@
 # ATTENTION: Be logged into npm before running this script,
 # as a user with write access to amber npm package.
 
-cd `dirname "$0"`/../..
-echo rm -rf *
-echo git checkout master
-echo -n "Which version are you going to publish [0 to skip]? "
-VER=`head -n 1`
-if [ "$VER" = "0" ]; then :; else
-	echo "Publishing version $VER"
-	cli/support/setversion.sh "$VER"
-	cp package.json package.json.bak
-	sed -e 's@/amber.git.*"@/amber.git#'"$VER"'"@' package.json.bak >package.json
-	rm package.json.bak
-	git commit -a -m "Release version $VER"
-	git tag -a "$VER"
-#	echo bower upload
-# bower does not publish explicitly but implictly via semver tag
-	echo Please check if everything is ok, then publish the new release with 'npm publish'
-fi
-echo -n "Which version are you going to work on? "
-VERF=`head -n 1`
-VER="${VERF}-pre"
-echo "Setting version $VER"
-cli/support/setversion.sh "$VER"
-cp package.json package.json.bak
-sed -e 's@/amber.git.*"@/amber.git"@' package.json.bak >package.json
-rm package.json.bak
-git commit -a -m "Working on $VERF"
-
-
-echo Please check if everything is ok, then push changes with 'git push --tags'
+cd `dirname "$0"`
+cp release-worker.sh /tmp
+cd ../..
+exec sh /tmp/release-worker.sh