-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
55 lines (44 loc) · 1.63 KB
/
Justfile
File metadata and controls
55 lines (44 loc) · 1.63 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
# Load version from Cargo.toml
version := `sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' Cargo.toml | head -1`
# Guard for running just without args. just list recipes
_default:
just --list
# Run clippy and format code
check: _shellcheck _format
cargo clippy --all
# Format code
_format:
cargo fmt --all --check
cargo fmt --all
# Check shell scripts
_shellcheck:
fd -e sh -t f -X shellcheck
# create version tag and push to origin
tag-version: check
grep -Fq '{{ version }}' CHANGELOG.md # The CHANGELOG.md should contains updated changes
git diff --no-ext-diff --quiet --exit-code # All files should be committed
git tag -a v{{ version }} -m "Release v{{ version }}"
git push origin v{{ version }}
# Remove a tag
tag-remove: check
git tag --delete v{{ version }}
git push --delete origin v{{ version }}
git push origin main
# crate tag push it to origin and then publish to crates.io (TODO)
crates: tag-version
cargo publish
# Create man page
_gen-man:
cp support/manpage/places.md support/manpage/places_fix.md
sed -i "s|<version>|{{ version }}|" support/manpage/places_fix.md
sed -i "s|<date>|$(date '+%Y-%m-%d')|" support/manpage/places_fix.md
pandoc --standalone --to man support/manpage/places_fix.md -o support/manpage/places.1
rm support/manpage/places_fix.md
# Create and view the manpage
man: _gen-man
PAGER=most man support/manpage/places.1
# Create a debian file
deb:
cargo deb
dpkg-deb --info target/debian/places-cli_{{ version }}-1_amd64.deb
dpkg-deb --contents target/debian/places-cli_{{ version }}-1_amd64.deb