Abbaye

at 22e2605

# ── Abbaye Configuration ──────────────────────────────────────────────────────
# This file configures the Abbaye release-page generator.
# See https://opencode.ai for details.
#
# All paths are relative to the directory containing this file.
# All fields are optional unless marked "REQUIRED".

# JSON Schema reference for editor autocompletion (optional).
"$schema" = "./abbaye.schema.json"

# ── Site Metadata ────────────────────────────────────────────────────────────

[site]
# REQUIRED. Display name of the project, used in page titles and headings.
name = "Abbaye"

# Canonical base URL of the published site (optional).
# When set, the Atom feed uses absolute links and proper entry IDs.
# Trailing slashes are stripped automatically.
base_url = "https://vit.am/~ololduck/abbaye"

# URL of the project's repository (optional).
# When set, a link is shown on every release page.
repo_url = "https://git.sr.ht/~ololduck/abbaye"

# Output directory for generated files (optional, default: "public").
# output_dir = "public"

# Path to the README file rendered on each version page (optional, default: "README.md").
# readme = "README.md"

# Language code for the generated HTML <html lang="..."> attribute (optional, default: "en").
# lang = "en"

# Fediverse creator handle for social meta tags (optional).
# Don't forget the leading '@'.
fediverse_creator = "@ololduck@vit.am"

# Output formats to generate (optional, default: ["html"]).
# Set to ["html", "gemtext"] to also produce Gemini text pages.
formats = ["html", "gemtext"]

# ── OpenGraph (optional section) ────────────────────────────────────────────

[site.opengraph]
# REQUIRED. URL of the website's image used in social-media preview cards.
image = "latest/logo-wordmark.svg"

# Alt text for the image (optional).
image_alt = "Abbaye logo"

# Author of the website, shown on release-notes pages (optional).
author = "Ololduck <ololduck@vit.am>"

# OpenGraph type (optional, default: "website" for index, "article" for release pages).
# type = "website"

# Canonical URL for og:url (optional, falls back to site.base_url).
# url = "https://vit.am/~ololduck/abbaye"

# ── Git Repository Web UI (optional section) ────────────────────────────────
# When present, abbaye generates browsable HTML at <output>/repository/
# and a clonable bare repository at <output>/repository.git/.

[git_ui]
# Default branch displayed when opening the repository page (optional, default: "main").
# default_branch = "main"

# Maximum number of commits shown on the log page (optional, default: 200).
# max_commits = 200

# Path to the git repository to read (optional, default: ".").
# repo_path = "."

# Explicit clone URL displayed in the UI (optional).
# When absent, derived from site.base_url + "/repository.git".
# clone_url = "https://vit.am/~ololduck/abbaye/repository.git"

# Glob patterns for refs to EXCLUDE from the UI (optional, default: []).
# Any branch or tag matching one of these patterns is hidden.
# exclude = ["gh-pages", "tmp/*"]

# Glob patterns for refs to INCLUDE (optional, default: [] = allow all).
# When non-empty, acts as an allowlist: only refs matching at least one
# include pattern are shown (and are then still subject to exclude).
include = ["main", "develop", "v*"]

# ── Version Extractor ───────────────────────────────────────────────────────
# Determines how the current release version is obtained.
# Two backends are available: "git" (tags) or "cargo" (Cargo.toml).

[version_extractor]
type = "git"

# ── Git Version Extractor (type = "git") ─────────────────────────────────────
# Derives the version from `git describe --tags --always`.

# Strip this prefix from the tag name (optional, default: none).
# "v1.2.3" with tag_prefix = "v" → "1.2.3".
tag_prefix = "v"

# Suffix appended when the working tree has uncommitted changes (optional, default: "-dirty").
# dirty_suffix = "-dirty"

# ── Cargo Version Extractor (alternative: type = "cargo") ────────────────────
# Reads version from [package].version in a Cargo.toml.
#
# [version_extractor]
# type = "cargo"
#
# Path to Cargo.toml (optional, default: "Cargo.toml").
# manifest_path = "Cargo.toml"

# ── Changelog ───────────────────────────────────────────────────────────────

[changelog]
# Directory containing CHANGELOG.md (optional, default: ".").
# directory = "."

