1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use super::{ExtraFileSpec, StringOrBool, TemplatedExtraFile, deserialize_string_or_bool_opt};
// ---------------------------------------------------------------------------
// PublisherConfig
// ---------------------------------------------------------------------------
#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
#[serde(default, deny_unknown_fields)]
pub struct PublisherConfig {
/// Human-readable name for this publisher (used in logs).
pub name: Option<String>,
/// Command to invoke for publishing.
pub cmd: String,
/// Arguments passed to the publish command (supports templates).
pub args: Option<Vec<String>>,
/// Build IDs filter: only publish artifacts from builds whose `id` is in this list.
pub ids: Option<Vec<String>>,
/// Artifact type filter: only publish artifacts of these types (e.g., "archive", "binary").
pub artifact_types: Option<Vec<String>>,
/// Environment variables passed to the publish command.
#[serde(default)]
pub env: Option<Vec<String>>,
/// Working directory for the publisher command.
pub dir: Option<String>,
/// Template-conditional skip: if rendered result is `"true"`, skip this publisher.
/// Accepts bool or template string (e.g. `"{{ if .IsSnapshot }}true{{ endif }}"`).
/// Accepts the legacy `disable:` spelling via serde alias for back-compat.
#[serde(
alias = "disable",
deserialize_with = "deserialize_string_or_bool_opt",
default
)]
pub skip: Option<StringOrBool>,
/// Include checksums in published artifacts.
pub checksum: Option<bool>,
/// Include signatures in published artifacts.
pub signature: Option<bool>,
/// Include `dist/metadata.json` in published artifacts. The sibling
/// `dist/artifacts.json` manifest is never published.
pub meta: Option<bool>,
/// Extra files to include in publishing (glob patterns with optional name override).
pub extra_files: Option<Vec<ExtraFileSpec>>,
/// Extra files whose contents are rendered through the template engine before publishing.
/// Unlike `extra_files` which copy as-is, template variables like `{{ Tag }}` are expanded.
pub templated_extra_files: Option<Vec<TemplatedExtraFile>>,
/// Template-conditional gate: when the rendered result is falsy
/// (`"false"` / `"0"` / `"no"` / empty), the publisher is skipped.
/// Render failure hard-errors. The
/// `customization/publishers/` `if:` field. Distinct from `skip:`
/// (which expresses "always skip") and provides config-import parity.
#[serde(rename = "if")]
pub if_condition: Option<String>,
}