1
0

release.sh 732 B

12345678910111213141516171819202122232425262728293031323334
  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. # generate the version so that the changelog can be generated too
  14. yarn version --no-git-tag-version --no-commit-hooks --new-version $VERSION
  15. # changelog
  16. yarn changelog
  17. echo "Please check the git history and the changelog and press enter"
  18. read OKAY
  19. # commit
  20. git add -A
  21. git commit -m "realese: v$VERSION"
  22. git tag "v$VERSION"
  23. # publish
  24. git push origin refs/tags/v$VERSION
  25. git push
  26. npm publish --tag next
  27. fi