Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 47 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 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<HashMap<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 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 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 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,
}
Expand description

deny_unknown_fields rejects typos and unknown config fields at parse time, matching GoReleaser’s yaml.UnmarshalStrict.

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.

§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 (matches GoReleaser): 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<HashMap<String, String>>

Custom template variables accessible as {{ .Var.key }} in templates. Provides a way to define reusable values, especially useful with config includes.

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

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

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

GoReleaser Pro 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.

§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 — matching GoReleaser Project.Retry).

§mcp: McpConfig

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

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(&self) -> Option<&str>

Project homepage from metadata.homepage (Pro default source for publishers).

Source

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

Project license from metadata.license.

Source

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

Project description from metadata.description.

Source

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

Project maintainers from metadata.maintainers.

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

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