mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-27 03:21:34 +00:00
Automatically update version in release script (#431)
This commit is contained in:
parent
398343897f
commit
91f4ce02b6
@ -204,16 +204,24 @@ def release(args):
|
|||||||
line = '-' * title_len + '\n'
|
line = '-' * title_len + '\n'
|
||||||
title_len = 0
|
title_len = 0
|
||||||
sys.stdout.write(line)
|
sys.stdout.write(line)
|
||||||
# TODO: add new version to manage.py
|
|
||||||
|
# Add the version to the script.
|
||||||
|
script = os.path.join('support', 'manage.py')
|
||||||
|
script_path = os.path.join(fmt_repo.dir, script)
|
||||||
|
for line in fileinput.input(script_path, inplace=True):
|
||||||
|
m = re.match(r'( *for version in )\[(.+)\]:', line)
|
||||||
|
if m:
|
||||||
|
line = '{}[{}, \'{}\']:\n'.format(m.group(1), m.group(2), version)
|
||||||
|
sys.stdout.write(line)
|
||||||
|
|
||||||
fmt_repo.checkout('-B', 'release')
|
fmt_repo.checkout('-B', 'release')
|
||||||
fmt_repo.add(changelog, cmakelists)
|
fmt_repo.add(changelog, cmakelists, script)
|
||||||
fmt_repo.commit('-m', 'Update version')
|
fmt_repo.commit('-m', 'Update version')
|
||||||
|
|
||||||
# Build the docs and package.
|
# Build the docs and package.
|
||||||
run = Runner(fmt_repo.dir)
|
run = Runner(fmt_repo.dir)
|
||||||
run('cmake', '.')
|
run('cmake', '.')
|
||||||
run('make', 'doc', 'package_source')
|
run('make', 'doc', 'package_source')
|
||||||
|
|
||||||
update_site(env)
|
update_site(env)
|
||||||
|
|
||||||
# Create a release on GitHub.
|
# Create a release on GitHub.
|
||||||
|
Loading…
Reference in New Issue
Block a user