Merge pull request #7 from runk/release-script

Release script
This commit is contained in:
Dmitry Shirokov 2017-10-16 11:53:09 +11:00 committed by GitHub
commit 1b191f7104
2 changed files with 19 additions and 1 deletions

View File

@ -27,7 +27,8 @@
"url": "http://github.com/runk/node-chardet/issues"
},
"scripts": {
"test": "mocha -R spec --recursive"
"test": "mocha -R spec --recursive",
"release": "scripts/release"
},
"main": "index.js",
"engine": {

17
scripts/release Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
# Exit immediately if a pipeline returns non-zero status
# http://www.gnu.org/software/bash/manual/bashref.html#The-Set-Builtin
set -e
npm run lint
npm test
if [ -n "$npm_config_major" ]; then SEMVER="major"
elif [ -n "$npm_config_patch" ]; then SEMVER="patch"
else SEMVER="minor"; fi
npm version $SEMVER
github-publish-release
git push --follow-tags
npm publish