release-worker.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. # ATTENTION: Be logged into npm before running this script,
  3. # as a user with write access to amber npm package.
  4. git reset --hard
  5. git checkout master
  6. git clean -d -x -f
  7. npm install
  8. cd external/amber-dev
  9. npm install
  10. cd ../..
  11. echo -n "Which version are you going to publish [0 to skip]? "
  12. VER=`head -n 1`
  13. if [ "$VER" = "0" ]; then :; else
  14. echo "Publishing version $VER"
  15. internal/setversion.sh "$VER"
  16. cp package.json package.json.bak
  17. sed -e 's@/amber.git.*"@/amber.git#'"$VER"'"@' package.json.bak >package.json
  18. rm package.json.bak
  19. git add package.json
  20. git commit -a -m "Release version $VER"
  21. git tag -a "$VER" -m "Release version $VER"
  22. # bower does not publish explicitly but implictly via semver tag
  23. echo npm publish
  24. grunt
  25. git commit -a -m "Recompile (while version set to $VER)"
  26. fi
  27. echo -n "Which version are you going to work on? "
  28. WVERF=`head -n 1`
  29. WVER="${WVERF}-pre"
  30. echo "Setting version $WVER"
  31. internal/setversion.sh "$WVER"
  32. cp package.json package.json.bak
  33. sed -e 's@/amber.git.*"@/amber.git"@' package.json.bak >package.json
  34. rm package.json.bak
  35. git add package.json
  36. git commit -a -m "Working on $WVERF"
  37. git push
  38. echo git push origin $VER