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