release.sh 948 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/usr/bin/env sh
  2. set -e
  3. git checkout master
  4. git merge dev
  5. VERSION=`npx select-version-cli`
  6. read -p "Releasing $VERSION - are you sure? (y/n)" -n 1 -r
  7. echo # (optional) move to a new line
  8. if [[ $REPLY =~ ^[Yy]$ ]]
  9. then
  10. echo "Releasing $VERSION ..."
  11. # build
  12. VERSION=$VERSION npm run dist
  13. # ssr test
  14. node test/ssr/require.test.js
  15. # publish theme
  16. echo "Releasing theme-chalk $VERSION ..."
  17. cd packages/theme-chalk
  18. npm version $VERSION --message "[release] $VERSION"
  19. if [[ $VERSION =~ "beta" ]]
  20. then
  21. npm publish --tag beta
  22. else
  23. npm publish
  24. fi
  25. cd ../..
  26. # commit
  27. git add -A
  28. git commit -m "[build] $VERSION"
  29. npm version $VERSION --message "[release] $VERSION"
  30. # publish
  31. git push eleme master
  32. git push eleme refs/tags/v$VERSION
  33. git checkout dev
  34. git rebase master
  35. git push eleme dev
  36. if [[ $VERSION =~ "beta" ]]
  37. then
  38. npm publish --tag beta
  39. else
  40. npm publish
  41. fi
  42. fi