release-worker.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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. internal/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. grunt
  22. git commit -a -m "Recompile (while version set to $VER)"
  23. fi
  24. echo -n "Which version are you going to work on? "
  25. VERF=`head -n 1`
  26. VER="${VERF}-pre"
  27. echo "Setting version $VER"
  28. internal/setversion.sh "$VER"
  29. cp package.json package.json.bak
  30. sed -e 's@/amber.git.*"@/amber.git"@' package.json.bak >package.json
  31. rm package.json.bak
  32. git add package.json
  33. git commit -a -m "Working on $VERF"
  34. git push --tags