release-worker.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 lang && npm install)
  9. (cd sdk && npm install)
  10. echo -n "Which version are you going to publish [0 to skip]? "
  11. VER=`head -n 1`
  12. if [ "$VER" = "0" ]; then :; else
  13. echo "Publishing version $VER"
  14. ./setversion.sh "$VER"
  15. cd lang
  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. cd ..
  21. git commit -a -m "Release version $VER"
  22. git tag -a "$VER" -m "Release version $VER"
  23. # bower does not publish explicitly but implictly via semver tag
  24. echo npm publish
  25. grunt
  26. git commit -a -m "Recompile (while version set to $VER)"
  27. fi
  28. echo -n "Which version are you going to work on? "
  29. WVERF=`head -n 1`
  30. WVER="${WVERF}-pre"
  31. echo "Setting version $WVER"
  32. ./setversion.sh "$WVER"
  33. cd lang
  34. cp package.json package.json.bak
  35. sed -e 's@/amber.git.*"@/amber.git"@' package.json.bak >package.json
  36. rm package.json.bak
  37. git add package.json
  38. cd ..
  39. git commit -a -m "Working on $WVERF"
  40. git push
  41. echo git push origin $VER