-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
33 lines (30 loc) · 956 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
32
33
VERSION = $(shell mix run -e "CubDB.Mixfile.project() |> Keyword.get(:version) |> IO.write()")
VERSION_TAG = v$(VERSION)
.PHONY: test
test:
mix format --check-formatted
mix dialyzer
mix coveralls --include property_based
.PHONY: benchmarks
benchmarks:
@echo "\nBenchmark: put/3"
@echo "================"
mix run benchmarks/put.exs
@echo "\nBenchmark: get/3"
@echo "================"
mix run benchmarks/get.exs
.PHONY: release
release: test
@if [ $(shell git rev-parse --abbrev-ref HEAD) != master ]; then \
echo "Error: not on master branch"; exit 1; \
else true; fi
@if [ $(git rev-parse $(VERSION_TAG)) ]; then \
echo "Error: tag $(VERSION_TAG) already exists"; exit 1; \
else true; fi
@if [ -n "$(shell git status --porcelain)" ]; then \
echo "Error: there are uncommitted changes"; exit 1; \
else true; fi
git tag $(VERSION_TAG)
git push
git push --tags
open https://github.com/lucaong/cubdb/releases/new?tag=$(VERSION_TAG)