ci: add gitea workflows and signed release pipeline
CI runs fmt, clippy and tests. Tag releases build Linux and Windows (mingw cross) artifacts, SHA256SUMS and an Ed25519 signed manifest, then publish via the Gitea API. Helper scripts live in scripts/release, docs in docs/release.md.
This commit is contained in:
parent
ebea98e9a4
commit
948d10bd37
6 changed files with 649 additions and 0 deletions
35
scripts/release/extract_changelog.py
Executable file
35
scripts/release/extract_changelog.py
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Print the body of the CHANGELOG.md section for a version ("## [X.Y.Z] ...").
|
||||
|
||||
Exits non-zero if the section is missing or empty.
|
||||
Usage: extract_changelog.py VERSION [CHANGELOG.md]
|
||||
"""
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
||||
def main() -> int:
|
||||
if len(sys.argv) < 2:
|
||||
sys.exit(__doc__)
|
||||
version = sys.argv[1].lstrip("v")
|
||||
path = sys.argv[2] if len(sys.argv) > 2 else "CHANGELOG.md"
|
||||
with open(path, encoding="utf-8") as f:
|
||||
lines = f.read().splitlines()
|
||||
head = re.compile(r"^## \[" + re.escape(version) + r"\]")
|
||||
out, inside = [], False
|
||||
for line in lines:
|
||||
if inside and line.startswith("## "):
|
||||
break
|
||||
if inside:
|
||||
out.append(line)
|
||||
elif head.match(line):
|
||||
inside = True
|
||||
body = "\n".join(out).strip()
|
||||
if not inside or not body:
|
||||
sys.exit(f"CHANGELOG.md has no non-empty section for [{version}]")
|
||||
print(body)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Loading…
Add table
Add a link
Reference in a new issue