-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
49 lines (40 loc) · 1.04 KB
/
justfile
File metadata and controls
49 lines (40 loc) · 1.04 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
# release workflow
#
# 1. change version in Cargo.toml
# 2. run cargo build
# 3. git add Cargo.toml Cargo.lock
# 4. git commit -m 'chore: bump version to X.X.X'
# 5. just tag
default:
@just --list
# get cargo package version
get-version:
@cargo pkgid | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/'
# run cargo check test and clippy
test:
cargo check
cargo test
cargo clippy
# tag current package version in git
tag:
#!/usr/bin/env bash
set -e
# test just in case
echo "Make sure you ran all the tests"
read -n1
read -n1
version="$(just get-version)"
if [[ -z "$version" ]]; then
echo "Could not read the cargo version"
exit 1
fi
if [[ -n "$(git tag -l "v${version}")" ]]; then
echo "Tag v${version} already exists, did you forget to update Cargo.toml?"
exit 1
fi
if [[ -n "$(git status --porcelain --untracked-files=no)" ]]; then
echo "There are uncommited git changes"
exit 1
fi
echo "Tagging v${version}"
git tag "v${version}"