-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (32 loc) · 887 Bytes
/
Copy pathMakefile
File metadata and controls
43 lines (32 loc) · 887 Bytes
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
37
38
39
40
41
42
43
BIN = ./node_modules/.bin
PATH := $(BIN):$(PATH)
LIB = $(shell find lib -name "*.js")
DIST = $(patsubst lib/%.js,dist/%.js,$(LIB))
define release
VERSION=`node -pe "require('./package.json').version"` && \
NEXT_VERSION=`node -pe "require('semver').inc(\"$$VERSION\", '$(1)')"` && \
make build && \
npm --no-git-tag-version version $(1) -m 'release %s' && \
git add . && \
git commit -m 'make build and release' && \
git tag $$NEXT_VERSION
endef
clean:
@rm -rf ./dist
lint:
@ $(BIN)/eslint lib/
dist: $(DIST)
dist/%.js: lib/%.js
@ mkdir -p $(@D)
$(BIN)/babel $< -o $@
build: lint clean dist
pre-release: lint
release-patch: pre-release
$(call release,patch)
release-minor: pre-release
$(call release,minor)
release-major: pre-release
$(call release,major)
publish:
@ npm publish && git push --tags
.PHONY: install release-patch release-minor release-major