-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (68 loc) · 1.99 KB
/
Copy pathMakefile
File metadata and controls
85 lines (68 loc) · 1.99 KB
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
.PHONY: all compile format test cover clean doc hank format_verify build-test dialyzer xref type_check check_app_calls hex release demo
all: compile format test cover
compile:
rebar3 compile
format:
rebar3 fmt
hank:
rebar3 hank
format_verify:
rebar3 fmt --check
test:
rebar3 eunit
rebar3 ct
cover:
rebar3 cover
build-test: compile xref type_check test hank check_app_calls format_verify cover dialyzer
dialyzer:
rebar3 dialyzer
clean:
rebar3 clean
xref:
rebar3 xref
type_check:
@output=$$(elp eqwalize-all); \
echo "$$output"; \
if ! echo "$$output" | grep -q "NO ERRORS"; then \
exit 1; \
else \
exit 0; \
fi
check_app_calls:
rebar3 check_app_calls
doc:
rebar3 ex_doc
demo:
rebar3 as demo shell
hex:
rebar3 hex build
rebar3 hex publish
release:
@branch=$$(git rev-parse --abbrev-ref HEAD); \
if [ "$$branch" != "main" ]; then \
echo "Error: You must be on the main branch to release (currently on '$$branch')."; \
exit 1; \
fi
@git fetch origin main --quiet
@if [ "$$(git rev-parse HEAD)" != "$$(git rev-parse origin/main)" ]; then \
echo "Error: Local main is not in sync with origin/main. Please pull or push first."; \
git status -sb; \
exit 1; \
fi
@if [ -n "$$(git status --porcelain)" ]; then \
echo "Error: There are uncommitted changes. Please commit or stash them before releasing."; \
git status --short; \
exit 1; \
fi
@echo "Last 5 tags:"
@git tag --sort=-version:refname | head -n 5
@echo ""
@read -r -p "Enter the next tag (e.g., v1.0.0): " tag && [ -n "$$tag" ] || { echo "Tag cannot be empty. Aborted."; exit 1; }; \
read -r -p "Did you update the README install instructions _AND_ CHANGELOG.md? (Y/N) " a && [ "$$a" = "Y" ] || { echo "Aborted."; exit 1; }; \
git tag "$$tag" && \
rebar3 compile && \
rebar3 hex build && \
rebar3 hex publish && \
git push origin "$$tag" && \
gh release create "$$tag" --title "v$$tag" --notes "$$(sed -n "/## \[$$tag\]/,/## \[/p" CHANGELOG.md | sed '$$d' | tail -n +2)" && \
echo "Released and tagged as $$tag"