-
Notifications
You must be signed in to change notification settings - Fork 0
/
JUSTFILE
32 lines (28 loc) · 1.01 KB
/
JUSTFILE
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
set positional-arguments
new version:
#!/usr/bin/env sh
if git rev-parse --quiet --verify release/{{version}} > /dev/null; then
echo "Release branch exists already"
else
echo "Creating release branch release/{{version}}"
git checkout main && \
git pull && \
git checkout -b release/{{version}} && \
sed -i .bck "s/^version =.*$/version = \"{{version}}\"/" ./Cargo.toml && \
cargo check && \
git commit -am "Prepare release branch {{version}}" && \
git push -u origin release/{{version}}
fi
@check version:
git checkout release/{{version}} && git pull
echo "Running linter and unittests"
cargo clippy && cargo fmt && cargo test -q && cargo doc
@release version:
git tag {{version}}
git push --tags
cargo publish
test:
#!/usr/bin/env zsh
echo -ne "Checking formatting and doc generation"
(cargo clippy && cargo fmt --check && cargo test -q && cargo doc && \
echo " \e[32m\e[1mOK\e[0m") || echo "\e[31m\e[1mERROR\e[0m"