-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjustfile
78 lines (61 loc) · 1.85 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
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
VERSION := `toml get cli/Cargo.toml package.version | jq -r`
export TAG:=`toml get cli/Cargo.toml package.version | jq -r .`
default_bump := 'patch'
# List available commands
_default:
just --choose --chooser "fzf +s -x --tac --cycle"
# Test / watch
test:
cargo watch -x "test -- --no-capture"
# Test including ignored tests
test_all:
cargo test -- --include-ignored
# Generate usage samples
_usage:
cargo run -q --bin cargo-crate -- --help > doc/help.adoc
cargo run -q --bin cargo-crate -- info --help > doc/usage_info.adoc
cargo run -q --bin cargo-crate -- open --help > doc/usage_open.adoc
cargo run -q --bin cargo-crate -- search --help > doc/usage_search.adoc
# Generate documentation
doc: _usage
cargo doc -p cargo-crate -p lib-cargo-crate --all-features --no-deps
# Run rustfmt
_fmt:
cargo +nightly fmt --all
# Run clippy
_clippy:
cargo +nightly clippy --all-features --all-targets
deny:
cargo deny check
# Run checks such as clippy, rustfmt, etc...
check: _clippy _fmt
# Minor bump, can be used once the release is ready
bump bump=default_bump:
cargo workspaces version {{bump}} --no-git-commit
clean:
rm -f cli/*.wasm
rm -f *.wasm
changelog:
#!/usr/bin/env bash
latest=$(git rev-list -n 1 latest)
cog changelog -f $latest
# Generate the readme as .md
md:
#!/usr/bin/env bash
asciidoctor -b docbook -a leveloffset=+1 -o - README_src.adoc | pandoc --markdown-headings=atx --wrap=preserve -t markdown_strict -f docbook - > README.md
# The README of cli is symlinked to the main README
publish:
#!/bin/sh
echo Releasing v$TAG
git checkout v$TAG
cargo workspaces publish --skip-published --amend --exact --all
tag:
#!/bin/sh
echo Tagging version v$TAG
git tag "v$TAG" -f
git tag | sort -Vr | head
tag_push:
#!/bin/sh
echo Pushing v$TAG
git push origin v$TAG
release : check test_all bump doc md tag tag_push publish