Skip to content

Commit 4785275

Browse files
Merge commit '4e51484c1254322cf1850170c6d0217ab66c191d' into develop
2 parents e864dde + 4e51484 commit 4785275

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/scripts/prepare_release.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ def bump_version_number(version_number: str, level: str) -> str:
3939
major, minor, patch = version_number.split(".")
4040
if level == "major":
4141
major = str(int(major)+1)
42+
minor = "0"
43+
patch = "0"
4244
elif level == "minor":
4345
minor = str(int(minor)+1)
46+
patch = "0"
4447
elif level == "patch":
4548
patch = str(int(patch)+1)
4649
else:
@@ -111,7 +114,7 @@ def update_changelog(nvn):
111114
if "release date: " in line.lower():
112115
today = time.strftime("%Y-%m-%d")
113116
lines[i] = f"Release date: {today}"
114-
changelog.write("\n".join(lines).replace("\n\n", "\n"))
117+
changelog.write(re.sub("\n+$", "\n", "\n".join(lines)))
115118
changelog.write("\n")
116119
return GitFile('CHANGELOG.md')
117120

0 commit comments

Comments
 (0)