Implement independent format gates for release workflow (issue #86)
Add XBPS build and sign steps to CI workflow Add XBPS publication as independent gate (requires manual trigger) Track format availability in release notes Update release-footer.md with XBPS install instructions Add --available/--withheld arguments to extract_changelog.py Attach XBPS artifacts to Gitea release Clean up XBPS signing key material after use
This commit is contained in:
@@ -68,6 +68,20 @@ def assemble_release_body(section: str, footer: str) -> str:
|
||||
return f"{section}{separator}{footer}"
|
||||
|
||||
|
||||
def format_availability_section(
|
||||
available: list[str], withheld: list[str]
|
||||
) -> str:
|
||||
"""Generate a package formats section for release notes."""
|
||||
if not available and not withheld:
|
||||
return ""
|
||||
lines = ["\n## Package formats\n"]
|
||||
if available:
|
||||
lines.append(f"Available: {', '.join(available)}")
|
||||
if withheld:
|
||||
lines.append(f"Withheld: {', '.join(withheld)}")
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("changelog", type=Path)
|
||||
@@ -77,6 +91,18 @@ def main(argv: list[str] | None = None) -> int:
|
||||
type=Path,
|
||||
help="append this standing release guidance after the extracted section",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--available",
|
||||
action="append",
|
||||
default=[],
|
||||
help="format available for this release (can be repeated)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--withheld",
|
||||
action="append",
|
||||
default=[],
|
||||
help="format withheld from this release (can be repeated)",
|
||||
)
|
||||
args = parser.parse_args(argv)
|
||||
try:
|
||||
section = extract_changelog(args.changelog, args.version)
|
||||
@@ -88,6 +114,10 @@ def main(argv: list[str] | None = None) -> int:
|
||||
f"cannot read release footer {args.footer}: {error.strerror}"
|
||||
) from error
|
||||
section = assemble_release_body(section, footer)
|
||||
if args.available or args.withheld:
|
||||
formats = format_availability_section(args.available, args.withheld)
|
||||
if formats:
|
||||
section = f"{section}\n{formats}"
|
||||
sys.stdout.write(section)
|
||||
except ChangelogError as error:
|
||||
print(f"::error::{error}", file=sys.stderr)
|
||||
|
||||
Reference in New Issue
Block a user