Skip to content

Commit

Permalink
ci: add tools/get-last-notes.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gnuton committed May 24, 2024
1 parent 0898887 commit 85994aa
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tools/get-last-notes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/python3
import re
from datetime import date
import os

today=date.today()
CHANGELOG_FILE='Changelog-NG.txt'
MSG="""## GNUton's Asus Merlin changelog ##\n"""
TAGGED_RELEASE_ENV_NAME='CIRCLE_TAG'

latest_release = None
latest_changes = list()

with open(CHANGELOG_FILE) as f:

rx = re.compile('^(\d[^()]+)\s.*$')

for line in f:
release_search = rx.search(line)

if release_search:
if latest_release:
break
else:
latest_release = os.getenv(TAGGED_RELEASE_ENV_NAME, release_search.group(1))
else:
if latest_release:
latest_changes.append(line)

print(MSG)
print('Date: %s' % today.strftime("%B %d, %Y"))
print('Release: %s\n' % latest_release)
print("".join(latest_changes))

0 comments on commit 85994aa

Please sign in to comment.