Skip to content

Commit

Permalink
chore(release): set a custom changelog for the tag message
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Jun 20, 2021
1 parent 9fc08f4 commit c4df0fa
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions release.sh
Original file line number Diff line number Diff line change
@@ -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="[email protected]" \
-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

0 comments on commit c4df0fa

Please sign in to comment.