2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-18 18:12:25 +03:00

build: add release script

This commit is contained in:
mxie
2018-09-28 15:25:24 +08:00
parent 42bc06864e
commit 2444331a3c
2 changed files with 40 additions and 2 deletions
+38
View File
@@ -0,0 +1,38 @@
git checkout master
git merge dev
#!/usr/bin/env sh
set -e
if [[ -z $1 ]]; then
echo "Enter new version: "
read -r VERSION
else
VERSION=$1
fi
read -p "Releasing $VERSION - are you sure? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Releasing $VERSION ..."
# build
VERSION=$VERSION npm run build
npm version $VERSION --message "$VERSION"
# publish
git push origin master
git push origin refs/tags/v$VERSION
git checkout dev
git rebase master
git push origin dev
if [[ $VERSION =~ "beta" ]]
then
npm publish --tag beta
else
npm publish
fi
fi