-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
36 lines (28 loc) · 859 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
BIN = ./node_modules/.bin
.PHONY: all run install clean release release-patch release-minor release-major go-release
run:
@go rum main.go
install:
@go install .
clean:
@rm -fr dist
define release
VERSION=`node -pe "require('./package.json').version"` && \
NEXT_VERSION=`node -pe "require('semver').inc(\"$$VERSION\", '$(1)')"` && \
node -e "\
var j = require('./package.json');\
j.version = \"$$NEXT_VERSION\";\
var s = JSON.stringify(j, null, 2);\
require('fs').writeFileSync('./package.json', s);" && \
git commit -m "Version $$NEXT_VERSION" -- package.json && \
git tag v"$$NEXT_VERSION" -m "Version $$NEXT_VERSION"
endef
release-patch:
@$(call release,patch)
release-minor:
@$(call release,minor)
release-major:
@$(call release,major)
go-release:
@goreleaser release --clean
@make clean