jj_release_core (Library)
The core automation engine behind jj-release. This crate provides a
programmatic, trait-driven Rust API for interacting with Jujutsu (jj), parsing
commits, resolving Semantic Versions, and orchestrating release pipelines.
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, or Forgejo.
Usage
Add jj_release_core to your Cargo.toml:
[]
= "0.1.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: generate a changelog section for any reponext_version: compute the next release versionvalidate_repo: run preflight checks before releasing