Browse Source

workflow: clean shell scripts (#7826)

dev
Léo Andrès 7 years ago
committed by Evan You
parent
commit
943e5c242b
  1. 18
      scripts/release-weex.sh
  2. 24
      scripts/release.sh

18
scripts/release-weex.sh

@ -1,6 +1,7 @@
#!/bin/bash
set -e set -e
CUR_VERSION=`node build/get-weex-version.js -c` CUR_VERSION=$(node build/get-weex-version.js -c)
NEXT_VERSION=`node build/get-weex-version.js` NEXT_VERSION=$(node build/get-weex-version.js)
echo "Current: $CUR_VERSION" echo "Current: $CUR_VERSION"
read -p "Enter new version ($NEXT_VERSION): " -n 1 -r read -p "Enter new version ($NEXT_VERSION): " -n 1 -r
@ -20,15 +21,16 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
WEEX_VERSION=$NEXT_VERSION npm run build:weex WEEX_VERSION=$NEXT_VERSION npm run build:weex
# update package # update package
cd packages/weex-vue-framework # using subshells to avoid having to cd back
npm version $NEXT_VERSION ( cd packages/weex-vue-framework
npm version "$NEXT_VERSION"
npm publish npm publish
cd - )
cd packages/weex-template-compiler ( cd packages/weex-template-compiler
npm version $NEXT_VERSION npm version "$NEXT_VERSION"
npm publish npm publish
cd - )
# commit # commit
git add packages/weex* git add packages/weex*

24
scripts/release.sh

@ -1,8 +1,9 @@
#!/bin/bash
set -e set -e
if [[ -z $1 ]]; then if [[ -z $1 ]]; then
echo "Enter new version: " echo "Enter new version: "
read VERSION read -r VERSION
else else
VERSION=$1 VERSION=$1
fi fi
@ -32,23 +33,24 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
VERSION=$VERSION npm run build VERSION=$VERSION npm run build
# update packages # update packages
cd packages/vue-template-compiler # using subshells to avoid having to cd back
npm version $VERSION ( ( cd packages/vue-template-compiler
npm version "$VERSION"
if [[ -z $RELEASE_TAG ]]; then if [[ -z $RELEASE_TAG ]]; then
npm publish npm publish
else else
npm publish --tag $RELEASE_TAG npm publish --tag "$RELEASE_TAG"
fi fi
cd - )
cd packages/vue-server-renderer cd packages/vue-server-renderer
npm version $VERSION npm version "$VERSION"
if [[ -z $RELEASE_TAG ]]; then if [[ -z $RELEASE_TAG ]]; then
npm publish npm publish
else else
npm publish --tag $RELEASE_TAG npm publish --tag "$RELEASE_TAG"
fi fi
cd - )
# commit # commit
git add -A git add -A
@ -63,14 +65,14 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
# generate release note # generate release note
npm run release:note npm run release:note
# tag version # tag version
npm version $VERSION --message "build: release $VERSION" npm version "$VERSION" --message "build: release $VERSION"
# publish # publish
git push origin refs/tags/v$VERSION git push origin refs/tags/v"$VERSION"
git push git push
if [[ -z $RELEASE_TAG ]]; then if [[ -z $RELEASE_TAG ]]; then
npm publish npm publish
else else
npm publish --tag $RELEASE_TAG npm publish --tag "$RELEASE_TAG"
fi fi
fi fi

Loading…
Cancel
Save