diff --git a/scripts/gen_changelog.sh b/scripts/gen_changelog.sh new file mode 100755 index 0000000..ccf03b7 --- /dev/null +++ b/scripts/gen_changelog.sh @@ -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 diff --git a/scripts/release.sh b/scripts/release.sh index 43b83ca..6c67f90 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -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" +