release.sh 890 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. # publish theme
  14. echo "Releasing theme-chalk $VERSION ..."
  15. cd packages/theme-chalk
  16. npm version $VERSION --message "[release] $VERSION"
  17. if [[ $VERSION =~ "beta" ]]
  18. then
  19. npm publish --tag beta
  20. else
  21. npm publish
  22. fi
  23. cd ../..
  24. # commit
  25. git add -A
  26. git commit -m "[build] $VERSION"
  27. npm version $VERSION --message "[release] $VERSION"
  28. # publish
  29. git push eleme master
  30. git push eleme refs/tags/v$VERSION
  31. git checkout dev
  32. git rebase master
  33. git push eleme dev
  34. if [[ $VERSION =~ "beta" ]]
  35. then
  36. npm publish --tag beta
  37. else
  38. npm publish
  39. fi
  40. fi