anodizer_core/config/snapshot_nightly.rs
1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4use super::{CommitAuthorConfig, ContentSource};
5
6// ---------------------------------------------------------------------------
7// SnapshotConfig
8// ---------------------------------------------------------------------------
9
10#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
11pub struct SnapshotConfig {
12 /// Version string template for snapshot builds (e.g., "{{ .Commit }}-SNAPSHOT").
13 /// F3: accepts the deprecated `name_template:` GR alias (renamed to
14 /// `version_template` upstream). GR ref:
15 /// `internal/pipe/snapshot/snapshot.go:25-28` —
16 /// `if NameTemplate != "" { VersionTemplate = NameTemplate }`.
17 /// A deprecation warning is emitted at config-load time when the alias
18 /// is hit (see `apply_snapshot_legacy_aliases`).
19 #[serde(alias = "name_template")]
20 pub version_template: String,
21}
22
23// ---------------------------------------------------------------------------
24// NightlyConfig
25// ---------------------------------------------------------------------------
26
27#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
28#[serde(default)]
29pub struct NightlyConfig {
30 /// Template for the release name. Default: "{{ .ProjectName }}-nightly"
31 pub name_template: Option<String>,
32 /// Tag name used for the nightly release. Default: "nightly".
33 pub tag_name: Option<String>,
34}
35
36// ---------------------------------------------------------------------------
37// MetadataConfig
38// ---------------------------------------------------------------------------
39
40#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
41#[serde(default)]
42pub struct MetadataConfig {
43 /// Human-readable project description (exposed as `{{ .Metadata.Description }}`).
44 pub description: Option<String>,
45 /// Project homepage URL (exposed as `{{ .Metadata.Homepage }}`).
46 pub homepage: Option<String>,
47 /// Project license identifier, e.g. "MIT" or "Apache-2.0" (exposed as `{{ .Metadata.License }}`).
48 pub license: Option<String>,
49 /// List of project maintainers (exposed as `{{ .Metadata.Maintainers }}`).
50 pub maintainers: Option<Vec<String>>,
51 /// Global modification timestamp for metadata output files (metadata.json and artifacts.json).
52 /// Template string (e.g. "{{ .CommitTimestamp }}") or unix timestamp.
53 /// When set, rendered late in the pipeline and applied as file mtime.
54 /// Exposed as `{{ .Metadata.ModTimestamp }}`.
55 pub mod_timestamp: Option<String>,
56 /// Long-form project description (GoReleaser Pro v2.1+). Supports inline
57 /// string, `from_file`, or `from_url`. Exposed as `{{ .Metadata.FullDescription }}`.
58 /// FromUrl is resolved lazily (requires the release stage); FromFile is resolved
59 /// at context-populate time with template-rendered path.
60 pub full_description: Option<ContentSource>,
61 /// Commit author identity for Pro commit workflows (GoReleaser Pro v2.12+).
62 /// Reuses the shared `CommitAuthorConfig` (name + email + optional signing).
63 /// Exposed as `{{ .Metadata.CommitAuthor.Name }}` / `{{ .Metadata.CommitAuthor.Email }}`.
64 pub commit_author: Option<CommitAuthorConfig>,
65}