1
0

release-worker.sh 1.2 KB

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