forked from fastpack/fastpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
93 lines (76 loc) · 2.3 KB
/
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
.PHONY: test
b: build
build:
@esy build
build-dev:
@esy b jbuilder build --dev bin/fpack.exe
install:
@esy install
test: build-dev
@esy jbuilder runtest --dev
setup-test:
cd test && for TEST in `ls`; \
do [ -d "$$TEST" ] \
&& [ -f "$$TEST/package.json" ] \
&& echo "Test: $$TEST" \
&& cd "$$TEST" \
&& yarn \
&& cd ..; \
done \
|| echo "Setup tests: done"
clean-test:
cd test && for TEST in `ls`; \
do [ -d "$$TEST" ] \
&& [ -d "$$TEST/node_modules" ] \
&& rm -rf "$$TEST/node_modules"; \
done \
|| echo "Cleanup tests: done"
test-integration: build-dev
@test/test.sh $(pattern)
train-integration: build-dev
@test/update.sh $(pattern)
test-server:
cd test && node server.js
fetch:
git submodule init
git submodule update
bootstrap: fetch install build setup-test
clean: clean-test
@rm -rf _build/ node_modules/
#
# RELEASE
#
release-patch release-minor release-major:
@echo "[INFO] [RELEASE] Checking if working tree is clean..."
@git diff-index --quiet HEAD --ignore-submodules -- \
|| (echo "[ERROR] [RELEASE] Working tree is dirty..." && exit 1)
@npm version --force $(@:release-%=%)
@echo "[INFO] [RELEASE] Setting version and git commit info..."
@sed \
-i '' \
-e "s/%%VERSION%%/$$(node -p "require('./package.json').version")/g" \
Fastpack/Version.ml
@sed \
-i '' \
-e "s/%%COMMIT%%/$$(git log --pretty=format:'%h' -n 1)/g" \
Fastpack/Version.ml
@$(MAKE) release-dist
@git checkout -- Fastpack/Version.ml
release-dist:
@echo "[INFO] [RELEASE] Building macOS binary release..."
@$(MAKE) build
@echo "[INFO] [RELEASE] Building Linux x64 binary release..."
@$(MAKE) -C linux-build build
@echo "[INFO] [RELEASE] Composing release package..."
@cp linux-build/fpack.exe dist/vendor-linux/fpack.exe
@cp _build/default/bin/fpack.exe dist/vendor-darwin/fpack.exe
@echo "[INFO] [RELEASE] DONE, now you can do the following:"
@echo "[INFO]"
@echo "[INFO] - Go to the release directory: cd dist"
@echo "[INFO] - Check that everything is ok: npm i -g ."
@echo "[INFO] - Publish to npm registry: npm publish"
@echo "[INFO] - Go back: cd ../"
@echo "[INFO] - Push release tag to GitHub: git push"
release-clean:
@rm -rf dist/vendor-darwin/fpack.exe
@rm -rf dist/vendor-linux/fpack.exe