rheaarchived
- 40 commits
- 1 branch
- 0 tags
- updated
feat: source release notes from CHANGELOG.md instead of raw commit log
SignedGitea couldn't verify the signature.
Showing 3 changed files with 62 additions and 8 deletions.
.gitea/workflows/release.yml
+4 โ8
@@ -105,18 +105,14 @@ jobs:105105 security delete-keychain "$keychain_path" || true106106 fi107107108 - name: Build changelog108 - name: Extract changelog section109109 id: changelog110110 run: |111 PREV_TAG=$(git describe --tags --abbrev=0 "${{ steps.version.outputs.tag }}^" 2>/dev/null || true)111 NOTES=$(python3 Packaging/scripts/extract_changelog.py \112 "${{ steps.version.outputs.marketing_version }}" CHANGELOG.md)112113 {113114 echo "log<<EOF"114 if [ -n "$PREV_TAG" ]; then115 git log "$PREV_TAG..${{ steps.version.outputs.tag }}" --pretty=format:"- %s (%h)"116 else117 git log "${{ steps.version.outputs.tag }}" --pretty=format:"- %s (%h)"118 fi119 echo115 echo "$NOTES"120116 echo "EOF"121117 } >> "$GITHUB_OUTPUT"122118
CHANGELOG.md
+9 โ0
@@ -4,6 +4,15 @@ All notable changes to this project are documented here. Format loosely follows44[Keep a Changelog](https://keepachangelog.com/); versioning is pre-1.0, so breaking55changes may land in minor releases.667## [0.2.0] - 2026-07-1089### Added10- Tag-triggered release pipeline (`.gitea/workflows/release.yml`): builds a Release11 configuration signed with a real Developer ID Application certificate, notarizes and12 staples the resulting `.dmg`, publishes it as a Gitea release with release notes13 pulled from this changelog, and generates + EdDSA-signs an `appcast.xml` (Sparkle14 isn't wired into the app yet, so this is release-side prep only).15716## [0.1.0] - 2026-07-09817918Initial release.
Packaging/scripts/extract_changelog.pyadded
+49 โ0
@@ -0,0 +1,49 @@1#!/usr/bin/env python32"""Extract the section for a given version from CHANGELOG.md.34Usage: extract_changelog.py <version> <changelog_path>5Prints the section body (excluding the heading line) to stdout.6Exits non-zero with an error on stderr if no matching section is found,7so a release tagged without a corresponding changelog entry fails loudly8instead of shipping an empty or misleading release body.9"""10import re11import sys121314def main() -> int:15 if len(sys.argv) != 3:16 print("usage: extract_changelog.py <version> <changelog_path>", file=sys.stderr)17 return 21819 version, path = sys.argv[1], sys.argv[2]20 with open(path, encoding="utf-8") as f:21 text = f.read()2223 heading_pattern = re.compile(24 r"^##\s*\[" + re.escape(version) + r"\].*$", re.MULTILINE25 )26 match = heading_pattern.search(text)27 if not match:28 print(29 f"error: no CHANGELOG.md section found for version {version!r} "30 f"(expected a heading like '## [{version}] - YYYY-MM-DD')",31 file=sys.stderr,32 )33 return 13435 start = match.end()36 next_heading = re.search(r"^##\s*\[", text[start:], re.MULTILINE)37 end = start + next_heading.start() if next_heading else len(text)3839 body = text[start:end].strip()40 if not body:41 print(f"error: CHANGELOG.md section for {version!r} is empty", file=sys.stderr)42 return 14344 print(body)45 return 0464748if __name__ == "__main__":49 raise SystemExit(main())