-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (32 loc) · 777 Bytes
/
Makefile
File metadata and controls
38 lines (32 loc) · 777 Bytes
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
.PHONY: all
all: build
.PHONY: build
build:
stack build
.PHONY: install
install:
stack install
.PHONY: test
test:
stack test
.PHONY: clean
clean:
stack clean
.PHONY: bump
bump:
@[ "$$(git branch --show-current)" = "main" ] || { \
echo "Current branch is not main: $$(git branch --show-current)"; \
exit 1; \
}
@[ "$$(git status --porcelain)" = " M $$(ls *.cabal)" ] || { \
echo "Version is not updated, or unrelated files are updated:"; \
git status --porcelain -z | xargs -0 -r printf " %s\n" ; \
exit 1; \
}
$(eval VERSION:=$(shell sed -n "s/^version: *//p" *.cabal))
git commit -am "bump up version to $(VERSION)"
git tag "v$(VERSION)"
git push --atomic origin main tag "v$(VERSION)"
.PHONY: sdist
sdist:
stack sdist --test-tarball --tar-dir .