mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-19 05:51:05 +01:00
Add a script to extract the release notes from the NEWS files and use them when creating GitHub releases, so that we don’t need to copy them manually. Add also a test to make sure the NEWS file always have release notes for the current release.
25 lines
591 B
Python
Executable File
25 lines
591 B
Python
Executable File
#!/usr/bin/env python3
|
|
import sys
|
|
|
|
|
|
news_path = sys.argv[1]
|
|
release = sys.argv[2]
|
|
|
|
with open(news_path, "r", encoding="utf-8") as news_file:
|
|
lines = news_file.readlines()
|
|
|
|
start = None
|
|
end = None
|
|
for i, line in enumerate(lines):
|
|
line = line.rstrip()
|
|
if line.startswith("Overview of changes leading to"):
|
|
if start is not None: # Start of next release
|
|
end = i
|
|
break
|
|
if line.endswith(release): # Start of the release
|
|
start = i + 3 # Skip the header lines
|
|
|
|
assert start and end and end > start
|
|
|
|
print("".join(lines[start:end]))
|