pub struct Config {Show 58 fields
pub version: Option<u32>,
pub project_name: String,
pub dist: PathBuf,
pub includes: Option<Vec<IncludeSpec>>,
pub env_files: Option<EnvFilesConfig>,
pub defaults: Option<Defaults>,
pub before: Option<HooksConfig>,
pub after: Option<HooksConfig>,
pub on_error: Option<HooksConfig>,
pub before_publish: Option<HooksConfig>,
pub crates: Vec<CrateConfig>,
pub changelog: Option<ChangelogConfig>,
pub signs: Vec<SignConfig>,
pub binary_signs: Vec<SignConfig>,
pub docker_signs: Option<Vec<DockerSignConfig>>,
pub upx: Vec<UpxConfig>,
pub snapshot: Option<SnapshotConfig>,
pub nightly: Option<NightlyConfig>,
pub announce: Option<AnnounceConfig>,
pub report_sizes: Option<bool>,
pub env: Option<Vec<String>>,
pub variables: Option<BTreeMap<String, String>>,
pub publishers: Option<Vec<PublisherConfig>>,
pub dockerhub: Option<Vec<DockerHubConfig>>,
pub artifactories: Option<Vec<ArtifactoryConfig>>,
pub cloudsmiths: Option<Vec<CloudSmithConfig>>,
pub homebrew_casks: Option<Vec<HomebrewCaskConfig>>,
pub version_files: Option<Vec<String>>,
pub tag: Option<TagConfig>,
pub git: Option<GitConfig>,
pub partial: Option<PartialConfig>,
pub workspaces: Option<Vec<WorkspaceConfig>>,
pub source: Option<SourceConfig>,
pub sboms: Vec<SbomConfig>,
pub attestations: Option<AttestationConfig>,
pub release: Option<ReleaseConfig>,
pub github_urls: Option<GitHubUrlsConfig>,
pub gitlab_urls: Option<GitLabUrlsConfig>,
pub gitea_urls: Option<GiteaUrlsConfig>,
pub force_token: Option<ForceTokenKind>,
pub notarize: Option<NotarizeConfig>,
pub metadata: Option<MetadataConfig>,
pub template_files: Option<Vec<TemplateFileConfig>>,
pub monorepo: Option<MonorepoConfig>,
pub makeselfs: Vec<MakeselfConfig>,
pub appimages: Vec<AppImageConfig>,
pub verify_release: VerifyReleaseConfig,
pub preflight: PreflightConfig,
pub srpms: Option<SrpmConfig>,
pub milestones: Option<Vec<MilestoneConfig>>,
pub uploads: Option<Vec<UploadConfig>>,
pub aur_sources: Option<Vec<AurSourceConfig>>,
pub retry: Option<RetryConfig>,
pub mcp: McpConfig,
pub schemastore: SchemastoreConfig,
pub npms: Option<Vec<NpmConfig>>,
pub gemfury: Option<Vec<GemFuryConfig>>,
pub derived_metadata: BTreeMap<String, MetadataConfig>,
}Expand description
deny_unknown_fields rejects typos and unknown config
fields at parse time (strict YAML unmarshalling).
Fields§
§version: Option<u32>Schema version. Currently supports 1 (implicit default) and 2.
project_name: StringHuman-readable project name used in templates and release titles.
dist: PathBufOutput directory for build artifacts (default: ./dist).
includes: Option<Vec<IncludeSpec>>Additional config files to merge into this config.
Supports plain string paths, from_file: for structured file paths,
and from_url: for fetching configs from URLs with optional headers.
env_files: Option<EnvFilesConfig>Environment file configuration. Accepts either:
- A list of
.envfile paths:[".env", ".release.env"] - A struct with token file paths:
{ github_token: "~/.config/goreleaser/github_token" }
defaults: Option<Defaults>Default values applied to all crates unless overridden.
before: Option<HooksConfig>Hooks run before the release pipeline starts.
after: Option<HooksConfig>Hooks run after the release pipeline completes.
on_error: Option<HooksConfig>Hooks run when the release pipeline fails at ANY stage (build,
sign, publish, …), after the failure policy (rollback / hold)
has executed, so {{ .RolledBack }} reflects the taken path.
Notification / cleanup hooks: a hook’s own failure is logged as a
warning and never masks the pipeline error. The failure context is
exposed both as template vars ({{ .Error }}, {{ .RolledBack }})
and as ANODIZER_* env vars (ANODIZER_ERROR,
ANODIZER_ROLLED_BACK, ANODIZER_VERSION, ANODIZER_TAG) so
hooks can consume the error text without shell interpolation.
on_error:
hooks:
- cmd: ./notify-release-failed.shbefore_publish: Option<HooksConfig>Hooks run after build/archive/sign/sbom/checksum complete but immediately before the publish phase dispatches any publisher.
Use cases: smoke-test artifacts against the staged dist tree, run external validators (antivirus, vulnerability scanners), stage external state, or abort the release before any publisher writes to a registry.
A non-zero exit code from any hook aborts the release before
publish runs. Hooks fire in declared order. Use --skip=before-publish
to bypass.
crates: Vec<CrateConfig>List of crates in this project.
changelog: Option<ChangelogConfig>Changelog generation configuration.
signs: Vec<SignConfig>Signing configurations for binaries, archives, and checksums.
binary_signs: Vec<SignConfig>Binary-specific signing configs (same shape as signs but only for
binary artifacts). The artifacts field on each entry is constrained
at parse time to binary / none (or omitted) — a broader filter on
binary_signs would silently match nothing because the loop only
iterates Binary artifacts. Constraint lives in deserialize_binary_signs.
docker_signs: Option<Vec<DockerSignConfig>>Docker image signing configurations.
upx: Vec<UpxConfig>UPX binary compression configurations.
snapshot: Option<SnapshotConfig>Snapshot release configuration (local/non-tag builds).
nightly: Option<NightlyConfig>Nightly release configuration.
announce: Option<AnnounceConfig>Announcement configuration (Slack, Discord, email, etc.).
report_sizes: Option<bool>When true, log artifact file sizes after building.
env: Option<Vec<String>>Environment variables available to all template expressions.
List of KEY=VALUE strings:
env: ["MY_VAR=hello", "DEPLOY_ENV=staging"]. Order is preserved so
chained env applications (sign + sbom + notarize) see entries in
declared order. Values are rendered through the template engine before
being set, so expressions like {{ Tag }} or {{ Date }} are
expanded.
variables: Option<BTreeMap<String, String>>Custom template variables accessible as {{ Var.<key> }} in templates.
Provides a way to define reusable values, especially useful with config includes.
Stored as a BTreeMap so rendering iterates in deterministic
(sorted) key order — without this guarantee, a value that references
another variable (b: "{{ Var.a }}_v2") could render before its
dependency on a different process / host. The current resolver is
single-pass (one render per value), so cross-variable references
only resolve when the referenced key sorts earlier.
publishers: Option<Vec<PublisherConfig>>Generic artifact publisher configurations.
dockerhub: Option<Vec<DockerHubConfig>>DockerHub description sync configurations.
artifactories: Option<Vec<ArtifactoryConfig>>Artifactory upload configurations.
cloudsmiths: Option<Vec<CloudSmithConfig>>CloudSmith publisher configurations.
homebrew_casks: Option<Vec<HomebrewCaskConfig>>Top-level Homebrew Cask configurations.
homebrew_casks is a top-level array with its own
repository, commit_author, directory, skip_upload, hooks, dependencies,
conflicts, completions, manpages, structured uninstall/zap, etc.
version_files: Option<Vec<String>>Repo-committed files that embed the release version outside
Cargo.toml (e.g. a Helm Chart.yaml, an install doc, a README
badge), given as repo-root-relative path strings. At tag time each
listed file has its occurrences of the old version rewritten to the new
version — both the bare (0.1.0) and v-prefixed (v0.1.0) forms,
word-boundary anchored — and is staged into the same bump commit as
Cargo.toml / Cargo.lock, so these files never drift from the tag.
version_files:
- charts/cfgd/Chart.yaml
- docs/installation.mdtag: Option<TagConfig>Automatic semantic version tagging configuration.
git: Option<GitConfig>Git-level tag discovery and sorting settings.
partial: Option<PartialConfig>Partial/split build configuration for fan-out CI pipelines.
workspaces: Option<Vec<WorkspaceConfig>>Independent workspace roots in a monorepo.
source: Option<SourceConfig>Source archive configuration.
sboms: Vec<SbomConfig>Software bill of materials (SBOM) generation configurations.
attestations: Option<AttestationConfig>SLSA build-provenance / attestation configuration for binaries and
archives. In the default subjects mode, anodizer writes a subjects
manifest for actions/attest-build-provenance; in emit mode it
generates and signs a self-contained in-toto SLSA provenance statement.
When omitted (or enabled: false), the attestation stage is a no-op.
release: Option<ReleaseConfig>GitHub release configuration shared by all crates.
github_urls: Option<GitHubUrlsConfig>Custom GitHub API/upload/download URLs for GitHub Enterprise installations.
gitlab_urls: Option<GitLabUrlsConfig>Custom GitLab API/download URLs for self-hosted GitLab installations.
gitea_urls: Option<GiteaUrlsConfig>Custom Gitea API/download URLs for self-hosted Gitea installations.
force_token: Option<ForceTokenKind>Force a specific token type for authentication. When set, overrides automatic token detection from environment variables.
notarize: Option<NotarizeConfig>macOS code signing and notarization configuration.
metadata: Option<MetadataConfig>Project metadata configuration (applied to metadata.json output files).
template_files: Option<Vec<TemplateFileConfig>>Template files to render and include as release artifacts. File contents are processed through the template engine.
monorepo: Option<MonorepoConfig>Monorepo configuration. When configured, tag discovery filters by tag_prefix and the working directory is scoped to dir.
makeselfs: Vec<MakeselfConfig>Makeself self-extracting archive configurations.
appimages: Vec<AppImageConfig>AppImage configurations. Each entry bundles a built Linux binary plus
its desktop integration into a single self-contained .AppImage via
linuxdeploy.
verify_release: VerifyReleaseConfigOpt-in post-release verification gate. Runs LAST (after the release is
created and every publisher has run) and REPORTS post-publish defects —
missing assets, failed install smoke-tests, glibc-ceiling violations.
Because it runs after the irreversible publish, a failure exits
non-zero to flag CI but never undoes the release. Off unless
verify_release.enabled: true.
preflight: PreflightConfigPre-publish preflight tuning. preflight.strict: true promotes
indeterminate probe outcomes (5xx / rate-limit / network failure /
undeterminable permissions) from warnings to hard blockers. The
probes themselves always run read-only before any publisher mutates
a registry; the default (lenient) behavior needs no config.
srpms: Option<SrpmConfig>Source RPM configuration. Renamed from srpm: (singular) for spelling
parity with Defaults.srpms and the rest of the plural-name packaging
fields. The srpm: spelling is still accepted via serde alias for
back-compat.
milestones: Option<Vec<MilestoneConfig>>Milestone closing configurations.
uploads: Option<Vec<UploadConfig>>Generic HTTP upload configurations.
aur_sources: Option<Vec<AurSourceConfig>>AUR source package publishing configurations (source-only PKGBUILD, not -bin).
retry: Option<RetryConfig>Top-level retry configuration applied to network-bound operations
(announcers, git providers, HTTP uploads, docker pipes). When omitted,
RetryConfig::default() is used (10 attempts, 10s base, 5m cap —
the project-level retry policy).
mcp: McpConfigMCP (Model Context Protocol) server registry publishing
configuration. When name is empty (the default), the publisher is
skipped. The mcp: publisher block.
schemastore: SchemastoreConfigSchemaStore publisher. Registers the project’s JSON Schema(s) on
SchemaStore at release time. When schemas is empty (the default),
the publisher is skipped. The schemastore: publisher block.
npms: Option<Vec<NpmConfig>>NPM package registry publishing configurations. One entry per
published package. In the default optional-deps mode anodizer emits
npm’s native per-platform packages (biome / git-cliff pattern); in
postinstall mode it emits a download shim (the npms:
parity).
gemfury: Option<Vec<GemFuryConfig>>GemFury (fury.io) deb/rpm/apk publishing configurations. Mirrors
The gemfury: block. The legacy spelling
furies: is accepted via serde alias; a one-time deprecation
warning is emitted by warn_on_legacy_furies_alias.
derived_metadata: BTreeMap<String, MetadataConfig>Per-crate metadata derived from each crate’s Cargo.toml [package]
table (description / license / homepage / authors). Populated at
config-load time by Config::populate_derived_metadata, keyed by
crate name. NOT a user-facing YAML field — it backs the
crate-aware meta_*_for accessors so a plain Rust project gets its
publisher metadata without repeating it in a top-level metadata:
block. A hand-written metadata: field and per-publisher overrides
still win.
Implementations§
Source§impl Config
impl Config
Sourcepub fn crate_universe(&self) -> Vec<&CrateConfig>
pub fn crate_universe(&self) -> Vec<&CrateConfig>
The full crate universe: top-level crates plus every
workspaces[].crates entry, deduplicated by name (first-seen wins,
so a top-level entry shadows a same-named workspace entry).
Single source of the read-only “all crates that can carry per-crate
config” walk. Publisher registration, required/retain gate
collapsing, per-crate dispatch, requirement derivation,
--crate/--all selection, tool-need detection, artifact guards,
and default-naming decisions must all resolve through this walker so
a workspace-only crate carrying a publisher block is either visible
everywhere or nowhere — a consumer iterating config.crates
directly silently excludes workspace crates and hides their
publishes. Only two shapes may keep a raw chained walk: mutation
passes (&mut access — this walker hands out shared borrows) and
validation/diagnostics that must see every entry as written,
including the shadowed duplicates this walker dedups away.
Sourcepub fn find_crate(&self, name: &str) -> Option<&CrateConfig>
pub fn find_crate(&self, name: &str) -> Option<&CrateConfig>
Borrow a crate by name from Self::crate_universe (top-level wins
on a name collision). The single by-name lookup every consumer must
use — a config.crates.iter().find(...) cannot see workspace-only
crates.
Sourcepub fn crate_universe_collision_warnings(&self) -> Vec<String>
pub fn crate_universe_collision_warnings(&self) -> Vec<String>
Operator-facing warnings for crate-name collisions in the universe
where the colliding entries disagree on path — almost certainly a
config mistake (two distinct crates sharing a name). The legitimate
duplicate (the same crate referenced from both top-level and a
workspace) dedups silently. Emitted by the publish stage at entry so
the warning appears once per run rather than once per universe walk.
Sourcepub fn monorepo_tag_prefix(&self) -> Option<&str>
pub fn monorepo_tag_prefix(&self) -> Option<&str>
Return the monorepo tag prefix, if configured.
Shorthand for config.monorepo.as_ref().and_then(|m| m.tag_prefix.as_deref()).
Sourcepub fn monorepo_dir(&self) -> Option<&str>
pub fn monorepo_dir(&self) -> Option<&str>
Return the monorepo working directory, if configured.
Shorthand for config.monorepo.as_ref().and_then(|m| m.dir.as_deref()).
Sourcepub fn effective_default_targets(&self) -> Vec<String>
pub fn effective_default_targets(&self) -> Vec<String>
The build targets compiled when neither a per-build targets nor
defaults.targets is set: defaults.targets (when non-empty), else the
canonical DEFAULT_TARGETS. Single source of truth for the target-set
fallback — every target enumeration MUST resolve through this rather than
re-deriving the fallback, so they never diverge.
Sourcepub fn default_cross_strategy(&self) -> CrossStrategy
pub fn default_cross_strategy(&self) -> CrossStrategy
The cross-compilation strategy applied to a crate that does not set its
own cross: — defaults.cross, else Auto. SSOT for the per-crate
strategy fallback.
Sourcepub fn primary_crate_name(&self) -> Option<&str>
pub fn primary_crate_name(&self) -> Option<&str>
Name of the primary crate (first declared crates: entry, else the
first workspace crate). Used as the metadata-derivation source and
crate-name fallback for project-level publishers (e.g. top-level
homebrew_casks:, npms:) that are not bound to a single crate.
Sourcepub fn meta_homepage_project(&self) -> Option<&str>
pub fn meta_homepage_project(&self) -> Option<&str>
Project homepage: top-level metadata.homepage wins, else the primary
crate’s Cargo.toml-derived homepage. For project-level publishers
(top-level casks) with no owning crate.
Sourcepub fn meta_description_project(&self) -> Option<&str>
pub fn meta_description_project(&self) -> Option<&str>
Project description: top-level metadata.description wins, else the
primary crate’s Cargo.toml-derived description.
Sourcepub fn meta_repository_project(&self) -> Option<&str>
pub fn meta_repository_project(&self) -> Option<&str>
Project source-repository URL: top-level metadata.repository wins, else
the primary crate’s Cargo.toml-derived repository. Backs the
{{ Metadata.Repository }} template var.
Sourcepub fn meta_license_project(&self) -> Option<&str>
pub fn meta_license_project(&self) -> Option<&str>
Project license: top-level metadata.license wins, else the primary
crate’s Cargo.toml-derived license. For the {{ Metadata.License }}
template var and project-level publishers with no owning crate.
Sourcepub fn meta_documentation_project(&self) -> Option<&str>
pub fn meta_documentation_project(&self) -> Option<&str>
Project documentation URL: top-level metadata.documentation wins, else
the primary crate’s Cargo.toml-derived documentation URL.
Sourcepub fn meta_homepage(&self) -> Option<&str>
pub fn meta_homepage(&self) -> Option<&str>
Project homepage from metadata.homepage (top-level YAML only).
Sourcepub fn meta_license(&self) -> Option<&str>
pub fn meta_license(&self) -> Option<&str>
Project license from metadata.license (top-level YAML only).
Sourcepub fn meta_repository(&self) -> Option<&str>
pub fn meta_repository(&self) -> Option<&str>
Project source-repository URL from metadata.repository (top-level YAML only).
Sourcepub fn meta_description(&self) -> Option<&str>
pub fn meta_description(&self) -> Option<&str>
Project description from metadata.description (top-level YAML only).
Sourcepub fn meta_documentation(&self) -> Option<&str>
pub fn meta_documentation(&self) -> Option<&str>
Project documentation URL from metadata.documentation (top-level YAML only).
Sourcepub fn meta_maintainers(&self) -> &[String]
pub fn meta_maintainers(&self) -> &[String]
Project maintainers from metadata.maintainers (top-level YAML only).
Sourcepub fn meta_first_maintainer(&self) -> Option<&str>
pub fn meta_first_maintainer(&self) -> Option<&str>
First maintainer as “Name
Sourcepub fn meta_homepage_for(&self, crate_name: &str) -> Option<&str>
pub fn meta_homepage_for(&self, crate_name: &str) -> Option<&str>
Homepage for crate_name: top-level metadata.homepage wins, else the
value derived from the crate’s Cargo.toml [package].
Sourcepub fn meta_license_for(&self, crate_name: &str) -> Option<&str>
pub fn meta_license_for(&self, crate_name: &str) -> Option<&str>
License for crate_name: top-level metadata.license wins, else the
crate’s Cargo.toml [package].license (never synthesised from
license-file).
Sourcepub fn meta_repository_for(&self, crate_name: &str) -> Option<&str>
pub fn meta_repository_for(&self, crate_name: &str) -> Option<&str>
Source-repository URL for crate_name: top-level metadata.repository
wins, else the crate’s Cargo.toml [package].repository. Feeds the npm
package.json repository field so npm provenance validation (which
matches it against the OIDC-claimed repository) passes without requiring
the operator to restate the URL in the publisher config.
Sourcepub fn meta_description_for(&self, crate_name: &str) -> Option<&str>
pub fn meta_description_for(&self, crate_name: &str) -> Option<&str>
Description for crate_name: top-level metadata.description wins, else
the crate’s Cargo.toml [package].description.
Sourcepub fn meta_documentation_for(&self, crate_name: &str) -> Option<&str>
pub fn meta_documentation_for(&self, crate_name: &str) -> Option<&str>
Documentation URL for crate_name: top-level metadata.documentation
wins, else the crate’s Cargo.toml [package].documentation.
Sourcepub fn meta_maintainers_for(&self, crate_name: &str) -> &[String]
pub fn meta_maintainers_for(&self, crate_name: &str) -> &[String]
Maintainers for crate_name: top-level metadata.maintainers wins
(when non-empty), else the crate’s Cargo.toml [package].authors.
Sourcepub fn meta_first_maintainer_for(&self, crate_name: &str) -> Option<&str>
pub fn meta_first_maintainer_for(&self, crate_name: &str) -> Option<&str>
First maintainer for crate_name as “Name
Sourcepub fn meta_vendor_for(&self, crate_name: &str) -> Option<String>
pub fn meta_vendor_for(&self, crate_name: &str) -> Option<String>
Vendor / distributing-entity name for crate_name: the first
maintainer with any <email> suffix stripped (e.g.
"Ada Lovelace <ada@x>" → "Ada Lovelace"). None when no maintainer
is derivable or the result is empty, so a Vendor field is never emitted
blank. Reused by the rpm/deb Vendor and the OCI image vendor label.
Sourcepub fn populate_derived_metadata(&mut self, base_dir: &Path)
pub fn populate_derived_metadata(&mut self, base_dir: &Path)
Populate Config::derived_metadata by reading each crate’s
Cargo.toml [package] table (description / license / homepage /
authors), so publishers resolve a plain Rust project’s metadata without
requiring a top-level metadata: YAML block.
Covers every crate the config knows about: top-level crates: plus
every workspaces[].crates[], so single-crate, workspace-lockstep, and
per-crate configs all populate. Each crate is read from
<crate.path>/Cargo.toml relative to base_dir (the directory the
config was loaded from / the monorepo working directory).
Idempotent and non-destructive: only fills entries; existing
derived_metadata keys are overwritten with a fresh read. Crates whose
Cargo.toml is missing or supplies nothing contribute an all-None
entry (harmless — the accessors treat it as “no value”).
Sourcepub fn has_gpg_sign_configured(&self) -> bool
pub fn has_gpg_sign_configured(&self) -> bool
true when any top-level / workspace signs: or binary_signs:
entry will invoke gpg (via SignConfig::is_gpg()).
Used by preflight to decide whether to probe
gpg --faked-system-time support. docker_signs: is excluded
because that driver only ever invokes cosign.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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 Config
impl JsonSchema for Config
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 more