anodizer_core/config/publisher.rs
1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4use super::{ExtraFileSpec, StringOrBool, TemplatedExtraFile, deserialize_string_or_bool_opt};
5
6// ---------------------------------------------------------------------------
7// PublisherConfig
8// ---------------------------------------------------------------------------
9
10#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
11#[serde(default)]
12pub struct PublisherConfig {
13 /// Human-readable name for this publisher (used in logs).
14 pub name: Option<String>,
15 /// Command to invoke for publishing.
16 pub cmd: String,
17 /// Arguments passed to the publish command (supports templates).
18 pub args: Option<Vec<String>>,
19 /// Build IDs filter: only publish artifacts from builds whose `id` is in this list.
20 pub ids: Option<Vec<String>>,
21 /// Artifact type filter: only publish artifacts of these types (e.g., "archive", "binary").
22 pub artifact_types: Option<Vec<String>>,
23 /// Environment variables passed to the publish command.
24 #[serde(default)]
25 pub env: Option<Vec<String>>,
26 /// Working directory for the publisher command.
27 pub dir: Option<String>,
28 /// Template-conditional skip: if rendered result is `"true"`, skip this publisher.
29 /// Accepts bool or template string (e.g. `"{{ if .IsSnapshot }}true{{ endif }}"`).
30 #[serde(deserialize_with = "deserialize_string_or_bool_opt", default)]
31 pub skip: Option<StringOrBool>,
32 /// Include checksums in published artifacts.
33 pub checksum: Option<bool>,
34 /// Include signatures in published artifacts.
35 pub signature: Option<bool>,
36 /// Include metadata artifacts in published artifacts.
37 pub meta: Option<bool>,
38 /// Extra files to include in publishing (glob patterns with optional name override).
39 pub extra_files: Option<Vec<ExtraFileSpec>>,
40 /// Extra files whose contents are rendered through the template engine before publishing.
41 /// Unlike `extra_files` which copy as-is, template variables like `{{ .Tag }}` are expanded.
42 /// GoReleaser Pro feature.
43 pub templated_extra_files: Option<Vec<TemplatedExtraFile>>,
44}