diff options
author | bashonly <bashonly@bashonly.com> | 2023-11-12 17:49:15 -0600 |
---|---|---|
committer | bashonly <bashonly@bashonly.com> | 2023-11-12 18:29:19 -0600 |
commit | 1d03633c5a1621b9f3a756f0a4f9dc61fab3aeaa (patch) | |
tree | ecb0a9f13da3aba09d3ac19c7c2092dba658d34b /devscripts/update-version.py | |
parent | 8afd9468b0c822843bc480d366d1c86698daabfb (diff) |
[build] Overhaul and unify release workflow
Authored by: bashonly, Grub4K
Co-authored-by: Simon Sawicki <contact@grub4k.xyz>
Diffstat (limited to 'devscripts/update-version.py')
-rw-r--r-- | devscripts/update-version.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/devscripts/update-version.py b/devscripts/update-version.py index 0144bd284..da54a6a25 100644 --- a/devscripts/update-version.py +++ b/devscripts/update-version.py @@ -20,7 +20,7 @@ def get_new_version(version, revision): version = datetime.now(timezone.utc).strftime('%Y.%m.%d') if revision: - assert revision.isdigit(), 'Revision must be a number' + assert revision.isdecimal(), 'Revision must be a number' else: old_version = read_version().split('.') if version.split('.') == old_version[:3]: @@ -46,6 +46,10 @@ VARIANT = None UPDATE_HINT = None CHANNEL = {channel!r} + +ORIGIN = {origin!r} + +_pkg_version = {package_version!r} ''' if __name__ == '__main__': @@ -54,6 +58,12 @@ if __name__ == '__main__': '-c', '--channel', default='stable', help='Select update channel (default: %(default)s)') parser.add_argument( + '-r', '--origin', default='local', + help='Select origin/repository (default: %(default)s)') + parser.add_argument( + '-s', '--suffix', default='', + help='Add an alphanumeric suffix to the package version, e.g. "dev"') + parser.add_argument( '-o', '--output', default='yt_dlp/version.py', help='The output file to write to (default: %(default)s)') parser.add_argument( @@ -66,6 +76,7 @@ if __name__ == '__main__': args.version if args.version and '.' in args.version else get_new_version(None, args.version)) write_file(args.output, VERSION_TEMPLATE.format( - version=version, git_head=git_head, channel=args.channel)) + version=version, git_head=git_head, channel=args.channel, origin=args.origin, + package_version=f'{version}{args.suffix}')) print(f'version={version} ({args.channel}), head={git_head}') |