Skip to content

Commit

Permalink
Release script
Browse files Browse the repository at this point in the history
  • Loading branch information
runk committed Oct 16, 2017
1 parent 45564fb commit cd4b748
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
17 changes: 17 additions & 0 deletions scripts/release
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit cd4b748

Please sign in to comment.