-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJustfile
More file actions
68 lines (55 loc) · 1.51 KB
/
Copy pathJustfile
File metadata and controls
68 lines (55 loc) · 1.51 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
56
57
58
59
60
61
62
63
64
65
66
67
68
# Default recipe: run checks
default: check
# Run all checks (format, lint, test)
check: fmt-check lint test
# Build the library
build:
cargo build
# Run tests
test:
cargo test
# Run clippy lints
lint:
cargo clippy -- -D warnings
# Check formatting
fmt-check:
cargo fmt --check
# Auto-format code
fmt:
cargo fmt
# Run all checks then build in release mode
release-build: check
cargo build --release
# Set the release version in Cargo.toml
set-version version:
#!/usr/bin/env bash
set -euo pipefail
current=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
if [ "{{version}}" = "$current" ]; then
echo "Version is already {{version}}"
exit 1
fi
# Use a temp file for portability (BSD sed -i requires arg, GNU doesn't)
tmp=$(mktemp)
sed 's/^version = ".*"/version = "{{version}}"/' Cargo.toml > "$tmp"
mv "$tmp" Cargo.toml
cargo check
echo "Updated version: $current -> {{version}}"
# Tag a release (sets version, commits, tags, pushes)
release version: (set-version version)
git add Cargo.toml Cargo.lock
git commit -m "Release v{{version}}"
git tag -a "v{{version}}" -m "v{{version}}"
git push origin main --tags
# Publish to crates.io (dry run)
publish-dry:
cargo publish --dry-run
# Publish to crates.io
publish:
cargo publish
# Regenerate Style::PgDump fixtures from a throwaway PostgreSQL cluster
gen-pgdump-fixtures:
bash tests/fixtures/pg_dump/generate.sh
# Clean build artifacts
clean:
cargo clean