Commit
Message
Changed Files (13)
-
modified CHANGELOG.md
diff --git a/CHANGELOG.md b/CHANGELOG.md index cc5c489..3b4e4e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Add multi-format output support (HTML + Gemtext) - Detect non-interactive terminals and fall back to logging - Add builder categories for grouped artifact display on release pages +- Add artifact name/comment for release page display ### 🐛 Bug Fixes -
modified abbaye.schema.json
diff --git a/abbaye.schema.json b/abbaye.schema.json index 7037342..c4a0804 100644 --- a/abbaye.schema.json +++ b/abbaye.schema.json @@ -144,6 +144,13 @@ "null" ] }, + "comment": { + "description": "Optional comment or description shown alongside the artifacts on the\nrelease page. Useful for adding build architecture notes or usage\ninstructions.", + "type": [ + "string", + "null" + ] + }, "depends_on": { "description": "IDs of builders that must complete successfully before this one starts.", "type": "array", @@ -157,6 +164,13 @@ "string", "null" ] + }, + "name": { + "description": "Optional display name for the artifacts this builder produces.\nWhen set, it is shown as a heading on the release page, grouping all\noutputs from this builder entry together.", + "type": [ + "string", + "null" + ] } }, "oneOf": [ -
modified abbaye.toml
diff --git a/abbaye.toml b/abbaye.toml index b61793a..864ae50 100644 --- a/abbaye.toml +++ b/abbaye.toml @@ -127,6 +127,10 @@ tag_prefix = "v" # id — optional stable name for dependency resolution # depends_on — optional list of builder IDs to wait for # category — optional grouping label for the release-page download list +# name — optional display heading shown on the release page above the +# artifact(s) produced by this builder +# comment — optional description or note displayed alongside the artifacts +# (e.g. build architecture, usage instructions) # # The per-type fields (targets, script, …) are flattened into the same table. @@ -134,8 +138,9 @@ tag_prefix = "v" [[builders]] # Builds the Rust project with `cargo build --release`. - category = "Binaries" +name = "Pre-built binaries" +comment = "Built for x86_64 Linux (glibc and musl). Choose the -musl build for maximum portability." type = "cargo" # Target triples for cross-compilation (optional, default: [] = host target). @@ -170,6 +175,8 @@ no_deps = true [[builders]] id = "generate schema" category = "Other" +name = "JSON Schema" +comment = "Auto-generated JSON Schema file for abbaye.toml editor completion." type = "script" # REQUIRED. Shell commands to execute in order. @@ -193,6 +200,8 @@ outputs = ["target/abbaye.schema.json"] [[builders]] id = "archive source" category = "Source" +name = "Source tarball" +comment = "Complete source tree, excluding files matched by .gitignore." type = "archive" # Creates a .tar.gz archive of the source tree, honouring .gitignore rules. @@ -216,6 +225,8 @@ output = "target/abbaye-source.tar.gz" [[builders]] id = "AUR package" category = "Packages" +name = "Arch Linux (AUR)" +comment = "Tarball for downloading from the Arch User Repository." type = "script" script = [ "cargo aur", @@ -223,6 +234,17 @@ script = [ ] outputs = ["target/cargo-aur/abbaye-*-x86_64.tar.gz"] +[[builders]] +id = "Debian package" +category = "Packages" +name = "Debian" +comment = "Debian package for publishing or installing directly." +type = "script" +script = [ + "cargo deb", +] +outputs = ["target/debian/abbaye_*_amd64.deb"] + # ── Markdown Builder (type = "markdown", example — not active here) ───────── # # [[builders]] -
modified src/builders/archive.rs
diff --git a/src/builders/archive.rs b/src/builders/archive.rs index 9269432..2b78739 100644 --- a/src/builders/archive.rs +++ b/src/builders/archive.rs @@ -105,6 +105,8 @@ impl Builder for ArchiveBuilder { name, hash: None, category: None, + group_name: None, + group_comment: None, }]) } } -
modified src/builders/cargo.rs
diff --git a/src/builders/cargo.rs b/src/builders/cargo.rs index 36cc34d..51d1dd0 100644 --- a/src/builders/cargo.rs +++ b/src/builders/cargo.rs @@ -361,6 +361,8 @@ async fn run_cargo_build( name, hash: None, category: None, + group_name: None, + group_comment: None, }); } } @@ -403,6 +405,8 @@ async fn relocate_artifacts( name: artifact.name, hash: artifact.hash, category: artifact.category, + group_name: None, + group_comment: None, }); } Ok(relocated) @@ -528,6 +532,8 @@ impl Builder for CargoDocBuilder { name: "doc".to_owned(), hash: None, category: None, + group_name: None, + group_comment: None, }]) } } -
modified src/builders/markdown.rs
diff --git a/src/builders/markdown.rs b/src/builders/markdown.rs index f32a256..3abe2f2 100644 --- a/src/builders/markdown.rs +++ b/src/builders/markdown.rs @@ -192,6 +192,8 @@ async fn build_directory( name: dir_name_string(&output_dir), hash: None, category: None, + group_name: None, + group_comment: None, }]); } @@ -263,6 +265,8 @@ async fn build_directory( name: dir_name_string(&output_dir), hash: None, category: None, + group_name: None, + group_comment: None, }]) } -
modified src/builders/mod.rs
diff --git a/src/builders/mod.rs b/src/builders/mod.rs index 091233b..6cf57e3 100644 --- a/src/builders/mod.rs +++ b/src/builders/mod.rs @@ -35,6 +35,8 @@ //! | `builder` | [`AnyBuilder`] | Type-tagged union holding the builder's own config (flattened). | //! | `id` | `Option<String>` | Stable name that other builders can reference in `depends_on`. | //! | `depends_on` | `Vec<String>` | IDs of builders that must succeed before this one starts. | +//! | `name` | `Option<String>` | Display name shown as a heading on the release page. | +//! | `comment` | `Option<String>` | Description displayed alongside the artifacts on the release page. | //! //! Example: //! @@ -48,6 +50,8 @@ //! script = ["strip target/release/mybin"] //! outputs = ["target/release/mybin"] //! depends_on = ["compile"] # waits for the cargo builder above +//! name = "Pre-built binary" # optional display heading on the release page +//! comment = "Stripped release binary for Linux x86_64" //! ``` //! //! ### `AnyBuilder` variants @@ -270,6 +274,18 @@ pub struct BuilderEntry { /// together under a shared heading. #[serde(skip_serializing_if = "Option::is_none")] pub category: Option<String>, + + /// Optional display name for the artifacts this builder produces. + /// When set, it is shown as a heading on the release page, grouping all + /// outputs from this builder entry together. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<String>, + + /// Optional comment or description shown alongside the artifacts on the + /// release page. Useful for adding build architecture notes or usage + /// instructions. + #[serde(skip_serializing_if = "Option::is_none")] + pub comment: Option<String>, } impl BuilderEntry { @@ -279,11 +295,14 @@ impl BuilderEntry { } /// Run the inner builder, forwarding the version string and log sender. - /// Each returned [`ArtifactPath`] inherits this entry's `category`. + /// Each returned [`ArtifactPath`] inherits this entry's `category`, + /// `name`, and `comment`. pub async fn build(&self, version: &str, log: LogSender) -> Result<Vec<ArtifactPath>> { let mut artifacts = self.builder.build(version, log).await?; for artifact in &mut artifacts { artifact.category = self.category.clone(); + artifact.group_name = self.name.clone(); + artifact.group_comment = self.comment.clone(); } Ok(artifacts) } @@ -393,6 +412,10 @@ pub struct ArtifactPath { /// Optional category for grouping on the release page, carried over from /// the builder entry that produced this artifact. pub category: Option<String>, + /// Optional display name, propagated from the builder entry. + pub group_name: Option<String>, + /// Optional comment, propagated from the builder entry. + pub group_comment: Option<String>, } /// # Implementing a New Builder -
modified src/builders/script.rs
diff --git a/src/builders/script.rs b/src/builders/script.rs index a75f18b..4502c9c 100644 --- a/src/builders/script.rs +++ b/src/builders/script.rs @@ -147,6 +147,8 @@ impl Builder for ScriptBuilder { name, hash: None, category: None, + group_name: None, + group_comment: None, }); } } @@ -174,6 +176,8 @@ impl Builder for ScriptBuilder { name, hash: None, category: None, + group_name: None, + group_comment: None, }); } } -
modified src/main.rs
diff --git a/src/main.rs b/src/main.rs index 3a4357a..af4e4c2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -351,6 +351,8 @@ async fn main() -> Result<()> { id: None, depends_on: vec![], category: None, + name: None, + comment: None, }], changelog: ChangelogConfig { ..Default::default() -
modified src/site.rs
diff --git a/src/site.rs b/src/site.rs index 6068270..9ccfafe 100644 --- a/src/site.rs +++ b/src/site.rs @@ -63,7 +63,7 @@ impl VersionEntry { } /// Metadata about a single file-type dist artifact, passed to Tera templates. -#[derive(serde::Serialize)] +#[derive(serde::Serialize, Clone)] struct DistFileInfo { /// File name (relative to `dist/`). name: String, @@ -76,6 +76,26 @@ struct DistFileInfo { /// Optional category inherited from the builder that produced this file. #[serde(skip_serializing_if = "Option::is_none")] category: Option<String>, + /// Optional display name inherited from the builder entry. + #[serde(skip_serializing_if = "Option::is_none")] + group_name: Option<String>, + /// Optional comment inherited from the builder entry. + #[serde(skip_serializing_if = "Option::is_none")] + group_comment: Option<String>, +} + +/// A sub-group of dist artifacts sharing the same group name (from the same +/// builder entry). +#[derive(serde::Serialize)] +struct DistSubgroup { + /// Display name for this group, or `None`. + #[serde(skip_serializing_if = "Option::is_none")] + name: Option<String>, + /// Comment for this group, or `None`. + #[serde(skip_serializing_if = "Option::is_none")] + comment: Option<String>, + /// Files in this sub-group. + files: Vec<DistFileInfo>, } /// A group of dist artifacts sharing the same builder category. @@ -83,8 +103,8 @@ struct DistFileInfo { struct DistCategory { /// The shared category, or `None` for builders without one. category: Option<String>, - /// Files in this category. - files: Vec<DistFileInfo>, + /// Sub-groups within this category, each from a different builder entry. + groups: Vec<DistSubgroup>, } /// Build the full website into `config.output_dir` (defaults to `public/`). @@ -184,10 +204,12 @@ pub async fn build_site(config: AbbayeConfig) -> Result<()> { size_human: human_size(size_bytes), sha256, category: artifact.category.clone(), + group_name: artifact.group_name.clone(), + group_comment: artifact.group_comment.clone(), }); } - // Group dist artifacts by category. + // Group dist artifacts by category, then by group name within each category. let mut category_map: std::collections::BTreeMap<Option<String>, Vec<DistFileInfo>> = std::collections::BTreeMap::new(); for info in dist_file_infos { @@ -198,7 +220,27 @@ pub async fn build_site(config: AbbayeConfig) -> Result<()> { } let dist_categories: Vec<DistCategory> = category_map .into_iter() - .map(|(category, files)| DistCategory { category, files }) + .map(|(category, files)| { + let mut subgroup_map: std::collections::BTreeMap< + (Option<String>, Option<String>), + Vec<DistFileInfo>, + > = std::collections::BTreeMap::new(); + for f in files { + subgroup_map + .entry((f.group_name.clone(), f.group_comment.clone())) + .or_default() + .push(f); + } + let groups: Vec<DistSubgroup> = subgroup_map + .into_iter() + .map(|((name, comment), files)| DistSubgroup { + name, + comment, + files, + }) + .collect(); + DistCategory { category, groups } + }) .collect(); let has_dist = !dist_categories.is_empty(); -
modified src/templates/site.css
diff --git a/src/templates/site.css b/src/templates/site.css index 9afd057..705efed 100644 --- a/src/templates/site.css +++ b/src/templates/site.css @@ -673,6 +673,12 @@ aside a:hover { font-family: var(--font-mono); font-size: 0.7rem; } +.dist-comment { + font-size: 0.85rem; + color: var(--text-muted); + margin: 0.3rem 0 0.5rem; + line-height: 1.4; +} /* Changelog section divider and heading */ .changelog-divider { -
modified src/templates/version_index.gmi.j2
diff --git a/src/templates/version_index.gmi.j2 b/src/templates/version_index.gmi.j2 index 8a5d390..d74ddf6 100644 --- a/src/templates/version_index.gmi.j2 +++ b/src/templates/version_index.gmi.j2 @@ -14,14 +14,21 @@ {% endif %} {% endif %}{% if has_dist %} ## Downloads -{% for group in dist_categories %} -{% if group.category %} -### {{ group.category }} +{% for cat in dist_categories %} +{% if cat.category %} +### {{ cat.category }} +{% endif %} +{% for group in cat.groups %} +{% if group.name %} +* {{ group.name }} +{% endif %}{% if group.comment %} +{{ group.comment }} {% endif %} {% for file in group.files %} => dist/{{ file.name }} {{ file.name }} ({{ file.size_human }}) {% endfor %} {% endfor %} +{% endfor %} {% endif %} {{ readme_content | safe }} {% if changelog_content %} -
modified src/templates/version_index.html.j2
diff --git a/src/templates/version_index.html.j2 b/src/templates/version_index.html.j2 index 0571041..4c6354e 100644 --- a/src/templates/version_index.html.j2 +++ b/src/templates/version_index.html.j2 @@ -43,22 +43,30 @@ {% endif %} {% if has_dist %} <h3>Downloads</h3> - {% for group in dist_categories %} - {% if group.category %} - <h4>{{ group.category }}</h4> + {% for cat in dist_categories %} + {% if cat.category %} + <h4>{{ cat.category }}</h4> {% endif %} - <ul> - {% for file in group.files %} - <li> - <a href="dist/{{ file.name }}">⬇ {{ file.name }}</a> - <div class="dist-meta"> - {{ file.size_human }}<br /><code title="SHA-256" - >sha256: {{ file.sha256 }}</code - > - </div> - </li> + {% for group in cat.groups %} + {% if group.name %} + <h5>{{ group.name }}</h5> + {% endif %} + {% if group.comment %} + <p class="dist-comment">{{ group.comment }}</p> + {% endif %} + <ul> + {% for file in group.files %} + <li> + <a href="dist/{{ file.name }}">⬇ {{ file.name }}</a> + <div class="dist-meta"> + {{ file.size_human }}<br /><code title="SHA-256" + >sha256: {{ file.sha256 }}</code + > + </div> + </li> + {% endfor %} + </ul> {% endfor %} - </ul> {% endfor %} {% endif %} </aside>