2016-06-11 07:02:16 +08:00
|
|
|
set -e
|
|
|
|
|
2016-11-09 00:03:09 +08:00
|
|
|
if [[ -z $1 ]]; then
|
|
|
|
echo "Enter new version: "
|
|
|
|
read VERSION
|
|
|
|
else
|
|
|
|
VERSION=$1
|
|
|
|
fi
|
|
|
|
|
|
|
|
read -p "Releasing $VERSION - are you sure? (y/n) " -n 1 -r
|
|
|
|
echo
|
|
|
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
2016-06-11 07:02:16 +08:00
|
|
|
echo "Releasing $VERSION ..."
|
|
|
|
|
2016-06-14 06:56:36 +08:00
|
|
|
npm run lint
|
|
|
|
npm run flow
|
|
|
|
npm run test:cover
|
|
|
|
npm run test:e2e
|
|
|
|
npm run test:ssr
|
2016-12-02 08:45:17 +08:00
|
|
|
|
|
|
|
if [[ -z $SKIP_SAUCE ]]; then
|
|
|
|
export SAUCE_BUILD_ID=$VERSION:`date +"%s"`
|
|
|
|
npm run test:sauce
|
|
|
|
fi
|
2016-06-11 07:02:16 +08:00
|
|
|
|
|
|
|
# build
|
|
|
|
VERSION=$VERSION npm run build
|
|
|
|
|
|
|
|
# update packages
|
|
|
|
cd packages/vue-template-compiler
|
|
|
|
npm version $VERSION
|
2017-02-24 12:24:54 +08:00
|
|
|
if [[ -z $RELEASE_TAG ]]; then
|
|
|
|
npm publish
|
2017-02-25 07:26:08 +08:00
|
|
|
else
|
|
|
|
npm publish --tag $RELEASE_TAG
|
2017-02-24 12:24:54 +08:00
|
|
|
fi
|
2016-06-11 07:02:16 +08:00
|
|
|
cd -
|
|
|
|
|
|
|
|
cd packages/vue-server-renderer
|
|
|
|
npm version $VERSION
|
2017-02-24 12:24:54 +08:00
|
|
|
if [[ -z $RELEASE_TAG ]]; then
|
|
|
|
npm publish
|
2017-02-25 07:26:08 +08:00
|
|
|
else
|
|
|
|
npm publish --tag $RELEASE_TAG
|
2017-02-24 12:24:54 +08:00
|
|
|
fi
|
2016-06-11 07:02:16 +08:00
|
|
|
cd -
|
|
|
|
|
|
|
|
# commit
|
|
|
|
git add -A
|
|
|
|
git commit -m "[build] $VERSION"
|
|
|
|
npm version $VERSION --message "[release] $VERSION"
|
|
|
|
|
|
|
|
# publish
|
|
|
|
git push origin refs/tags/v$VERSION
|
|
|
|
git push
|
2017-02-24 12:20:05 +08:00
|
|
|
if [[ -z $RELEASE_TAG ]]; then
|
|
|
|
npm publish
|
2017-02-25 07:26:08 +08:00
|
|
|
else
|
|
|
|
npm publish --tag $RELEASE_TAG
|
2017-02-24 12:20:05 +08:00
|
|
|
fi
|
2016-06-11 07:02:16 +08:00
|
|
|
fi
|