anodizer_core/config/publishers/aur.rs
1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4use super::super::{StringOrBool, deserialize_string_or_bool_opt};
5use super::CommitAuthorConfig;
6
7// ---------------------------------------------------------------------------
8// AurConfig
9// ---------------------------------------------------------------------------
10
11#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
12#[serde(default, deny_unknown_fields)]
13pub struct AurConfig {
14 /// Override the package name (default: crate name + "-bin").
15 pub name: Option<String>,
16 /// Build IDs filter: only include artifacts whose `id` is in this list.
17 pub ids: Option<Vec<String>>,
18 /// Commit author with optional signing.
19 pub commit_author: Option<CommitAuthorConfig>,
20 /// Custom commit message template. Default: "Update to {{ version }}".
21 pub commit_msg_template: Option<String>,
22 /// Short description of the package for PKGBUILD.
23 pub description: Option<String>,
24 /// Project homepage URL.
25 pub homepage: Option<String>,
26 /// SPDX license identifier (e.g., "MIT", "Apache-2.0").
27 pub license: Option<String>,
28 /// Skip publishing. `"true"` always skips; `"auto"` skips for prereleases.
29 /// Accepts bool or template string.
30 #[serde(deserialize_with = "deserialize_string_or_bool_opt", default)]
31 pub skip_upload: Option<StringOrBool>,
32 /// Custom URL template for download URLs (overrides release URL).
33 pub url_template: Option<String>,
34 /// PKGBUILD maintainer entries (e.g., "Name <email@example.com>").
35 pub maintainers: Option<Vec<String>>,
36 /// Contributors listed in PKGBUILD comments.
37 pub contributors: Option<Vec<String>>,
38 /// Packages this PKGBUILD provides (virtual package names).
39 pub provides: Option<Vec<String>>,
40 /// Packages this PKGBUILD conflicts with.
41 pub conflicts: Option<Vec<String>>,
42 /// Runtime dependencies required by this package.
43 pub depends: Option<Vec<String>>,
44 /// Optional dependencies with descriptions (e.g., "fzf: fuzzy finder support").
45 pub optdepends: Option<Vec<String>>,
46 /// List of config files to preserve on upgrade (relative to `/`).
47 pub backup: Option<Vec<String>>,
48 /// Package release number (default: "1").
49 pub rel: Option<String>,
50 /// Custom PKGBUILD `package()` function body.
51 pub package: Option<String>,
52 /// AUR SSH git URL (e.g., `ssh://aur@aur.archlinux.org/<package>.git`).
53 pub git_url: Option<String>,
54 /// Custom SSH command for git operations.
55 pub git_ssh_command: Option<String>,
56 /// Path to SSH private key file.
57 pub private_key: Option<String>,
58 /// Subdirectory in the git repo for committed files.
59 pub directory: Option<String>,
60 /// Skip this AUR config. Accepts bool or template string
61 /// (e.g. `"{{ if .IsSnapshot }}true{{ endif }}"` for conditional skip).
62 #[serde(deserialize_with = "deserialize_string_or_bool_opt", default)]
63 pub skip: Option<StringOrBool>,
64 /// Content for a .install file (post-install/pre-remove scripts).
65 pub install: Option<String>,
66 // The PKGBUILD `url=` line resolves through `homepage:` →
67 // crate metadata `homepage` → derived
68 // `https://github.com/{release.github.owner}/{release.github.name}`.
69 /// Packages this PKGBUILD replaces (for upgrade paths from old package names).
70 pub replaces: Option<Vec<String>>,
71 /// amd64 microarchitecture variant filter (e.g. "v1", "v2", "v3", "v4").
72 /// Only artifacts matching this variant are included. Default: "v1".
73 pub amd64_variant: Option<String>,
74}