forked from kurtbuilds/oasgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
52 lines (39 loc) · 1.24 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
set dotenv-load := true
set positional-arguments
help:
@just --list --unsorted
build:
cargo build
alias b := build
test:
@just oasgen/test
check:
cargo check
alias c := check
fix:
cargo clippy --fix
# Bump version. level=major,minor,patch
version level:
#!/bin/bash -euxo pipefail
git diff-index --exit-code HEAD > /dev/null || ! echo You have untracked changes. Commit your changes before bumping the version. || exit 1
echo $(dye -c INFO) Make sure that it builds first.
just test
cargo set-version --bump {{ level }} --workspace --exclude swagger-ui2
VERSION=$(toml get oasgen/Cargo.toml package.version)
toml set macro/Cargo.toml dependencies.oasgen-core.version $VERSION
(cd macro && cargo update)
toml set oasgen/Cargo.toml dependencies.oasgen-core.version $VERSION
toml set oasgen/Cargo.toml dependencies.oasgen-macro.version $VERSION
(cd oasgen && cargo update)
git commit -am "Bump version {{level}} to $VERSION" && \
git tag v$VERSION && \
git push --tags
publish:
cd core && cargo publish --all-features
cd macro && cargo publish --all-features
cd oasgen && cargo publish --all-features
patch: test
just version patch
just publish
doc:
@just oasgen/doc