From c4df0fa892568f1491b62c47d5757fb70b7f4316 Mon Sep 17 00:00:00 2001 From: orhun Date: Sun, 20 Jun 2021 17:08:52 +0300 Subject: [PATCH] chore(release): set a custom changelog for the tag message --- release.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/release.sh b/release.sh index fa730b76af..2a5b92753b 100755 --- a/release.sh +++ b/release.sh @@ -1,13 +1,22 @@ #!/usr/bin/env bash +# takes the tag as an argument (e.g. v0.1.0) if [ -n "$1" ]; then + # update the changelog cargo run -- --tag "$1" > CHANGELOG.md git add -A && git commit -m "chore(release): prepare for $1" + # generate a changelog for the tag message + export TEMPLATE="\ + {% for group, commits in commits | group_by(attribute=\"group\") %} + {{ group | upper_first }}\ + {% for commit in commits %} + - {{ commit.message | upper_first }}\ + {% endfor %} + {% endfor %}" changelog=$(cargo run -- --unreleased --strip all) - changelog=${changelog//### /} - changelog=${changelog//## [unreleased\]/} - git -c user.name="git-cliff" \ - -c user.email="git-cliff@protonmail.com" \ - -c user.signingkey="1D2D410A741137EBC544826F4A92FA17B6619297" \ + # create a tag + git -c user.signingkey="1D2D410A741137EBC544826F4A92FA17B6619297" \ tag -s -a "$1" -m "Release $1" -m "$changelog" +else + echo "warn: please provide a tag" fi