mirror of
https://github.com/chatmail/core.git
synced 2026-05-24 17:26:30 +03:00
build(set_core_version.py): expect release date in the changelog
git-cliff adds the date to the changelog automatically, so set_core_version.py only needs to check that the date is in place.
This commit is contained in:
@@ -7,6 +7,7 @@ import pathlib
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
rex = re.compile(r'version = "(\S+)"')
|
rex = re.compile(r'version = "(\S+)"')
|
||||||
|
|
||||||
@@ -95,22 +96,14 @@ def main():
|
|||||||
today = datetime.date.today().isoformat()
|
today = datetime.date.today().isoformat()
|
||||||
|
|
||||||
if "alpha" not in newversion:
|
if "alpha" not in newversion:
|
||||||
changelog_name = "CHANGELOG.md"
|
|
||||||
changelog_tmpname = changelog_name + ".tmp"
|
|
||||||
changelog_tmp = open(changelog_tmpname, "w")
|
|
||||||
found = False
|
found = False
|
||||||
for line in open(changelog_name):
|
for line in Path("CHANGELOG.md").open():
|
||||||
## 1.25.0
|
if line == f"## [{newversion}] - {today}\n":
|
||||||
if line == f"## [{newversion}]\n":
|
|
||||||
line = f"## [{newversion}] - {today}\n"
|
|
||||||
found = True
|
found = True
|
||||||
changelog_tmp.write(line)
|
|
||||||
if not found:
|
if not found:
|
||||||
raise SystemExit(
|
raise SystemExit(
|
||||||
f"{changelog_name} contains no entry for version: {newversion}"
|
f"{changelog_name} contains no entry for version: {newversion}"
|
||||||
)
|
)
|
||||||
changelog_tmp.close()
|
|
||||||
os.rename(changelog_tmpname, changelog_name)
|
|
||||||
|
|
||||||
for toml_filename in toml_list:
|
for toml_filename in toml_list:
|
||||||
replace_toml_version(toml_filename, newversion)
|
replace_toml_version(toml_filename, newversion)
|
||||||
|
|||||||
Reference in New Issue
Block a user