Skip to content

Commit 00235a3

Browse files
committed
✨ Add release notes generation to release script
Add post-release display of generated release notes to stdout - Add generate_release_notes_to_stdout() function to display notes after successful release completion - Function uses git-iris release-notes command with proper version tags - Displays formatted header with project name and version - Handles subprocess errors gracefully with warning messages - Call new function at end of main() after successful release Provides immediate visibility into what was included in the release without requiring separate command execution.
1 parent a0766c6 commit 00235a3

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

scripts/release.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,39 @@ def is_valid_version(version: str) -> bool:
294294
return re.match(r"^\d+\.\d+\.\d+$", version) is not None
295295

296296

297+
def generate_release_notes_to_stdout(current_version: str, new_version: str) -> None:
298+
"""Generate and display release notes to stdout using git-iris."""
299+
print_step("Generating release notes to stdout")
300+
from_tag = f"v{current_version}"
301+
to_tag = f"v{new_version}"
302+
303+
try:
304+
print_colored(
305+
f"\n🎯 Release Notes for {PROJECT_NAME} v{new_version}", COLOR_SUCCESS
306+
)
307+
print_colored("=" * 60, COLOR_BORDER)
308+
309+
# Generate release notes and output to stdout
310+
subprocess.run(
311+
[
312+
"cargo",
313+
"run",
314+
"--",
315+
"release-notes",
316+
"--from",
317+
from_tag,
318+
"--to",
319+
to_tag,
320+
"--version-name",
321+
new_version,
322+
],
323+
check=True,
324+
)
325+
326+
except subprocess.CalledProcessError as e:
327+
print_warning(f"Could not generate release notes: {str(e)}")
328+
329+
297330
def main() -> None:
298331
"""Main function to handle the release process."""
299332
print_logo()
@@ -331,6 +364,9 @@ def main() -> None:
331364
f"\n🎉✨ {PROJECT_NAME} v{new_version} has been successfully released! ✨🎉"
332365
)
333366

367+
# Generate and display release notes to stdout
368+
generate_release_notes_to_stdout(current_version, new_version)
369+
334370

335371
if __name__ == "__main__":
336372
main()

0 commit comments

Comments
 (0)