release-worker.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  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. echo -n "Which version are you going to publish [0 to skip]? "
  9. VER=`head -n 1`
  10. if [ "$VER" = "0" ]; then :; else
  11. echo "Publishing version $VER"
  12. cli/support/setversion.sh "$VER"
  13. cp package.json package.json.bak
  14. sed -e 's@/amber.git.*"@/amber.git#'"$VER"'"@' package.json.bak >package.json
  15. rm package.json.bak
  16. git add package.json
  17. git commit -a -m "Release version $VER"
  18. git tag -a "$VER" -m "Release version $VER"
  19. # bower does not publish explicitly but implictly via semver tag
  20. echo npm publish
  21. fi
  22. echo -n "Which version are you going to work on? "
  23. VERF=`head -n 1`
  24. VER="${VERF}-pre"
  25. echo "Setting version $VER"
  26. cli/support/setversion.sh "$VER"
  27. cp package.json package.json.bak
  28. sed -e 's@/amber.git.*"@/amber.git"@' package.json.bak >package.json
  29. rm package.json.bak
  30. git add package.json
  31. git commit -a -m "Working on $VERF"
  32. git push --tags