Some changelog helpers

This commit is contained in:
ChillerDragon 2023-03-18 10:29:28 +01:00
parent 8bdf5ce49c
commit a58ae3aaca
2 changed files with 24 additions and 0 deletions

20
scripts/gen_changelog.sh Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
# credits go to Waku-2
# https://stackoverflow.com/a/46033999/21335246
previous_tag=0
printf "# Changelog\n\n"
for current_tag in $(git tag --sort=-creatordate)
do
if [ "$previous_tag" != 0 ]
then
tag_date=$(git log -1 --pretty=format:'%ad' --date=short "$previous_tag")
printf "## %s (%s)\n\n" "$previous_tag" "$tag_date"
git log "${current_tag}...$previous_tag" --pretty=format:'* %s [View](https://gitlab.com/teeworlds-network/twnet_parser/-/commit/%H)' --reverse | grep -v Merge
printf "\n\n"
fi
previous_tag=${current_tag}
done

View file

@ -223,3 +223,7 @@ fi
git push origin master
git push origin "$tag_name"
echo "Create a release on gitlab with a changelog!"
echo "./scripts/gen_changelog.sh"
echo "https://gitlab.com/teeworlds-network/twnet_parser/-/releases/new?tag_name=$tag_name"