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).
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-appretain_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
impl ReleaseConfig
Sourcepub const DEFAULT_NAME_TEMPLATE: &'static str = "{{ Tag }}"
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.
Sourcepub const DEFAULT_MODE: &'static str = "keep-existing"
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).
Sourcepub const DEFAULT_UPLOAD_PACE: Duration
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.
Sourcepub const VALID_MODES: &[&'static str]
pub const VALID_MODES: &[&'static str]
Valid mode: values. Anything else is a config error.
Sourcepub fn resolved_name_template(&self) -> &str
pub fn resolved_name_template(&self) -> &str
Resolve the name_template, falling back to
Self::DEFAULT_NAME_TEMPLATE.
Sourcepub fn resolved_mode(&self) -> Result<&str>
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.
Sourcepub fn resolved_draft(&self) -> bool
pub fn resolved_draft(&self) -> bool
Resolve draft, falling back to false.
Sourcepub fn resolved_replace_existing_draft(&self) -> bool
pub fn resolved_replace_existing_draft(&self) -> bool
Resolve replace_existing_draft, falling back to false.
Sourcepub fn resolved_replace_existing_artifacts(&self) -> bool
pub fn resolved_replace_existing_artifacts(&self) -> bool
Resolve replace_existing_artifacts, falling back to false.
Sourcepub fn resolved_include_meta(&self) -> bool
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).
Sourcepub fn resolved_use_existing_draft(&self) -> bool
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).
Sourcepub fn resolved_upload_pace(&self) -> Duration
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
impl Clone for ReleaseConfig
Source§fn clone(&self) -> ReleaseConfig
fn clone(&self) -> ReleaseConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReleaseConfig
impl Debug for ReleaseConfig
Source§impl Default for ReleaseConfig
impl Default for ReleaseConfig
Source§fn default() -> ReleaseConfig
fn default() -> ReleaseConfig
Source§impl<'de> Deserialize<'de> for ReleaseConfigwhere
ReleaseConfig: Default,
impl<'de> Deserialize<'de> for ReleaseConfigwhere
ReleaseConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ReleaseConfig
impl JsonSchema for ReleaseConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PublisherGateOverrides for ReleaseConfig
impl PublisherGateOverrides for ReleaseConfig
Source§fn required_override(&self) -> Option<bool>
fn required_override(&self) -> Option<bool>
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>
fn retain_on_rollback_override(&self) -> Option<bool>
retain_on_rollback: override. Some(true) anywhere
opts the publisher’s successful work out of rollback.