vue/build/release.sh

62 lines
1.1 KiB
Bash
Raw Normal View History

2016-06-11 07:02:16 +08:00
set -e
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
if [[ -z $RELEASE_TAG ]]; then
npm publish --tag $RELEASE_TAG
else
npm publish
fi
2016-06-11 07:02:16 +08:00
cd -
cd packages/vue-server-renderer
npm version $VERSION
if [[ -z $RELEASE_TAG ]]; then
npm publish --tag $RELEASE_TAG
else
npm publish
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
if [[ -z $RELEASE_TAG ]]; then
npm publish --tag $RELEASE_TAG
else
npm publish
fi
2016-06-11 07:02:16 +08:00
fi