-
Notifications
You must be signed in to change notification settings - Fork 39
/
Makefile
87 lines (64 loc) · 2.71 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
VERSION=$(shell node -pe 'JSON.parse(require("fs").readFileSync("package.json")).version')
GIT_VERSION=$(shell git describe --long | sed 's/\-g.*//' | sed 's/\-/\./')
SLACK_WEBHOOK=$(shell cat ../ogs/.slack-webhook)
all dev:
yarn run dev
build: build-debug build-production
cp src/Goban.styl build/Goban.styl
build-debug:
yarn run build-debug
build-production:
yarn run build-production
lint:
yarn run lint
test:
yarn run test
detect-duplicate-code duplicate-code-detection:
yarn run detect-duplicate-code
doc docs typedoc:
yarn run typedoc
publish_docs: typedoc
cd docs && git add docs && git commit -m "Update docs" && git push
clean:
rm -Rf lib node build engine/build
publish push: publish-production publish_docs upload_to_cdn notify
beta: beta_npm upload_to_cdn
beta_npm: build publish-beta
pack: build
yarn pack
restore-dev-versions:
sed -i'.tmp' "s/\"version\": .*/\"version\": \"dev\",/" package.json
sed -i'.tmp' "s/\"version\": .*/\"version\": \"dev\",/" engine/package.json
publish-beta: build
sed -i'.tmp' "s/\"version\": .*/\"version\": \"$(GIT_VERSION)-beta\",/" package.json
sed -i'.tmp' "s/\"version\": .*/\"version\": \"$(GIT_VERSION)-beta\",/" engine/package.json
@read -p "Publishing version $(GIT_VERSION) to the beta tag. Enter OTP : " otp; \
npm publish --tag beta --otp $$otp engine/ && \
npm publish --tag beta --otp $$otp ./ && \
echo "" && \
echo "" && \
echo "Published version $(GIT_VERSION)-beta to the beta tag successfully." && \
echo ""
@make restore-dev-versions
publish-production: build
sed -i'.tmp' "s/\"version\": .*/\"version\": \"$(GIT_VERSION)\",/" package.json
sed -i'.tmp' "s/\"version\": .*/\"version\": \"$(GIT_VERSION)\",/" engine/package.json
@read -p "Publishing version $(GIT_VERSION). Enter OTP : " otp; \
npm publish --otp $$otp engine/ && \
npm publish --otp $$otp ./ && \
echo "" && \
echo "" && \
echo "Published version $(GIT_VERSION) successfully." && \
echo ""
@make restore-dev-versions
notify:
MSG=`git log -1 --pretty="%B" | sed s/\"//g | sed s/\'//g `; \
VERSION=`git describe --long`; \
curl -X POST -H 'Content-type: application/json' --data '{"text":"'"[GOBAN] $$VERSION $$MSG"'"}' $(SLACK_WEBHOOK)
upload_to_cdn:
rm -Rf deployment-staging-area;
mkdir deployment-staging-area;
cp build/goban.js* deployment-staging-area
cp build/goban.min.js* deployment-staging-area
gsutil -m rsync -r deployment-staging-area/ gs://ogs-site-files/goban/`node -pe 'JSON.parse(require("fs").readFileSync("package.json")).version'`/
.PHONY: doc build docs test clean all dev typedoc publish push build publish-production upload_to_cdn notify beta beta_npm publish-beta publish_docs build-debug build-production detect-duplicate-code duplicate-code-detection lint