Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 56 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 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 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: String

Human-readable project name used in templates and release titles.

§dist: PathBuf

Output 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 .env file 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.

§before_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.md
§tag: 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: VerifyReleaseConfig

Opt-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.

§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: McpConfig

MCP (Model Context Protocol) server registry publishing configuration. When name is empty (the default), the publisher is skipped. The mcp: publisher block.

§schemastore: SchemastoreConfig

SchemaStore 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

Source

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()).

Source

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()).

Source

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.

Source

pub fn meta_description_project(&self) -> Option<&str>

Project description: top-level metadata.description wins, else the primary crate’s Cargo.toml-derived description.

Source

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.

Source

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.

Source

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.

Source

pub fn meta_homepage(&self) -> Option<&str>

Project homepage from metadata.homepage (top-level YAML only).

Source

pub fn meta_license(&self) -> Option<&str>

Project license from metadata.license (top-level YAML only).

Source

pub fn meta_repository(&self) -> Option<&str>

Project source-repository URL from metadata.repository (top-level YAML only).

Source

pub fn meta_description(&self) -> Option<&str>

Project description from metadata.description (top-level YAML only).

Source

pub fn meta_documentation(&self) -> Option<&str>

Project documentation URL from metadata.documentation (top-level YAML only).

Source

pub fn meta_maintainers(&self) -> &[String]

Project maintainers from metadata.maintainers (top-level YAML only).

Source

pub fn meta_first_maintainer(&self) -> Option<&str>

First maintainer as “Name ” or just “Name” (publisher convention). Returns None when no maintainers are configured.

Source

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].

Source

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).

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn meta_first_maintainer_for(&self, crate_name: &str) -> Option<&str>

First maintainer for crate_name as “Name ” or just “Name”.

Source

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.

Source

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”).

Source

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 Clone for Config

Source§

fn clone(&self) -> Config

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 Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Config
where Config: Default,

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 Config

Source§

fn schema_name() -> String

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 is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for Config

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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