release.sh 654 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. set -e
  3. if [[ -z $1 ]]; then
  4. echo "Enter new version: "
  5. read -r VERSION
  6. else
  7. VERSION=$1
  8. fi
  9. read -p "Releasing $VERSION - are you sure? (y/n) " -n 1 -r
  10. echo
  11. if [[ $REPLY =~ ^[Yy]$ ]]; then
  12. echo "Releasing $VERSION ..."
  13. if [[ -z $SKIP_TESTS ]]; then
  14. npm run lint
  15. fi
  16. # remove old builds
  17. rm -rf ./packages
  18. rm -rf ./example/dist
  19. # build
  20. VERSION=$VERSION npm run build:example && npm run build
  21. # commit
  22. git add -A
  23. git commit -m "Compile $VERSION"
  24. # update packages
  25. npm version "$VERSION" --message "Release $VERSION"
  26. npm publish
  27. # publish
  28. git push
  29. git tag v"$VERSION"
  30. git push origin --tags
  31. fi