-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (42 loc) · 923 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
#!make
PM = npm
PMCMD = run
RM = rm
PRERELEASE_TAG ?= rc
PUBLISH_FLAGS = publish --access public
MODULES = node_modules
DIST = dist
COVERAGE = .nyc_output coverag
.PHONY: all
all: clean dist #test
dist:
$(PM) $(PMCMD) build
.PHONY: test
test:
$(PM) $(PMCMD) test
.PHONY: clean
clean:
rm -rf dist
rm -rf coverage
rm -rf .tmp
rm -rf .nyc_output
.PHONY: release
release: clean $(DIST)
ifneq (,$(findstring n,$(MAKEFLAGS)))
+$(PM) run release -- --dry-run
+$(PM) $(PUBLISH_FLAGS) --dry-run
else
$(PM) run release
git push --follow-tags
$(PM) $(PUBLISH_FLAGS)
endif
.PHONY: prerelease
prerelease: clean $(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
$(PM) $(PUBLISH_FLAGS) --tag $(PRERELEASE_TAG)
endif