Generator: split kind supports optional tag-trigger + setup-comment + publish-flag (oleks/ci-scripts#2)

This commit is contained in:
2026-07-04 19:36:39 +03:00
parent 68cba21891
commit 5e4eec041f
3 changed files with 49 additions and 6 deletions
+10
View File
@@ -156,16 +156,26 @@ def render_split(manifest: dict) -> dict:
f" # {line}\n" if line else " #\n"
for line in leg["entrypoint_comment"].rstrip("\n").splitlines()
)
tag_event_line = " - event: tag\n" if manifest.get("when_tag_event", True) else ""
publish_flag = " -- --publish" if leg.get("publish_flag", True) else ""
default_setup_comment = (
f"nix.conf substituters + {git_host} netrc (to fetch the parity-lib\n"
"flake input). Same bootstrap as flake-hub/ci/setup.sh."
)
setup_comment = _comment_block(leg.get("setup_comment", default_setup_comment), " ")
out[f"{arch}.yaml"] = tmpl.format(
repo=repo,
nix_system=leg["nix_system"],
arch=arch,
header=header,
entrypoint_comment=entrypoint_comment,
tag_event_line=tag_event_line,
setup_comment=setup_comment,
git_host=git_host,
image=leg["image"],
setup_script=setup_script,
app=leg["app"],
publish_flag=publish_flag,
)
return out
+3 -6
View File
@@ -2,8 +2,7 @@
when:
- event: push
branch: main
- event: tag
{tag_event_line}
clone:
- name: clone
image: woodpeckerci/plugin-git
@@ -33,7 +32,5 @@ steps:
pipeline-number: "${{CI_PIPELINE_NUMBER}}"
commands:
- echo "▸ arch=$(uname -m)"
# nix.conf substituters + {git_host} netrc (to fetch the parity-lib
# flake input). Same bootstrap as flake-hub/ci/setup.sh.
- sh {setup_script}
{entrypoint_comment} - PUBLISH=1 nix run .#{app} -- --publish
{setup_comment} - sh {setup_script}
{entrypoint_comment} - PUBLISH=1 nix run .#{app}{publish_flag}