Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0] - 2026-11-01

### Added

- Initial public developer preview.
29 changes: 29 additions & 0 deletions scripts/release_notes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Print one version's section of CHANGELOG.md (the GitHub Release notes for that tag).

python3 scripts/release_notes.py 0.2.0

Exits non-zero when CHANGELOG.md has no section for the version, so a release cannot ship
without one.
"""

import re
import sys
from pathlib import Path

CHANGELOG = Path(__file__).resolve().parents[1] / "CHANGELOG.md"


def notes(version: str, text: str) -> str | None:
match = re.search(
rf"^## \[{re.escape(version)}\][^\n]*\n(.*?)(?=^## \[|^\[[^\]]+\]: |\Z)",
text,
re.MULTILINE | re.DOTALL,
)
return match.group(1).strip() if match else None


if __name__ == "__main__":
body = notes(sys.argv[1], CHANGELOG.read_text())
if body is None:
sys.exit(f"CHANGELOG.md has no section for {sys.argv[1]}")
print(body)
Loading