chore: Add git-cliff as a changelog generation tool

Changelogs will be generated using commit messages by
`scripts/release.py`.

Both the commit message and the PR title should follow https://conventionalcommits.org. E.g. start with 'feat:' (for Features / Changes), 'fix:' (for Fixes), 'api:' (for API-Changes), 'api!:' for breaking API-Changes) 'refactor:' (for Refactor), 'perf:' (for Performance), 'test:' (for Tests), 'style:' (for Styling), 'chore:' (for Miscellaneous Tasks)
This commit is contained in:
Hocuri
2023-05-06 15:17:13 +02:00
parent 3a25d6a44e
commit f30a1a3865
4 changed files with 139 additions and 36 deletions

View File

@@ -9,7 +9,14 @@ import subprocess
from argparse import ArgumentParser
rex = re.compile(r'version = "(\S+)"')
json_list = ["package.json", "deltachat-jsonrpc/typescript/package.json"]
toml_list = [
"Cargo.toml",
"deltachat-ffi/Cargo.toml",
"deltachat-jsonrpc/Cargo.toml",
"deltachat-rpc-server/Cargo.toml",
"deltachat-repl/Cargo.toml",
]
def regex_matches(relpath, regex=rex):
p = pathlib.Path(relpath)
@@ -60,31 +67,16 @@ def update_package_json(relpath, newversion):
json.dump(json_data, f, sort_keys=True, indent=2)
f.write("\n")
def main():
parser = ArgumentParser(prog="set_core_version")
parser.add_argument("newversion")
json_list = ["package.json", "deltachat-jsonrpc/typescript/package.json"]
toml_list = [
"Cargo.toml",
"deltachat-ffi/Cargo.toml",
"deltachat-jsonrpc/Cargo.toml",
"deltachat-rpc-server/Cargo.toml",
"deltachat-repl/Cargo.toml",
]
try:
opts = parser.parse_args()
except SystemExit:
def set_version(newversion):
if newversion is None:
print()
for x in toml_list:
print(f"{x}: {read_toml_version(x)}")
for x in json_list:
print(f"{x}: {read_json_version(x)}")
print()
raise SystemExit("need argument: new version, example: 1.25.0")
raise SystemExit("need argument: newversion, example: 1.25.0")
newversion = opts.newversion
if newversion.count(".") < 2:
raise SystemExit("need at least two dots in version")
@@ -134,6 +126,17 @@ def main():
print(f" git push origin v{newversion}")
print("")
def main():
parser = ArgumentParser(prog="set_core_version")
parser.add_argument("newversion")
try:
newversion = parser.parse_args().newversion
except SystemExit:
newversion = None
set_version(newversion)
if __name__ == "__main__":
main()