Skip to content

Commit 21614b9

Browse files
committed
Add release script
1 parent 9f509df commit 21614b9

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"dev": "webpack-dev-server --inline --hot --quiet --port=8000",
1212
"build": "rm -rf build/ && NODE_ENV=production webpack --progress --hide-modules",
1313
"test": "karma start --single-run",
14-
"lint": "eslint './src/**(vue|js)'"
14+
"lint": "eslint './src/**(vue|js)'",
15+
"release": "bash ./release.sh"
1516
},
1617
"keywords": [
1718
"vue",

release.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
set -e
2+
echo "Enter release version: "
3+
read VERSION
4+
5+
read -p "Releasing $VERSION - are you sure? (y/n)" -n 1 -r
6+
echo # (optional) move to a new line
7+
if [[ $REPLY =~ ^[Yy]$ ]]
8+
then
9+
echo "Releasing $VERSION ..."
10+
11+
# lint and test
12+
npm run lint 2>/dev/null
13+
npm test 2>/dev/null
14+
15+
# build
16+
npm run build
17+
18+
# commit
19+
git add -A
20+
git commit -m "Build for $VERSION"
21+
npm version $VERSION --message "Upgrade to $VERSION"
22+
23+
# publish
24+
git push
25+
npm publish
26+
fi

0 commit comments

Comments
 (0)