forked from rapina-rs/rapina
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
74 lines (59 loc) · 2.39 KB
/
Copy pathjustfile
File metadata and controls
74 lines (59 loc) · 2.39 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
69
70
71
72
73
74
# rapina task runner — install just: https://github.com/casey/just
# List available recipes
default:
@just --list
# Run all checks (fmt, clippy, tests)
check:
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --locked --all
# Run tests only
test:
cargo test --locked --all
# Run doc tests
test-doc:
cargo test --locked --doc --all-features
# Format code
fmt:
cargo fmt --all
# Bump versions, update docs/examples, open release PR
# Usage: just release 0.12.0
release VERSION:
#!/usr/bin/env bash
set -euo pipefail
VERSION="{{VERSION}}"
echo "Preparing release v${VERSION}..."
MINOR="${VERSION%.*}"
# Bump Cargo.toml package versions
sed -i '' 's/^version = ".*"/version = "{{VERSION}}"/' rapina/Cargo.toml rapina-macros/Cargo.toml rapina-cli/Cargo.toml
# Bump rapina-macros cross-reference in rapina/Cargo.toml
sed -i '' 's/rapina-macros = { version = "[^"]*"/rapina-macros = { version = "{{VERSION}}"/' rapina/Cargo.toml
# Bump version references in docs and examples (excluding blog history)
find docs/content/docs/ rapina/examples/ \( -name "*.md" -o -name "*.toml" \) \
| xargs sed -i '' \
-e "s/rapina = { version = \"[0-9][^\"]*\"/rapina = { version = \"{{VERSION}}\"/g" \
-e "s/^rapina = \"[0-9][^\"]*\"/rapina = \"{{VERSION}}\"/g"
# Regenerate Cargo.lock
cargo check --workspace
# Create branch, commit, push, open PR
git checkout -b release_{{VERSION}}
git add rapina/Cargo.toml rapina-macros/Cargo.toml rapina-cli/Cargo.toml Cargo.lock CHANGELOG.md
git add docs/ rapina/examples/
git commit -m "Bump version to {{VERSION}}"
git push origin release_{{VERSION}}
gh pr create \
--title "Release v{{VERSION}}" \
--base main \
--head release_{{VERSION}} \
--body "Bumps all version references to {{VERSION}}. Merge this PR then push the \`v{{VERSION}}\` tag to trigger the release."
echo ""
echo "PR opened. Once merged, tag and push:"
echo " git tag v{{VERSION}} && git push origin v{{VERSION}}"
# Push the release tag after the version bump PR is merged
# Usage: just tag 0.12.0
tag VERSION:
git checkout main
git pull origin main
git tag v{{VERSION}}
git push origin v{{VERSION}}
echo "Tag v{{VERSION}} pushed — CI will handle the GitHub release and crates.io publish."