chore: genReleaseNote support verrsion range
This commit updates the release script to handle the input version range provided via command line options. Now, you can specify the version range using the '-v' option, such as '-v v1.14.1...v1.14.2', and the script will generate the release notes based on the specified range. The script parses the command line options, extracts the version range, and uses it in the 'git log' commands to capture the relevant commits. The output is then organized into different sections, including 'What's Changed', 'BUG & Fix', and 'Maintenance', along with the full changelog link. This enhancement improves the flexibility and usability of the release script, allowing users to generate release notes for specific version ranges easily. Co-authored-by: ChatGPT
This commit is contained in:
parent
47ad8e08be
commit
fb6a032872
33
.github/genReleaseNote.sh
vendored
33
.github/genReleaseNote.sh
vendored
@ -1 +1,32 @@
|
|||||||
git log --pretty=format:"* %s by @%an" v1.14.x..v1.14.y | sort -f | uniq > release.md
|
#!/bin/bash
|
||||||
|
|
||||||
|
while getopts "v:" opt; do
|
||||||
|
case $opt in
|
||||||
|
v)
|
||||||
|
version_range=$OPTARG
|
||||||
|
;;
|
||||||
|
\?)
|
||||||
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$version_range" ]; then
|
||||||
|
echo "Please provide the version range using -v option. Example: ./genReleashNote.sh -v v1.14.1...v1.14.2"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "## What's Changed" > release.md
|
||||||
|
git log --pretty=format:"* %s by @%an" --grep="^feat" $version_range | sort -f | uniq >> release.md
|
||||||
|
echo "" >> release.md
|
||||||
|
|
||||||
|
echo "## BUG & Fix" >> release.md
|
||||||
|
git log --pretty=format:"* %s by @%an" --grep="^fix" $version_range | sort -f | uniq >> release.md
|
||||||
|
echo "" >> release.md
|
||||||
|
|
||||||
|
echo "## Maintenance" >> release.md
|
||||||
|
git log --pretty=format:"* %s by @%an" --grep="^chore\|^docs" $version_range | sort -f | uniq >> release.md
|
||||||
|
echo "" >> release.md
|
||||||
|
|
||||||
|
echo "**Full Changelog**: https://github.com/MetaCubeX/Clash.Meta/compare/$version_range" >> release.md
|
||||||
|
Reference in New Issue
Block a user