pub trait ReleaseStrategy: Send + Sync {
// Required methods
fn plan(&self) -> Result<ReleasePlan, ReleaseError>;
fn prepare(
&self,
plan: &ReleasePlan,
dry_run: bool,
) -> Result<(), ReleaseError>;
fn execute(
&self,
plan: &ReleasePlan,
dry_run: bool,
) -> Result<(), ReleaseError>;
}Expand description
Orchestrates the release flow.
Required Methods§
Sourcefn plan(&self) -> Result<ReleasePlan, ReleaseError>
fn plan(&self) -> Result<ReleasePlan, ReleaseError>
Compute the release plan without executing it or mutating files.
Used by sr plan.
Sourcefn prepare(&self, plan: &ReleasePlan, dry_run: bool) -> Result<(), ReleaseError>
fn prepare(&self, plan: &ReleasePlan, dry_run: bool) -> Result<(), ReleaseError>
Write release-local state to disk (version_files + changelog) but
do not commit, tag, push, or publish. Idempotent: running twice
leaves the same files. Used by sr prepare.
Downstream CI jobs read the bumped manifests (e.g. cargo build
picks up the new CARGO_PKG_VERSION) so produced artifacts embed
the correct version, then sr release finishes the reconciliation.
Sourcefn execute(&self, plan: &ReleasePlan, dry_run: bool) -> Result<(), ReleaseError>
fn execute(&self, plan: &ReleasePlan, dry_run: bool) -> Result<(), ReleaseError>
Apply the plan: commit + tag + push + create release + upload + publish. Idempotent at each stage; safe to re-run.