Skip to main content

ReleaseConfig

Struct ReleaseConfig 

Source
pub struct ReleaseConfig {
Show 29 fields pub github: Option<ScmRepoConfig>, pub gitlab: Option<ScmRepoConfig>, pub gitea: Option<ScmRepoConfig>, pub draft: Option<bool>, pub prerelease: Option<PrereleaseConfig>, pub make_latest: Option<MakeLatestConfig>, pub name_template: Option<String>, pub header: Option<ContentSource>, pub footer: Option<ContentSource>, pub extra_files: Option<Vec<ExtraFileSpec>>, pub templated_extra_files: Option<Vec<TemplatedExtraFile>>, pub skip_upload: Option<StringOrBool>, pub replace_existing_draft: Option<bool>, pub replace_existing_artifacts: Option<bool>, pub skip: Option<StringOrBool>, pub mode: Option<String>, pub ids: Option<Vec<String>>, pub exclude: Option<Vec<String>>, pub target_commitish: Option<String>, pub discussion_category_name: Option<String>, pub include_meta: Option<bool>, pub use_existing_draft: Option<bool>, pub tag: Option<String>, pub upload_concurrency: Option<u32>, pub upload_pace: Option<HumanDuration>, pub required: Option<bool>, pub provider: Option<ForceTokenKind>, pub retain_on_rollback: Option<bool>, pub on_failure: Option<OnFailureConfig>,
}

Fields§

§github: Option<ScmRepoConfig>

GitHub repository to release to (owner and name).

§gitlab: Option<ScmRepoConfig>

GitLab repository to release to (owner and name).

§gitea: Option<ScmRepoConfig>

Gitea repository to release to (owner and name).

§draft: Option<bool>

When true, create the release as a draft (unpublished).

§prerelease: Option<PrereleaseConfig>

Mark release as pre-release: true, false, or “auto” (inferred from tag).

§make_latest: Option<MakeLatestConfig>

Mark release as latest: true, false, or “auto” (latest non-prerelease).

§name_template: Option<String>

Release title template (supports templates).

§header: Option<ContentSource>

Text prepended to the release body (inline string, from_file, or from_url).

§footer: Option<ContentSource>

Text appended to the release body (inline string, from_file, or from_url).

§extra_files: Option<Vec<ExtraFileSpec>>

Extra files to upload to the release beyond build artifacts.

