chore: release script

This commit is contained in:
komo
2020-02-12 15:31:08 +08:00
parent 346beda3d9
commit 80d646b60f
2 changed files with 26 additions and 2 deletions

View File

@@ -18,11 +18,13 @@
],
"scripts": {
"dev": "vuepress dev example",
"build": "vuepress build example"
"build": "vuepress build example",
"release": "sh scripts/release.sh"
},
"devDependencies": {
"vuepress": "^1.2.0",
"vuepress-theme-resume": "^1.0.0"
"vuepress-theme-resume": "^1.0.0",
"standard-version": "^4.4.0"
},
"engines": {
"node": ">= 6.0.0",

22
scripts/release.sh Normal file
View File

@@ -0,0 +1,22 @@
version=$(node -p "const { version } = require('./package.json'); version")
git checkout master
# build
yarn build
# commit
git add -A
standard-version --commit-all --release-as $version
# gh-pages
git checkout gh-pages
git merge master
git checkout master
# push
git push --tags origin
git push --all origin
# publish
npm publish --registry=https://registry.npmjs.org