release.sh 900 B

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