diff options
author | Victor Zverovich <viz@meta.com> | 2023-12-30 06:53:20 -0800 |
---|---|---|
committer | Victor Zverovich <viz@meta.com> | 2023-12-30 06:53:20 -0800 |
commit | 3324152db41b5c422368fad701a98c09f9c49d14 (patch) | |
tree | 41e3a70349ac7029c13315437111ecc25c1c2152 | |
parent | 55190dadb5f844f6ef91f5dd45160470f95d5d9e (diff) | |
download | fmtlib-3324152db41b5c422368fad701a98c09f9c49d14.tar.gz |
Update the release script
-rwxr-xr-x | support/manage.py | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/support/manage.py b/support/manage.py index 36f61d9b..408d1062 100755 --- a/support/manage.py +++ b/support/manage.py @@ -229,12 +229,17 @@ def release(args): if not fmt_repo.update('-b', branch, fmt_repo_url): clean_checkout(fmt_repo, branch) - # Convert changelog from RST to GitHub-flavored Markdown and get the - # version. + # Update the date in the changelog. changelog = 'ChangeLog.md' changelog_path = os.path.join(fmt_repo.dir, changelog) - import rst2md - changes, version = rst2md.convert(changelog_path) + title_len = 0 + for line in fileinput.input(changelog_path, inplace=True): + m = re.match(r'# (.*) - TBD', line) + if m: + version = m.group(1) + line = version + ' - ' + datetime.date.today().isoformat() + '\n' + sys.stdout.write(line) + cmakelists = 'CMakeLists.txt' for line in fileinput.input(os.path.join(fmt_repo.dir, cmakelists), inplace=True): @@ -243,18 +248,6 @@ def release(args): line = prefix + version + ')\n' sys.stdout.write(line) - # Update the version in the changelog. - title_len = 0 - for line in fileinput.input(changelog_path, inplace=True): - if line.startswith(version + ' - TBD'): - line = version + ' - ' + datetime.date.today().isoformat() - title_len = len(line) - line += '\n' - elif title_len: - line = '-' * title_len + '\n' - title_len = 0 - sys.stdout.write(line) - # Add the version to the build script. script = os.path.join('doc', 'build.py') script_path = os.path.join(fmt_repo.dir, script) |