2
0

release-worker.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. cli/support/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. bin/amberc -m AmberCli -n amber_cli -l Compiler-Exceptions,Compiler-Core,Compiler-AST,Compiler-IR,Compiler-Inlining,Compiler-Semantic,Compiler-Interpreter,parser cli/st/AmberCli.st cli/support/amber-cli
  18. rm cli/st/*.js
  19. git add cli/support/amber-cli.js
  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. fi
  25. echo -n "Which version are you going to work on? "
  26. VERF=`head -n 1`
  27. VER="${VERF}-pre"
  28. echo "Setting version $VER"
  29. cli/support/setversion.sh "$VER"
  30. cp package.json package.json.bak
  31. sed -e 's@/amber.git.*"@/amber.git"@' package.json.bak >package.json
  32. rm package.json.bak
  33. git add package.json
  34. bin/amberc -m AmberCli -n amber_cli -l Compiler-Exceptions,Compiler-Core,Compiler-AST,Compiler-IR,Compiler-Inlining,Compiler-Semantic,Compiler-Interpreter,parser cli/st/AmberCli.st cli/support/amber-cli
  35. rm cli/st/*.js
  36. git add cli/support/amber-cli.js
  37. git commit -a -m "Working on $VERF"
  38. git push --tags