release.sh 489 B

1234567891011121314151617181920212223242526
  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. # run tests
  10. npm test 2>/dev/null
  11. # build
  12. VERSION=$VERSION npm run build
  13. # commit
  14. git add -A
  15. git commit -m "[build] $VERSION"
  16. npm version $VERSION --message "[release] $VERSION"
  17. # publish
  18. git push origin refs/tags/v$VERSION
  19. git push
  20. npm publish
  21. fi