@@ -69,48 +69,6 @@ def update_cargo_toml(version: str) -> None:
6969 path .write_text (new_text )
7070
7171
72- def update_changelog (new_version : str ) -> None :
73- path = Path ("CHANGELOG.md" )
74- text = path .read_text ()
75-
76- match = re .search (
77- r"^## \[Unreleased\]\(https://github\.com/ouch-org/ouch/compare/([^)]*)\.\.\.HEAD\)$" ,
78- text ,
79- flags = re .MULTILINE ,
80- )
81- if not match :
82- die ("Could not find previous version in CHANGELOG.md Unreleased compare link" )
83-
84- previous = match .group (1 ) # pyright: ignore[reportOptionalMemberAccess]
85- old = match .group (0 ) # pyright: ignore[reportOptionalMemberAccess]
86- new = (
87- f"## [Unreleased](https://github.com/ouch-org/ouch/compare/{ new_version } ...HEAD)\n \n "
88- "### New Features\n \n "
89- "### Improvements\n \n "
90- "### Bug Fixes\n \n "
91- "### Tweaks\n \n \n "
92- f"## [{ new_version } ](https://github.com/ouch-org/ouch/compare/{ previous } ...{ new_version } )"
93- )
94- path .write_text (text .replace (old , new , 1 ))
95-
96-
97- def ask_user_to_review_changelog () -> None :
98- print ("CHANGELOG.md was updated." )
99- print ("Please review it before continuing." )
100- try :
101- answer = input ('Continue? Type "y" to continue: ' )
102- except KeyboardInterrupt :
103- die (
104- "Aborted. The script is halting and leaving the workspace dirty; "
105- "restore changes manually before continuing."
106- )
107- if answer != "y" :
108- die (
109- "Aborted. The script is halting and leaving the workspace dirty; "
110- "restore changes manually before continuing."
111- )
112-
113-
11472def ensure_no_tracked_changes () -> None :
11573 status = run ("git" , "status" , "--short" , capture = True )
11674 tracked_changes = [
@@ -172,11 +130,9 @@ def main() -> None:
172130 ensure_on_origin_main ()
173131 ensure_no_tracked_changes ()
174132 tag = next_rc_tag (args .version )
175- update_changelog (args .version )
176- ask_user_to_review_changelog ()
177133 update_cargo_toml (args .version )
178134 run ("cargo" , "test" , "--profile" , "fast" )
179- run ("git" , "add" , "CHANGELOG.md" , " Cargo.lock" , "Cargo.toml" )
135+ run ("git" , "add" , "Cargo.lock" , "Cargo.toml" )
180136 run ("git" , "commit" , "-m" , f"bump version { args .version } " )
181137 run ("git" , "tag" , tag )
182138 run ("git" , "push" , "origin" , tag )
0 commit comments