github.com/metacubex/mihomo@v1.18.5/.github/genReleaseNote.sh (about) 1 #!/bin/bash 2 3 while getopts "v:" opt; do 4 case $opt in 5 v) 6 version_range=$OPTARG 7 ;; 8 \?) 9 echo "Invalid option: -$OPTARG" >&2 10 exit 1 11 ;; 12 esac 13 done 14 15 if [ -z "$version_range" ]; then 16 echo "Please provide the version range using -v option. Example: ./genReleashNote.sh -v v1.14.1...v1.14.2" 17 exit 1 18 fi 19 20 echo "## What's Changed" > release.md 21 git log --pretty=format:"* %h %s by @%an" --grep="^feat" -i $version_range | sort -f | uniq >> release.md 22 echo "" >> release.md 23 24 echo "## BUG & Fix" >> release.md 25 git log --pretty=format:"* %h %s by @%an" --grep="^fix" -i $version_range | sort -f | uniq >> release.md 26 echo "" >> release.md 27 28 echo "## Maintenance" >> release.md 29 git log --pretty=format:"* %h %s by @%an" --grep="^chore\|^docs\|^refactor" -i $version_range | sort -f | uniq >> release.md 30 echo "" >> release.md 31 32 echo "**Full Changelog**: https://github.com/MetaCubeX/mihomo/compare/$version_range" >> release.md