release.sh 629 B

123456789101112131415161718192021222324252627282930313233
  1. set -e
  2. echo "Enter release version: "
  3. read VERSION
  4. read -p "Releasing $VERSION - are you sure? (y/n)" -n 1 -r
  5. echo # (optional) move to a new line
  6. if [[ $REPLY =~ ^[Yy]$ ]]
  7. then
  8. echo "Releasing $VERSION ..."
  9. # lint and test
  10. npm run lint 2>/dev/null
  11. npm run unit 2>/dev/null
  12. npm run cover 2>/dev/null
  13. # build
  14. VERSION=$VERSION npm run build
  15. # e2e
  16. npm run e2e 2>/dev/null
  17. # sauce
  18. npm run sauce-all 2>/dev/null
  19. # commit
  20. git add -A
  21. git commit -m "[build] $VERSION"
  22. npm version $VERSION --message "[release] $VERSION"
  23. # publish
  24. git push origin refs/tags/v$VERSION
  25. git push
  26. npm publish
  27. fi