forked from KDE/ghostwriter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreleaseNotes.py
executable file
·35 lines (25 loc) · 1.25 KB
/
releaseNotes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/python
# SPDX-FileCopyrightText: 2022 Megan Conkle <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-or-later
import sys
if len(sys.argv) != 2:
print("Missing or invalid arguments.")
print("Please provide release version number.")
exit(1)
version = sys.argv[1]
changelog = open('CHANGELOG.md', 'r')
lines = changelog.readlines()
currentRelease = False
print("## Release Notes")
for line in lines:
if not currentRelease and line.startswith("## ["):
currentRelease = True
elif currentRelease:
if line.startswith("## ["):
break # All done!
else:
print(line.rstrip())
print("## Downloads")
print("")
print(r'[![ubuntu](https://img.shields.io/static/v1?label=&color=purple&logo=ubuntu&message=Ubuntu&style=for-the-badge)](https://launchpad.net/~wereturtle/+archive/ubuntu/ppa) [![fedora](https://img.shields.io/static/v1?label=&color=blue&logo=fedora&message=Fedora&style=for-the-badge)](https://copr.fedorainfracloud.org/coprs/wereturtle/stable/) [![Windows](https://img.shields.io/static/v1?label=&color=blue&logo=windows&message=Windows&style=for-the-badge)](https://github.com/wereturtle/ghostwriter/releases/download/' + version + r'/ghostwriter_' + version + r'_win64_portable.zip)')