Skip to content

Commit

Permalink
Auto merge of zcash#2460 - str4d:process-temp-release-notes, r=daira
Browse files Browse the repository at this point in the history
Pull in temporary release notes during the release process

This PR assumes we always have at least one notable change in `doc/release-notes.md`, which should be the case for every release.
  • Loading branch information
zkbot committed Jul 10, 2017
2 parents 90a255a + caafbbb commit 5df11e9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions zcutil/release-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@
from itertools import islice
from operator import itemgetter

TEMP_RELEASE_NOTES_HEADER = [
'(note: this is a temporary file, to be added-to by anybody, and moved to\n',
'release-notes at release time)\n',
'\n',
'Notable changes\n',
'===============\n',
'\n',
]

RELEASE_NOTES_CHANGELOG_HEADING = [
'Changelog\n',
'=========\n',
'\n',
]

author_aliases = {
'Simon': 'Simon Liu',
'bitcartel': 'Simon Liu',
Expand Down Expand Up @@ -77,9 +92,22 @@ def generate_release_note(version, filename):
notes = subprocess.Popen(['git shortlog --no-merges {0}..HEAD'.format(latest_tag)], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE).communicate()[0]
lines = notes.split('\n')
lines = [alias_authors_in_release_notes(line) for line in lines]
temp_release_note = os.path.join(doc_dir, 'release-notes.md')
with open(temp_release_note, 'r') as f:
notable_changes = f.readlines()
# Assumes that all notable changes are appended to the default header
if len(notable_changes) > 6:
notable_changes = notable_changes[3:] + ['\n']
else:
notable_changes = []
release_note = os.path.join(doc_dir, 'release-notes', 'release-notes-{0}.md'.format(version))
with open(release_note, 'w') as f:
f.writelines(notable_changes)
f.writelines(RELEASE_NOTES_CHANGELOG_HEADING)
f.writelines('\n'.join(lines))
# Clear temporary release notes file
with open(temp_release_note, 'w') as f:
f.writelines(TEMP_RELEASE_NOTES_HEADER)

def main(version, filename):
if version != None:
Expand Down

0 comments on commit 5df11e9

Please sign in to comment.