release.sh 1001 B

123456789101112131415161718192021222324252627282930313233
  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. git clean -d -x -f
  6. git reset --hard
  7. git checkout master
  8. git reset --hard
  9. echo -n "Which version are you going to publish [0 to skip]? "
  10. VER=`head -n 1`
  11. if [ "$VER" = "0" ]; then :; else
  12. echo "Publishing version $VER"
  13. cli/support/setversion.sh "$VER"
  14. cp package.json package.json.bak
  15. sed -e 's@/amber.git.*"@/amber.git#'"$VER"'"@' package.json.bak >package.json
  16. rm package.json.bak
  17. git commit -a -m "Release version $VER"
  18. git tag -a "$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 commit -a -m "Working on $VERF"
  31. git push --tags