Skip to content

Commit

Permalink
Merge pull request #7 from runk/release-script
Browse files Browse the repository at this point in the history
Release script
  • Loading branch information
runk authored Oct 16, 2017
2 parents 45564fb + cd4b748 commit 1b191f7
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 1b191f7

Please sign in to comment.