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
57
58
59
60
61
use std::collections::HashMap;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use super::{ExtraFileSpec, StringOrBool, deserialize_string_or_bool_opt};
// ---------------------------------------------------------------------------
// UploadConfig (generic HTTP upload)
// ---------------------------------------------------------------------------
#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
#[serde(default)]
pub struct UploadConfig {
/// Human-readable name for this upload config.
pub name: Option<String>,
/// Build IDs filter: only upload artifacts whose `id` is in this list.
pub ids: Option<Vec<String>>,
/// File extension filter: only upload artifacts with these extensions.
pub exts: Option<Vec<String>>,
/// Target URL template (supports template variables like {{ .ProjectName }}, {{ .Version }}).
pub target: String,
/// Username for HTTP basic auth.
/// Resolution order: rendered `username` template → env `UPLOAD_{NAME}_USERNAME`.
/// Set this to a literal value or a `{{ .Env.X }}` template.
pub username: Option<String>,
/// Password for HTTP basic auth (env var template strongly recommended;
/// in-config plaintext leaves the value in `dist/config.yaml` after dry-run).
/// Resolution order: rendered `password` template → env `UPLOAD_{NAME}_SECRET`.
/// Mirrors GoReleaser's `Upload.Password` cascade (added in upstream v2.12).
pub password: Option<String>,
/// HTTP method: PUT or POST (default: PUT).
pub method: Option<String>,
/// Upload mode: "archive" (default) or "binary".
pub mode: Option<String>,
/// Header name for the SHA256 checksum of the artifact.
pub checksum_header: Option<String>,
/// Path to PEM-encoded trusted CA certificates.
pub trusted_certificates: Option<String>,
/// Path to PEM-encoded client X.509 certificate for mTLS.
pub client_x509_cert: Option<String>,
/// Path to PEM-encoded client X.509 key for mTLS.
pub client_x509_key: Option<String>,
/// Include checksums in uploaded artifacts.
pub checksum: Option<bool>,
/// Include signatures in uploaded artifacts.
pub signature: Option<bool>,
/// Include metadata artifacts in uploaded artifacts.
pub meta: Option<bool>,
/// Custom HTTP headers (each value is template-expanded).
pub custom_headers: Option<HashMap<String, String>>,
/// When true, use the artifact name as-is (don't append to target URL).
pub custom_artifact_name: Option<bool>,
/// Extra files to include in uploading.
pub extra_files: Option<Vec<ExtraFileSpec>>,
/// Upload only extra files, skip normal artifacts.
pub extra_files_only: Option<bool>,
/// Skip condition template (if rendered to "true", skip this upload).
#[serde(deserialize_with = "deserialize_string_or_bool_opt", default)]
pub skip: Option<StringOrBool>,
}