Skip to content

Commit 6102c74

Browse files
committed
Port release makefile fn from react-draggable
1 parent 744d760 commit 6102c74

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,16 @@ publish:
3939
npm publish
4040

4141
define release
42-
npm version $(1)
42+
VERSION=`node -pe "require('./package.json').version"` && \
43+
NEXT_VERSION=`node -pe "require('semver').inc(\"$$VERSION\", '$(1)')"` && \
44+
node -e "\
45+
['./package.json'].forEach(function(fileName) {\
46+
var j = require(fileName);\
47+
j.version = \"$$NEXT_VERSION\";\
48+
var s = JSON.stringify(j, null, 2);\
49+
require('fs').writeFileSync(fileName, s);\
50+
});" && \
51+
git add package.json CHANGELOG.md && \
52+
git commit -m "release v$$NEXT_VERSION" && \
53+
git tag "v$$NEXT_VERSION" -m "release v$$NEXT_VERSION"
4354
endef

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"eslint-plugin-react": "^3.5.1",
1919
"jsxhint": "^0.15.1",
2020
"mocha": "^2.3.3",
21+
"semver": "^5.1.0",
2122
"zuul": "^3.6.0"
2223
},
2324
"peerDependencies": {

0 commit comments

Comments
 (0)