build: fix release regex

This commit is contained in:
Daylin Morgan 2023-09-21 14:50:46 -05:00
parent ac02151a51
commit 3fe4110e06
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -46,11 +46,14 @@ def release():
next = f"{datetime.now().year}.{inc_build(build)}" next = f"{datetime.now().year}.{inc_build(build)}"
msg = f"bump {current} -> {next}" msg = f"bump {current} -> {next}"
FILE.write_text( FILE.write_text(
re.sub(r'__version__ = "[\d\.]+"', f'__version__ = "{next}"', FILE.read_text()) re.sub(r'__version__ = ".*"', f'__version__ = "{next}"', FILE.read_text())
) )
subprocess.run(["git", "add", FILE]) subprocess.run(["git", "add", FILE])
subprocess.run(["git", "commit", "-m", msg, "--no-verify"]) subprocess.run(["git", "commit", "-m", msg, "--no-verify"])
subprocess.run(["git", "tag", f"v{next}"]) subprocess.run(["git", "tag", f"v{next}"])
FILE.write_text(
re.sub(r'__version__ = ".*"', f'__version__ = "{next}-dev"', FILE.read_text())
)
if __name__ == "__main__": if __name__ == "__main__":