-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
64 lines (51 loc) · 1.64 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
ROOT_DIR := $(shell pwd)
build:
cargo build --release
clippy:
cargo clippy -- -Dwarnings
test:
cargo test
quality-check: test clippy
docs:
cargo clean --doc
cargo doc --no-deps
open_docs:
cargo clean --doc
cargo doc --no-deps --open
codecov:
@rm -rf $(ROOT_DIR)/target/cov/
@mkdir -p $(ROOT_DIR)/target/cov/
CARGO_INCREMENTAL=0 \
RUSTFLAGS='-Cinstrument-coverage' \
LLVM_PROFILE_FILE="$(ROOT_DIR)/target/cov/cargo-test-%p-%m.profraw" \
cargo test --profile=codecov
grcov . \
-s $(ROOT_DIR)/ \
--binary-path ./target/codecov/ \
-t html \
--branch \
--ignore-not-existing \
-o $(ROOT_DIR)/target/codecov/coverage/
xdg-open $(ROOT_DIR)/target/codecov/coverage/index.html
update-version:
@release-plz update
update-changelog:
APP_VERSION="v$$(cargo metadata --format-version=1 --no-deps | jq --raw-output '.packages.[0].version')"; \
grep '^## \['$${APP_VERSION}'\]' CHANGELOG.md >/dev/null 2>&1 \
&& echo "This version is already in the changelog!" \
|| sed -e '/^<!-- changes -->$$/r'<( \
echo -e "\n## [$${APP_VERSION}]\n"; \
gh api repos/yitsushi/eval-md/releases/generate-notes -F tag_name=$${APP_VERSION} --jq .body \
| sed -e 's/^#/##/' \
) -i -- CHANGELOG.md
release-prepare: update-version update-changelog
git checkout -b release-$$(date '+%Y-%m-%d-%s')
git add Cargo.lock Cargo.toml CHANGELOG.md
git commit -m "release: v$$(cargo metadata --format-version=1 --no-deps | jq --raw-output '.packages.[0].version')"
git push -u origin $$(git rev-parse --abbrev-ref HEAD)
gh pr create --label=release --fill
release:
git checkout main
git fetch origin main
git reset --hard origin/main
release-plz release