Repos / shark / 4b682a270d
commit 4b682a270da5715a0e288b5219f3d1865176aade
Author: Nhân <hi@imnhan.com>
Date:   Fri Jul 8 00:05:48 2022 +0700

    add tag helper script; block-quote GH release note

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 14de397..a7900fe 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -59,7 +59,9 @@ jobs:
           # https://github.com/actions/checkout/issues/290
           git fetch --force --tags
 
-          git tag -l --format='%(contents)' "$TAG" > RELEASE_NOTES
+          echo '```' > RELEASE_NOTES
+          git tag -l --format='%(contents)' "$TAG" >> RELEASE_NOTES
+          echo '```' >> RELEASE_NOTES
           cat RELEASE_NOTES
           gh release create "$TAG" dist/* -F RELEASE_NOTES
         fi
diff --git a/scripts/tag.sh b/scripts/tag.sh
new file mode 100755
index 0000000..34569d1
--- /dev/null
+++ b/scripts/tag.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env sh
+set -euf
+
+# Usage: ./scripts/tag.sh v0.0.0
+# which will open an annotated tag editor prefilled with a shortlog comparing
+# against the previous tag.
+
+PREVIOUS_TAG=$(git describe --abbrev=0 HEAD^1)
+SHORTLOG=$(git shortlog "$PREVIOUS_TAG..HEAD")
+
+printf "CHANGEME\n\n%s" "$SHORTLOG" | git tag "$1" --file -
+git tag "$1" -f -a