1.7 KiB
1.7 KiB
Release Enhance Shortcuts
Submitter: Wang Yue
This change adds two new release shortcuts for getting the latest release and auto-generating release notes.
Commands
- Add
release +latestfor getting the latest release version. - Add
release +auto-notesfor auto-generating release notes from commits and issues.
Behavior
release +latest
- Fetches releases from the repository and returns the first matching release.
- By default, skips draft and prerelease versions.
- Supports
--include-prereleaseflag to include prerelease versions. - Supports
--include-draftflag to include draft versions. - Returns error if no matching release is found.
release +auto-notes
- Generates formatted release notes from commit messages and closed issues.
- Automatically categorizes commits by prefix:
feat:→ 🚀 新功能 (New Features)fix:→ 🐛 Bug 修复 (Bug Fixes)- Others → 📝 其他变更 (Other Changes)
- Supports
--from-tagto specify the starting tag for comparison. - If
--from-tagis not specified, uses the last 50 commits. - Includes closed issues in the "Related Issues" section.
- Supports
--format jsonto output with statistics (commits_count, issues_count).
Verification
- Unit tests cover:
TestReleaseLatest: Basic latest release retrievalTestReleaseLatestWithPrerelease: Including prerelease versionsTestReleaseLatestSkipsDraft: Skipping draft versionsTestReleaseLatestNoReleases: Error handling when no releasesTestReleaseAutoNotes: Basic auto-notes generationTestReleaseAutoNotesWithFromTag: Using from-tag parameterTestReleaseAutoNotesJSONFormat: JSON format output with statistics