-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (45 loc) · 994 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!make
PRERELEASE_TAG ?= beta
PM = npm
RM = rm -rf
PUBLISH_FLAGS = publish --access public
MODULES = node_modules
DIST = dist
COVERAGE = .nyc_output coverage
.PHONY: all
all: clean $(DIST)
$(MODULES):
$(PM) i
$(DIST): $(MODULES)
$(PM) run build
.PHONY: clean
clean:
$(RM) $(DIST) $(COVERAGE)
.PHONY: clean-all
clean-all:
$(RM) $(MODULES)
.PHONY: test
test:
$(PM) t
coverage:
$(PM) run coverage
.PHONY: release
release: $(DIST)
ifneq (,$(findstring n,$(MAKEFLAGS)))
+$(PM) run release -- --dry-run
+$(PM) $(PUBLISH_FLAGS) --dry-run
else
$(PM) run release
git push --follow-tags origin master
$(PM) $(PUBLISH_FLAGS)
endif
.PHONY: prerelease
prerelease: $(DIST)
ifneq (,$(findstring n,$(MAKEFLAGS)))
+$(PM) run release -- --prerelease $(PRERELEASE_TAG) --dry-run
+$(PM) $(PUBLISH_FLAGS) --tag $(PRERELEASE_TAG) --dry-run
else
$(PM) run release -- --prerelease $(PRERELEASE_TAG)
git push --follow-tags origin master
$(PM) $(PUBLISH_FLAGS) --tag $(PRERELEASE_TAG)
endif