mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Change release script to update debian changelog for RCs (#10465)
This commit is contained in:
parent
6e2275649c
commit
92a882254b
1
changelog.d/10465.misc
Normal file
1
changelog.d/10465.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix release script to correctly version debian changelog when doing RCs.
|
@ -139,6 +139,11 @@ def run():
|
|||||||
|
|
||||||
# Switch to the release branch.
|
# Switch to the release branch.
|
||||||
parsed_new_version = version.parse(new_version)
|
parsed_new_version = version.parse(new_version)
|
||||||
|
|
||||||
|
# We assume for debian changelogs that we only do RCs or full releases.
|
||||||
|
assert not parsed_new_version.is_devrelease
|
||||||
|
assert not parsed_new_version.is_postrelease
|
||||||
|
|
||||||
release_branch_name = (
|
release_branch_name = (
|
||||||
f"release-v{parsed_new_version.major}.{parsed_new_version.minor}"
|
f"release-v{parsed_new_version.major}.{parsed_new_version.minor}"
|
||||||
)
|
)
|
||||||
@ -190,12 +195,21 @@ def run():
|
|||||||
# Generate changelogs
|
# Generate changelogs
|
||||||
subprocess.run("python3 -m towncrier", shell=True)
|
subprocess.run("python3 -m towncrier", shell=True)
|
||||||
|
|
||||||
# Generate debian changelogs if its not an RC.
|
# Generate debian changelogs
|
||||||
if not rc:
|
if parsed_new_version.pre is not None:
|
||||||
subprocess.run(
|
# If this is an RC then we need to coerce the version string to match
|
||||||
f'dch -M -v {new_version} "New synapse release {new_version}."', shell=True
|
# Debian norms, e.g. 1.39.0rc2 gets converted to 1.39.0~rc2.
|
||||||
)
|
base_ver = parsed_new_version.base_version
|
||||||
subprocess.run('dch -M -r -D stable ""', shell=True)
|
pre_type, pre_num = parsed_new_version.pre
|
||||||
|
debian_version = f"{base_ver}~{pre_type}{pre_num}"
|
||||||
|
else:
|
||||||
|
debian_version = new_version
|
||||||
|
|
||||||
|
subprocess.run(
|
||||||
|
f'dch -M -v {debian_version} "New synapse release {debian_version}."',
|
||||||
|
shell=True,
|
||||||
|
)
|
||||||
|
subprocess.run('dch -M -r -D stable ""', shell=True)
|
||||||
|
|
||||||
# Show the user the changes and ask if they want to edit the change log.
|
# Show the user the changes and ask if they want to edit the change log.
|
||||||
repo.git.add("-u")
|
repo.git.add("-u")
|
||||||
|
Loading…
Reference in New Issue
Block a user