diff --git a/mise-tasks/container-build-and-release b/mise-tasks/container-build-and-release index ce57c2e..508d586 100755 --- a/mise-tasks/container-build-and-release +++ b/mise-tasks/container-build-and-release @@ -7,10 +7,10 @@ #USAGE arg "" help="Container name (directory under containers/)" #USAGE flag "--ref " help="Commit SHA or branch to build (defaults to current HEAD)" #USAGE flag "--dry-run" help="Show what would be done without triggering" -"""Trigger container build workflows via Forgejo API dispatch. +"""Trigger container build workflow via Forgejo API dispatch. -Dispatches both Build Container and Build Container (Nix) workflows. -Each workflow checks for its build file and skips if not present. +Dispatches the unified build-container workflow, which handles both +Dockerfile and Nix builds in a single workflow. """ import subprocess @@ -26,10 +26,7 @@ FORGE_API = f"{FORGE_URL}/api/v1" REPO = "eblume/blumeops" FORGE_ACTIONS = f"{FORGE_URL}/{REPO}/actions" -WORKFLOWS = [ - "build-container.yaml", - "build-container-nix.yaml", -] +WORKFLOW = "build-container.yaml" app = typer.Typer(add_completion=False) @@ -108,9 +105,7 @@ def main( typer.echo() if dry_run: - typer.echo("[dry-run] Would dispatch workflows:") - for wf in WORKFLOWS: - typer.echo(f" - {wf}") + typer.echo(f"[dry-run] Would dispatch {WORKFLOW}") typer.echo() typer.echo(f"Monitor builds at: {FORGE_ACTIONS}") return @@ -121,21 +116,20 @@ def main( "Content-Type": "application/json", } - for wf in WORKFLOWS: - url = f"{FORGE_API}/repos/{REPO}/actions/workflows/{wf}/dispatches" - payload = { - "ref": "main", - "inputs": { - "container": container, - "ref": ref, - }, - } - resp = httpx.post(url, json=payload, headers=headers, timeout=30) - if resp.status_code == 204: - typer.echo(f"Dispatched {wf}") - else: - typer.echo(f"Error dispatching {wf}: {resp.status_code} {resp.text}") - raise typer.Exit(1) + url = f"{FORGE_API}/repos/{REPO}/actions/workflows/{WORKFLOW}/dispatches" + payload = { + "ref": "main", + "inputs": { + "container": container, + "ref": ref, + }, + } + resp = httpx.post(url, json=payload, headers=headers, timeout=30) + if resp.status_code == 204: + typer.echo(f"Dispatched {WORKFLOW}") + else: + typer.echo(f"Error dispatching {WORKFLOW}: {resp.status_code} {resp.text}") + raise typer.Exit(1) typer.echo() typer.echo(f"Monitor builds at: {FORGE_ACTIONS}")