forked from discordier/sam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (23 loc) · 832 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
GLOBAL_DEPS=Makefile $(wildcard src/**.es6) build/build.js build/config.js node_modules
PROJECT_DIR=$(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
GH_PAGES_PATH=$(PROJECT_DIR)/gh-pages
.PHONY: test build
all: test build
test: $(GLOBAL_DEPS)
yarn test
build: $(GLOBAL_DEPS)
yarn build
node_modules:
yarn install --frozen-lockfile
release-docs: gh-pages build $(PROJECT_DIR)/dist/samjs.min.js $(PROJECT_DIR)/dist/guessnum.min.js
cp $(PROJECT_DIR)/dist/samjs.min.js \
$(PROJECT_DIR)/dist/guessnum.min.js \
$(GH_PAGES_PATH)/dist
git -C $(GH_PAGES_PATH) add .
git -C $(GH_PAGES_PATH) commit -m "update release"
gh-pages: $(GLOBAL_DEPS)
ifeq ($(wildcard $(GH_PAGES_PATH)/),)
git clone -b gh-pages $(shell git remote get-url --push origin) $(GH_PAGES_PATH)
else
(cd $(GH_PAGES_PATH) && git pull)
endif