[ci skip] Fix huge release notes
This commit is contained in:
parent
fba1306999
commit
f3f21f1e0c
|
@ -1,4 +1,5 @@
|
||||||
pup
|
pup
|
||||||
release.md
|
release.md
|
||||||
pup.zip
|
pup.zip
|
||||||
IN*.csv
|
IN*.csv
|
||||||
|
notes.md
|
8
Makefile
8
Makefile
|
@ -30,8 +30,8 @@ update: ISIN
|
||||||
old:
|
old:
|
||||||
git show HEAD^:ISIN.csv > /tmp/ISIN.csv
|
git show HEAD^:ISIN.csv > /tmp/ISIN.csv
|
||||||
|
|
||||||
release.md: old
|
release-notes: old
|
||||||
python3 src/diff.py > release.md
|
python3 src/diff.py
|
||||||
|
|
||||||
release: release.md
|
release: release-notes
|
||||||
gh release create "$(version)" --notes-file release.md ISIN.csv
|
gh release create "$(version)" --notes-file notes.md ISIN.csv release.md
|
||||||
|
|
22
src/diff.py
22
src/diff.py
|
@ -17,4 +17,24 @@ diff = compare(
|
||||||
True
|
True
|
||||||
)
|
)
|
||||||
|
|
||||||
print(template.render(added=diff['added'], changed=diff['changed'], removed=diff['removed']))
|
contents = template.render(added=diff['added'], changed=diff['changed'], removed=diff['removed'])
|
||||||
|
|
||||||
|
# GitHub supports a maximum limit of 125000 for release notes.
|
||||||
|
# 124800 = 124000 - 200 for buffer and the warning line
|
||||||
|
# To get around this, we add a warning if we hit the limit
|
||||||
|
# and attach a release.md file with the complete notes
|
||||||
|
if len(contents) >= 125000:
|
||||||
|
notes = """This file is truncated due to GitHub limitations.
|
||||||
|
please see the attached `release.md` file for complete notes""" + contents[:124800]
|
||||||
|
else:
|
||||||
|
notes = contents
|
||||||
|
|
||||||
|
"""
|
||||||
|
notes are the viewable notes on the release page on GitHub
|
||||||
|
while release.md is the attached notes. This is the complete text.
|
||||||
|
"""
|
||||||
|
with open('notes.md', 'w') as f:
|
||||||
|
f.write(notes)
|
||||||
|
|
||||||
|
with open('release.md', 'w') as f:
|
||||||
|
f.write(contents)
|
|
@ -1,6 +1,5 @@
|
||||||
## Generates a single diff for a single row, ignoring the Status field
|
## Generates a single diff for a single row, ignoring the Status field
|
||||||
<%def name="singlediff(row)">
|
<%def name="singlediff(row)">@@ ${row['key']}
|
||||||
@@ ${row['key']}
|
|
||||||
%for k in row['changes']:
|
%for k in row['changes']:
|
||||||
%if k != 'Status':
|
%if k != 'Status':
|
||||||
-${k}:${row['changes'][k][0]}
|
-${k}:${row['changes'][k][0]}
|
||||||
|
@ -19,7 +18,7 @@ ${row['changes']['Description'][1]}
|
||||||
%endif
|
%endif
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
% if len(added) > 0
|
% if len(added) > 0:
|
||||||
<h2>Additions</h2>
|
<h2>Additions</h2>
|
||||||
|
|
||||||
The following new ISINs were added:
|
The following new ISINs were added:
|
||||||
|
@ -33,7 +32,7 @@ ISIN|Description|Issuer|Type|Status
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
% if len(changed) > 0
|
% if len(changed) > 0:
|
||||||
<h2>Changes</h2>
|
<h2>Changes</h2>
|
||||||
|
|
||||||
The following ISINs changed their status:
|
The following ISINs changed their status:
|
||||||
|
|
Loading…
Reference in New Issue