release.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. set -e
  2. if [[ -z $1 ]]; then
  3. echo "Enter new version: "
  4. read VERSION
  5. else
  6. VERSION=$1
  7. fi
  8. read -p "Releasing $VERSION - are you sure? (y/n) " -n 1 -r
  9. echo
  10. if [[ $REPLY =~ ^[Yy]$ ]]; then
  11. echo "Releasing $VERSION ..."
  12. npm run lint
  13. npm run flow
  14. npm run test:cover
  15. npm run test:e2e
  16. npm run test:ssr
  17. if [[ -z $SKIP_SAUCE ]]; then
  18. export SAUCE_BUILD_ID=$VERSION:`date +"%s"`
  19. npm run test:sauce
  20. fi
  21. # build
  22. VERSION=$VERSION npm run build
  23. # update packages
  24. cd packages/vue-template-compiler
  25. npm version $VERSION
  26. if [[ -z $RELEASE_TAG ]]; then
  27. npm publish
  28. else
  29. npm publish --tag $RELEASE_TAG
  30. fi
  31. cd -
  32. cd packages/vue-server-renderer
  33. npm version $VERSION
  34. if [[ -z $RELEASE_TAG ]]; then
  35. npm publish
  36. else
  37. npm publish --tag $RELEASE_TAG
  38. fi
  39. cd -
  40. # commit
  41. git add -A
  42. git commit -m "[build] $VERSION"
  43. npm version $VERSION --message "[release] $VERSION"
  44. # publish
  45. git push origin refs/tags/v$VERSION
  46. git push
  47. if [[ -z $RELEASE_TAG ]]; then
  48. npm publish
  49. else
  50. npm publish --tag $RELEASE_TAG
  51. fi
  52. fi