Skip to content

Commit 10634c3

Browse files
authored
Merge pull request #52 from runk/release-script
Release scripts
2 parents b63c452 + 48fd0df commit 10634c3

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
},
2828
"devDependencies": {
2929
"eslint": "^2.9.0",
30+
"github-publish-release": "^1.2.3",
3031
"ip-address": "^5.8.0",
3132
"istanbul": "^0.4.3",
3233
"mocha": "^2.4.5"
@@ -50,10 +51,7 @@
5051
"coverage": "istanbul cover _mocha -- -R spec --timeout 5000 --recursive",
5152
"coverage:check": "istanbul check-coverage",
5253
"lint": "eslint -c .eslintrc .",
53-
"prepublish": "npm run lint",
54-
"release:major": "npm run lint && npm test && npm version major && npm publish && git push --follow-tags",
55-
"release:minor": "npm run lint && npm test && npm version minor && npm publish && git push --follow-tags",
56-
"release:patch": "npm run lint && npm test && npm version patch && npm publish && git push --follow-tags",
54+
"release": "scripts/release",
5755
"mocha": "mocha -R spec --recursive --bail",
5856
"test": "npm run lint && npm run coverage && npm run coverage:check"
5957
}

scripts/release

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# Exit immediately if a pipeline returns non-zero status
4+
# http://www.gnu.org/software/bash/manual/bashref.html#The-Set-Builtin
5+
set -e
6+
7+
npm run lint
8+
npm test
9+
10+
if [ -n "$npm_config_major" ]; then SEMVER="major"
11+
elif [ -n "$npm_config_patch" ]; then SEMVER="patch"
12+
else SEMVER="minor"; fi
13+
14+
npm version $SEMVER
15+
github-publish-release
16+
git push --follow-tags
17+
npm publish

0 commit comments

Comments
 (0)