Commit
Message
Changed Files (3)
-
modified CHANGELOG.md
diff --git a/CHANGELOG.md b/CHANGELOG.md index e96550e..cf7012d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - If a `static` dir is found in custom theme folder, copy it to output - Add opengraph metadata to site generation - Add AbbayeConfig schema gen and `dump-schema` command +- Add ScriptBuilder and version string propagation ### ⚙️ Miscellaneous Tasks -
modified abbaye.schema.json
diff --git a/abbaye.schema.json b/abbaye.schema.json index 32eecea..7a7dc9c 100644 --- a/abbaye.schema.json +++ b/abbaye.schema.json @@ -82,6 +82,20 @@ "required": [ "type" ] + }, + { + "description": "Runs an arbitrary sequence of shell commands and collects declared\noutput paths as release artifacts.\n\nEach script line is passed to `sh -c`; the build fails immediately if\nany command exits with a non-zero status.\n\n```toml\n[[builders]]\ntype = \"script\"\nscript = [\n \"make release\",\n \"strip target/mybin\",\n]\noutputs = [\"target/mybin\"]\n```", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "script" + } + }, + "$ref": "#/$defs/ScriptBuilderConfig", + "required": [ + "type" + ] } ] }, @@ -287,6 +301,53 @@ "image" ] }, + "ScriptBuilderConfig": { + "description": "Configuration for [`ScriptBuilder`].", + "type": "object", + "properties": { + "outputs": { + "description": "Paths of the files or directories produced by the script that should be\ntreated as release artifacts (copied to `dist/` and listed on the\nrelease page). Each path is resolved relative to the working directory\nin which `abbaye` is run.\n\nIf a listed path is missing, the build fails.", + "type": "array", + "items": { + "$ref": "#/$defs/ScriptBuilderOutput" + } + }, + "script": { + "description": "Shell commands to execute in order. Each line is passed to `sh -c`,\nso any POSIX shell syntax is supported.\n\nThe environment variable `ABBAYE_BUILDING_VERSION` is set to the version\nbeing built. (e.g. the git tag `v0.1.0` or whatever. Not Abbaye's own version)\n\nThe build fails immediately if any command exits with a non-zero status.\n\n```toml\n[[builders]]\ntype = \"script\"\nscript = [\n \"make release\",\n \"strip target/mybin\",\n]\noutputs = [\"target/mybin\"]\n```", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "script", + "outputs" + ] + }, + "ScriptBuilderOutput": { + "description": "Lets the user specify a path for a script output, optionally with a custom name.\nI need to check but it should enable the user to specify a directory as output.\nIf that's a good idea is an other question.", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + } + }, + "required": [ + "path", + "name" + ] + }, + { + "type": "string" + } + ] + }, "SiteConfig": { "description": "General website metadata.", "type": "object", -
modified mise.toml
diff --git a/mise.toml b/mise.toml index 69fc990..2696261 100644 --- a/mise.toml +++ b/mise.toml @@ -50,6 +50,8 @@ flag "-o --output <file>" help="output file path" default="CHANGELOG.md" outputs = ["CHANGELOG.md"] [tasks.generate-schema] +# needed as to not be interrupted if a cleaning task is running +wait_for = ["clean"] description = "generates a JSON schema for abbaye.toml" run = [ "cargo run --bin abbaye dump-schema > abbaye.schema.json && git add abbaye.schema.json"