-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
82 lines (60 loc) · 1.66 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
GIT_REV_LONG=$(shell git rev-parse HEAD)
GIT_REV_SHORT=$(shell git rev-parse --short HEAD)
VERSION ?= $(GIT_REV_SHORT)
GITBOOK=node_modules/.bin/gitbook
OS=$(shell tools/get_os.sh)
DIST_NAME=kashmir-$(VERSION)-$(OS)
DIST_ZIP=target/$(DIST_NAME).zip
all: docs dist
clean:
rm -rf target
target/kmi:
mkdir -p target
raco exe -o target/kmi repl.rkt
$(GITBOOK):
npm install gitbook-cli
target/kashmir/docs: docs/* $(GITBOOK)
$(GITBOOK) build docs target/kashmir/docs
rm -f target/kashmir/docs/*.md~
.PHONY: docs
docs: target/kashmir/docs
.PHONY: watch-docs
watch-docs:
$(GITBOOK) serve docs docs/_book
.PHONY: release-docs
release-docs:
git reset --hard HEAD
git checkout gh-pages
make clean docs
cp -r target/kashmir/docs/* ./
git rebase master
git add -a .
git commit -m "Auto-generated docs" .
git push origin gh-pages
git checkout master
target/kashmir: target/kmi README.md
mkdir -p target/kashmir
raco distribute target/kashmir target/kmi
cp README.md target/kashmir/README.txt
echo "$(VERSION) (git revision: $(GIT_REV_LONG))" >> target/kashmir/VERSION.txt
$(DIST_ZIP): target/kashmir
(cd target/kashmir && zip ../$(DIST_NAME).zip -r *)
dist: $(DIST_ZIP)
release: $(DIST_ZIP)
@echo "\n\nDon't forget to set env variable GITHUB_TOKEN first!\n\n"
go get github.com/aktau/github-release
-git tag -d $(VERSION)
git tag -a -m "Release $(VERSION)" $(VERSION)
git push origin +$(VERSION)
-github-release release \
--user owickstrom \
--repo kashmir \
--tag $(VERSION) \
--name $(VERSION) \
--pre-release
github-release upload \
--user owickstrom \
--repo kashmir \
--tag $(VERSION) \
--name "$(DIST_NAME).zip" \
--file $(DIST_ZIP)