Paths / globs are resolved relative to the project root. .. segments are accepted, so an entry like ../sibling/dist/* will reach outside the project tree — security-conscious users should keep the entries inside the repo or canonicalise them before invoking the release pipeline.

§templated_extra_files: Option<Vec<TemplatedExtraFile>>

Extra files whose contents are rendered through the template engine before upload. Unlike extra_files which copy as-is, template variables like {{ Tag }} are expanded.

Same path-traversal caveat as extra_files: .. segments reach outside the project tree.

§skip_upload: Option<StringOrBool>

Skip uploading artifacts: true, false, or “auto” (skip for snapshots). Accepts bool or template string.

§replace_existing_draft: Option<bool>

When true, replace an existing draft release instead of failing.

§replace_existing_artifacts: Option<bool>

When true, replace existing release artifacts with the same name.

§skip: Option<StringOrBool>

Skip the release stage. Accepts bool or template string (e.g. "{{ if IsSnapshot }}true{{ endif }}" for conditional skip). Template strings are supported here. Accepts the legacy disable: spelling via serde alias for back-compat with imported configs (the legacy disable: spelling).

§mode: Option<String>

Release mode: “keep-existing”, “append”, “prepend”, or “replace”.

§ids: Option<Vec<String>>

Artifact IDs filter for uploads. Release-wide artifacts (checksums, source archive, extra files, metadata) always upload regardless of the filter, and derived artifacts (signatures, certificates, SBOMs) inherit the verdict of the artifact they derive from — a signature uploads iff the artifact it signs uploads.

§exclude: Option<Vec<String>>

Glob patterns matched against each release asset’s file name; anodizer drops any asset whose name matches at least one glob before attaching it to THIS GitHub release only (a mirror configured elsewhere is unaffected). Use it to keep heavy sidecars (checksums, signatures, SBOMs) off the GitHub release while archives still attach. Composes with ids: (both filters apply). None/empty keeps everything.

release:
  github: { owner: my-org, name: my-repo }
  exclude: ["*.sha256", "*.sig", "*.cdx.json"]
§target_commitish: Option<String>

Target branch or SHA for the release tag.

§discussion_category_name: Option<String>

GitHub Discussion category name for the release.

§include_meta: Option<bool>

Upload dist/metadata.json as a release asset. The sibling dist/artifacts.json manifest is never uploaded — it stays local to the dist directory.

§use_existing_draft: Option<bool>

Reuse an existing draft release instead of creating a new one.

§tag: Option<String>

Override the release tag (template string). When set, this tag is used as the tag_name in the GitHub release API instead of the crate’s tag_template. Useful in monorepo setups to strip a tag prefix (e.g. "{{ Tag }}" to publish v1.0.0 instead of myapp/v1.0.0). A cross-platform publishing feature provided for free by anodizer.

§upload_concurrency: Option<u32>

Maximum number of asset-upload requests in flight simultaneously. Applies to asset uploads on every release forge (GitHub, GitLab, Gitea).

GitHub’s secondary rate-limit is triggered by burst traffic. Keeping this value low avoids tripping the limit even for releases with many artifacts. Default: 4. Override at runtime with ANODIZER_GITHUB_UPLOAD_CONCURRENCY.

§upload_pace: Option<HumanDuration>

Minimum interval between successive asset-upload starts (a humantime string, e.g. "200ms", "1s", "0s"). Applies to asset uploads on every release forge (GitHub, GitLab, Gitea).

This is a proactive pace that smooths the initial burst of upload requests, layered on top of Self::upload_concurrency (the concurrency cap) and the reactive secondary-rate-limit backoff. With the concurrency cap alone, the first N uploads fire in the same instant — exactly the burst pattern that trips GitHub’s secondary rate limit. Spacing each upload’s start by this interval (with ±20% jitter so concurrent releases don’t synchronise) makes the burst far less likely to trip the limit in the first place.

Default: "200ms" — at the default concurrency of 4 this caps the initial start rate at ~5/s, which is below the burst threshold yet adds negligible wall-clock to a normal release (upload time is dominated by transfer, not start-spacing). Set to "0s" to disable pacing entirely (rely on the concurrency cap + reactive backoff). Override at runtime with ANODIZER_GITHUB_UPLOAD_PACE_MS (integer milliseconds; 0 disables).

§required: Option<bool>

Override whether this publisher failing should fail the overall release.

Default: true — a failure here aborts the release. Set to false to log failures but continue.

§provider: Option<ForceTokenKind>

Explicit publish target — the SCM provider whose release.<provider> block the publisher uses. When set, overrides the implicit token-type fallback chain in crate::scm::resolve_token_type.

Use this for cross-platform publishing pattern: source repo on one provider (e.g. GitLab) but releases land on another (e.g. GitHub). Without it, the publish target is inferred from which *_TOKEN env-var is set — fine for single-provider setups but ambiguous when both tokens are available.

release:
  provider: github
  github:
    owner: my-org
    name: my-app
§retain_on_rollback: Option<bool>

When true, a triggered rollback leaves this publisher’s work in place rather than attempting to undo it. Default false.

§on_failure: Option<OnFailureConfig>

In-process failure policy: what anodizer release does after a release-pipeline failure. hold is the only accepted value, and it describes what the pipeline now does unconditionally — leave everything in place for forensics. Recovery is a re-run (publishers reconcile and self-skip, so an identical command converges on already-published state) or, for deliberate withdrawal, anodizer tag rollback. rollback is rejected at config load (validate_on_failure_not_rollback) — automatic rollback was removed. Because the value drives no branch, nothing reads this field at runtime; it exists so a config carrying the removed policy fails loudly instead of being silently downgraded. Root-level policy — in workspace configs (lockstep or per-crate) the top-level release.on_failure governs the whole run; setting it in a crate-level release: block is rejected at config load (validate_on_failure_root_only).

Implementations§

Source§

impl ReleaseConfig

Source

pub const DEFAULT_NAME_TEMPLATE: &'static str = "{{ Tag }}"

Default release-name template ("{{Tag}}"). Anodize uses Tera-style {{ Tag }} (no dot prefix); the rendered value is identical for any tag the project produces.

Source

pub const DEFAULT_MODE: &'static str = "keep-existing"

Default release mode (empty string is treated as “keep-existing” — keep current release notes, don’t overwrite).

Source

pub const DEFAULT_UPLOAD_PACE: Duration

Default minimum interval between successive asset-upload starts (see Self::upload_pace). 200 ms smooths the initial burst at the default concurrency of 4 without meaningfully slowing a release.

Source

pub const VALID_MODES: &[&'static str]

Valid mode: values. Anything else is a config error.

Source

pub fn resolved_name_template(&self) -> &str

Resolve the name_template, falling back to Self::DEFAULT_NAME_TEMPLATE.

Source

pub fn resolved_mode(&self) -> Result<&str>

Resolve the release mode, validating and falling back to Self::DEFAULT_MODE when unset or empty. Returns an error when the user supplied a value outside Self::VALID_MODES so the invalid mode surfaces at the call site instead of producing a silent no-op publish.

Source

pub fn resolved_draft(&self) -> bool

Resolve draft, falling back to false.

Source

pub fn resolved_replace_existing_draft(&self) -> bool

Resolve replace_existing_draft, falling back to false.

Source

pub fn resolved_replace_existing_artifacts(&self) -> bool

Resolve replace_existing_artifacts, falling back to false.

Source

pub fn resolved_include_meta(&self) -> bool

Resolve include_meta, falling back to false (don’t upload metadata.json as a release asset by default).

Source

pub fn resolved_use_existing_draft(&self) -> bool

Resolve use_existing_draft, falling back to false (always create a fresh draft when one isn’t found by default).

Source

pub fn resolved_upload_pace(&self) -> Duration

Resolve the upload pace (minimum inter-upload-start interval) from the config, applying Self::DEFAULT_UPLOAD_PACE when unset. A configured "0s" resolves to Duration::ZERO, which the upload loop treats as “pacing disabled”.

Note: the runtime env override ANODIZER_GITHUB_UPLOAD_PACE_MS takes precedence and is applied at the call site (it needs the request-scoped crate::context::Context), mirroring how ANODIZER_GITHUB_UPLOAD_CONCURRENCY overrides Self::upload_concurrency.

Trait Implementations§

Source§

impl Clone for ReleaseConfig

Source§

fn clone(&self) -> ReleaseConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReleaseConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ReleaseConfig

Source§

fn default() -> ReleaseConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ReleaseConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for ReleaseConfig

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PublisherGateOverrides for ReleaseConfig

Source§

fn required_override(&self) -> Option<bool>

Config-level required: override. None keeps the publisher’s built-in default; Some(true) anywhere escalates the release gate.
Source§

fn retain_on_rollback_override(&self) -> Option<bool>

Config-level retain_on_rollback: override. Some(true) anywhere opts the publisher’s successful work out of rollback.
Source§

impl Serialize for ReleaseConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more