# ── Builders ─────────────────────────────────────────────────────────────────
# Each [[builders]] entry defines a build step.  Builders run in parallel
# unless linked via depends_on / id.  Artifacts (files) land in <version>/dist/
# and directories land in <version>/docs/.
#
# Common fields shared by all builder types:
#
#   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.

# ── Cargo Builder (type = "cargo") ──────────────────────────────────────────

[[builders]]
# Builds the Rust project with `cargo build --release`.
category = "Binaries"
name = "Pre-built binaries"
comment = "Built for x86_64 and aarch64 Linux (musl)."
type = "cargo"

# Target triples for cross-compilation (optional, default: [] = host target).
targets = ["x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl"]

# Path to Cargo.toml (optional, default: "./Cargo.toml").
# manifest_path = "Cargo.toml"

# Restrict collected artifacts to these binary/cdylib names (optional, default: [] = all).
# Useful in workspaces to avoid picking up dev-tools or examples.
# bins = ["my_app", "my_lib"]

# Run cross-compilation targets in parallel (optional, default: true).
# Set to false when disk space is tight or the build host is resource-constrained.
# parallel = true

# ── Cargo Doc Builder (type = "cargo_doc") ──────────────────────────────────

[[builders]]
# Generates API documentation with `cargo doc`.
# The resulting doc directory is placed under <version>/docs/.
type = "cargo_doc"

# Skip building documentation for dependencies (optional, default: false).
no_deps = true

# Path to Cargo.toml (optional, default: "./Cargo.toml").
# manifest_path = "Cargo.toml"

# ── Script Builder (type = "script") ────────────────────────────────────────

[[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.
# Each line is passed to `sh -c`.  The build fails on any non-zero exit.
# Environment variable ABBAYE_BUILDING_VERSION is set automatically.
script = [
  "mkdir -p target",
  "cargo run --bin abbaye -- dump-schema > target/abbaye.schema.json",
]

# REQUIRED. Paths (or glob patterns) of files/directories produced by the
# script that should be treated as release artifacts.
# Each entry can be:
#   - A plain string path:    "target/release/mybin"
#   - A table with a custom display name:
#       { path = "target/release/mybin", name = "mybin-v1.0.0-linux" }
outputs = ["target/abbaye.schema.json"]

# ── Archive Builder (type = "archive") ──────────────────────────────────────

[[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.

# Root directory to archive (optional, default: ".").
# source_dir = "."

# Output path for the .tar.gz archive (optional).
# Default: "{prefix}-{version}.tar.gz" in the current working directory.
output = "target/abbaye-source.tar.gz"

# Prefix applied to every entry inside the archive (optional, default: source dir name).
# Example: "myproject-1.0.0" → entries like "myproject-1.0.0/src/main.rs".
# prefix = "abbaye"

# Glob patterns to exclude (optional, default: [".git", "*.local"]).
# Each pattern is matched against every path component.
# ignore_patterns = [".git", "*.local"]

# ── AUR Package Script ──────────────────────────────────────────────────────

[[builders]]
id = "AUR package"
category = "Packages"
name = "Arch Linux (AUR)"
comment = "Tarball for downloading from the Arch User Repository."
type = "script"
script = [
  "cargo aur",
  "sed -i \"s%source=.*$%source=(\"https://vit.am/~ololduck/abbaye/abbaye-$pkgver-x86-64.tar.gz\")%\" target/cargo-aur/PKGBUILD",
]
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]]
# type = "markdown"
#
# # Directory containing .md files to render (optional, default: ".").
# input = "docs/"
#
# # Output directory (optional, default: "<input-dir-name>-html").
# output = "docs-html/"
#
# # Descend into subdirectories (optional, default: true).
# recursive = true
#
# # Output formats (optional, default: ["html"]).
# formats = ["html", "gemtext"]

# ── Dependency Ordering Examples ─────────────────────────────────────────────
# Builders run concurrently by default.  To enforce ordering, assign an `id`
# and reference it in `depends_on`:
#
# [[builders]]
# id = "compile"
# type = "cargo"
# targets = ["x86_64-unknown-linux-gnu"]
#
# [[builders]]
# type = "script"
# script = ["strip target/release/mybin"]
# outputs = ["target/release/mybin"]
# depends_on = ["compile"]   # waits for "compile" to finish