jj_release_core (Library)
The core automation engine behind
jj-release. Provides a
programmatic, trait-driven Rust API for interacting with Jujutsu (jj), parsing
commits, resolving Semantic Versions, and orchestrating release pipelines. Can
also be used directly to build custom release automation on top of Jujutsu.
Architecture
The library is built around a functional core that orchestrates releases using a set of pluggable backends. All side effects are abstracted behind traits, making it highly testable and extensible.
To run a release pipeline, you construct a ReleaseContext containing
implementations for four core traits:
JjBackend: Interfaces with the Jujutsu VCS (e.g.,ShellBackend).ManifestBackend: Reads and writes project versions (e.g.,CargoManifest,NpmManifest).PublishBackend: Handles pushing artifacts to package registries.ForgeBackend: Interacts with remote Git forges like GitHub, GitLab, Forgejo, and Gitea.
Beyond the core pipeline, the library also provides:
distro: publish to AUR and Fedora COPR after a crates.io release (behindpublish-aurandpublish-coprfeature flags)workspace: detect and manage multi-crate Cargo workspaces, including topological publish ordering and per-member version bumpingmanifest: read and write version fields across Cargo, npm, and Go manifests without losing formatting, and update cross-member dependency versionsconfig: loadrelease.tomland generate one automatically viagenerate_release_tomldetect: auto-detect forge, language, and workspace versioning strategyregistry: query crates.io for published versions as a release baseline- Replacements: update arbitrary files (README badges, spec files, docs) with version strings on each release
Usage
Add jj_release_core to your Cargo.toml:
[]
= "0.6.0"
Quick Start
use Path;
use ;
[!NOTE]
ShellBackendrequiresjjon PATH.
Error Handling
All fallible operations return jj_release::errors::Result<T>, an alias for
Result<T, ReleaseError>. The ReleaseError enum is powered by thiserror and
covers IO, parsing, network, and release-specific failures, making it easy to
pattern-match against specific failure states in your own applications.
Extending
Implement any of the core traits to customize behavior:
use ManifestBackend;
use Result;
use Version;
;
Examples
See the examples/ directory for runnable demos:
generate_changelog: preview the next changelog section for commits since the last tagfull_changelog: regenerate the complete changelog from all tags in historynext_version: compute and print the next semantic version based on commitsvalidate_repo: run preflight checks to confirm a repo is ready to releasedetect_env: detect forge, language, and workspace versioning strategyinit: preview the generatedrelease.tomlfor a repositoryrun_release: demonstrates how to run the full pipeliine. Warning, this example makes real changes!workspace_info: inspect workspace members, versions, and dependency orderbump_deps: update cross-member dependency versions without a full release