release-weex.sh 877 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. set -e
  3. CUR_VERSION=$(node build/get-weex-version.js -c)
  4. NEXT_VERSION=$(node build/get-weex-version.js)
  5. echo "Current: $CUR_VERSION"
  6. read -p "Enter new version ($NEXT_VERSION): " -n 1 -r
  7. if ! [[ -z $REPLY ]]; then
  8. NEXT_VERSION=$REPLY
  9. fi
  10. read -p "Releasing weex-vue-framework@$NEXT_VERSION - are you sure? (y/n) " -n 1 -r
  11. echo
  12. if [[ $REPLY =~ ^[Yy]$ ]]; then
  13. echo "Releasing weex-vue-framework@$NEXT_VERSION ..."
  14. npm run lint
  15. npm run flow
  16. npm run test:weex
  17. # build
  18. WEEX_VERSION=$NEXT_VERSION npm run build:weex
  19. # update package
  20. # using subshells to avoid having to cd back
  21. ( cd packages/weex-vue-framework
  22. npm version "$NEXT_VERSION"
  23. npm publish
  24. )
  25. ( cd packages/weex-template-compiler
  26. npm version "$NEXT_VERSION"
  27. npm publish
  28. )
  29. # commit
  30. git add packages/weex*
  31. git commit -m "[release] weex-vue-framework@$NEXT_VERSION"
  32. fi