aboutsummaryrefslogtreecommitdiff
path: root/devscripts/create-github-release.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-11-18 00:17:46 +0700
committerSergey M․ <dstftw@gmail.com>2016-11-18 00:17:46 +0700
commit689f31fde52fc49c01cc8a8acd20464a3527501d (patch)
tree31615b40f39ca263afd98e292cac143864d14042 /devscripts/create-github-release.py
parent582be3584761030bfbee13b0c6ea9e6ce2c8a790 (diff)
[devscripts/create-github-release] Fill release body from ChangeLog (closes #11094)
Diffstat (limited to 'devscripts/create-github-release.py')
-rw-r--r--devscripts/create-github-release.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/devscripts/create-github-release.py b/devscripts/create-github-release.py
index 3b8021e74..30716ad8e 100644
--- a/devscripts/create-github-release.py
+++ b/devscripts/create-github-release.py
@@ -2,11 +2,13 @@
from __future__ import unicode_literals
import base64
+import io
import json
import mimetypes
import netrc
import optparse
import os
+import re
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@@ -90,16 +92,23 @@ class GitHubReleaser(object):
def main():
- parser = optparse.OptionParser(usage='%prog VERSION BUILDPATH')
+ parser = optparse.OptionParser(usage='%prog CHANGELOG VERSION BUILDPATH')
options, args = parser.parse_args()
- if len(args) != 2:
+ if len(args) != 3:
parser.error('Expected a version and a build directory')
- version, build_path = args
+ changelog_file, version, build_path = args
+
+ with io.open(changelog_file, encoding='utf-8') as inf:
+ changelog = inf.read()
+
+ mobj = re.search(r'(?s)version %s\n{2}(.+?)\n{3}' % version, changelog)
+ body = mobj.group(1) if mobj else ''
releaser = GitHubReleaser()
- new_release = releaser.create_release(version, name='youtube-dl %s' % version)
+ new_release = releaser.create_release(
+ version, name='youtube-dl %s' % version, body=body)
release_id = new_release['id']
for asset in os.listdir(build_path):