Refactor GitHub Actions workflow and add scripts for versioning and release notes extraction

This commit is contained in:
Ujwal223
2026-05-25 22:53:53 +05:45
parent 5f86441675
commit 7d13ad64f1
3 changed files with 25 additions and 54 deletions
+10
View File
@@ -0,0 +1,10 @@
import os, re
from pathlib import Path
version = os.environ["VERSION"]
text = Path("CHANGELOG.md").read_text(encoding="utf-8")
pattern = rf"(?ms)^##\s+FocusGram\s+{re.escape(version)}\s*$.*?(?=^##\s+|\Z)"
m = re.search(pattern, text)
if not m:
raise SystemExit(f"Could not find changelog section for version {version}")
Path("release_notes.md").write_text(m.group(0).strip() + "\n", encoding="utf-8")