Skip to content

Commit e730a26

Browse files
committed
chore: add release recipe to justfile
just bump X.Y.Z → update versions + CHANGELOG template just release → check + commit + tag + push + publish
1 parent d3ab47d commit e730a26

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

justfile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,23 @@ bump version:
6868
echo "Updated: Cargo.toml, README.md, src/lib.rs, CHANGELOG.md"
6969
echo "Edit CHANGELOG.md to fill in release notes"
7070

71-
# Publish to crates.io (runs full check first)
72-
publish: check
71+
# Release: check → commit → tag → push → publish (run `just bump X.Y.Z` first)
72+
release: check
73+
#!/usr/bin/env bash
74+
set -euo pipefail
75+
version=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
76+
# Verify CHANGELOG has been filled in (not just template)
77+
if grep -q "^## \[${version}\]" CHANGELOG.md && grep -A3 "^## \[${version}\]" CHANGELOG.md | grep -q "^$"; then
78+
echo "⚠ CHANGELOG.md looks like a template — fill in release notes first"
79+
exit 1
80+
fi
81+
echo "Releasing v${version}..."
82+
git add -A
83+
git commit -m "chore: release ${version}"
84+
git tag "v${version}"
85+
git push origin main --tags
7386
cargo publish
87+
echo "Published kube-cel v${version}"
7488

7589
# Dry-run publish
7690
publish-dry: check

0 commit comments

Comments
 (0)