Expand description
Release distribution backends.
This module defines the ReleaseBackend trait that provider crates
can implement to support release distribution.
§Architecture
The release crate provides:
ReleaseBackendtrait - interface for publishing artifactsBackendContext- common context passed to backendsPublishResult- result type for publish operations
Provider crates implement ReleaseBackend:
cuenv-github- GitHub Releasescuenv-homebrew- Homebrew tap updates
§Example
ⓘ
use cuenv_release::backends::{ReleaseBackend, BackendContext, PublishResult};
use cuenv_release::artifact::PackagedArtifact;
struct MyBackend;
impl ReleaseBackend for MyBackend {
fn name(&self) -> &'static str { "my-backend" }
fn publish<'a>(
&'a self,
ctx: &'a BackendContext,
artifacts: &'a [PackagedArtifact],
) -> Pin<Box<dyn Future<Output = Result<PublishResult>> + Send + 'a>> {
Box::pin(async move {
// Upload artifacts...
Ok(PublishResult::success("my-backend", "Published"))
})
}
}Structs§
- Backend
Context - Configuration common to all backends.
- Publish
Result - Result of a backend publish operation.
Traits§
- Release
Backend - Trait for release distribution backends.