mirror of
				https://github.com/ytdl-org/youtube-dl.git
				synced 2025-10-29 09:26:20 -07:00 
			
		
		
		
	[devscripts/create-github-release] Fill release body from ChangeLog (closes #11094)
This commit is contained in:
		| @@ -2,11 +2,13 @@ | |||||||
| from __future__ import unicode_literals | from __future__ import unicode_literals | ||||||
|  |  | ||||||
| import base64 | import base64 | ||||||
|  | import io | ||||||
| import json | import json | ||||||
| import mimetypes | import mimetypes | ||||||
| import netrc | import netrc | ||||||
| import optparse | import optparse | ||||||
| import os | import os | ||||||
|  | import re | ||||||
| import sys | import sys | ||||||
|  |  | ||||||
| sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | ||||||
| @@ -90,16 +92,23 @@ class GitHubReleaser(object): | |||||||
|  |  | ||||||
|  |  | ||||||
| def main(): | def main(): | ||||||
|     parser = optparse.OptionParser(usage='%prog VERSION BUILDPATH') |     parser = optparse.OptionParser(usage='%prog CHANGELOG VERSION BUILDPATH') | ||||||
|     options, args = parser.parse_args() |     options, args = parser.parse_args() | ||||||
|     if len(args) != 2: |     if len(args) != 3: | ||||||
|         parser.error('Expected a version and a build directory') |         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() |     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'] |     release_id = new_release['id'] | ||||||
|  |  | ||||||
|     for asset in os.listdir(build_path): |     for asset in os.listdir(build_path): | ||||||
|   | |||||||
| @@ -110,7 +110,7 @@ RELEASE_FILES="youtube-dl youtube-dl.exe youtube-dl-$version.tar.gz" | |||||||
| for f in $RELEASE_FILES; do gpg --passphrase-repeat 5 --detach-sig "build/$version/$f"; done | for f in $RELEASE_FILES; do gpg --passphrase-repeat 5 --detach-sig "build/$version/$f"; done | ||||||
|  |  | ||||||
| ROOT=$(pwd) | ROOT=$(pwd) | ||||||
| python devscripts/create-github-release.py $version "$ROOT/build/$version" | python devscripts/create-github-release.py ChangeLog $version "$ROOT/build/$version" | ||||||
|  |  | ||||||
| ssh ytdl@yt-dl.org "sh html/update_latest.sh $version" | ssh ytdl@yt-dl.org "sh html/update_latest.sh $version" | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user