Skip to content

Commit

Permalink
chore: add release shell
Browse files Browse the repository at this point in the history
  • Loading branch information
KuangPF committed Sep 28, 2019
1 parent d65eee2 commit e405a94
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"docs": "vuepress dev docs",
"docs:build": "vuepress build docs",
"deploy": "sh deploy.sh",
"lint": "eslint --ext .js,.vue src"
"lint": "eslint --ext .js,.vue src",
"release": "sh ./release.sh"
},
"dependencies": {
"mpvue-citypicker": "^1.0.6",
Expand Down
27 changes: 27 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env sh
set -e
echo "Enter release version: "
read VERSION

read -p "Releasing $VERSION - are you sure? (y/n)" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
echo "Releasing $VERSION ..."
then
# build
VERSION=$VERSION npm run build
if [[ `git status --porcelain` ]];
then
git add -A
git commit -am "build: release $VERSION"
fi

# commit
npm version $VERSION --message "build: release $VERSION"

# publish
git push origin refs/tags/v"$VERSION"
git push origin master

npm publish --registry=https://registry.npmjs.org
fi

0 comments on commit e405a94

Please sign in to comment.