build-system: assemble release notes using gh CLI

Instead of using a thirdparty action and painfully passing things around,
simply use the GitHub CLI (gh) and assemble the release notes on the fly.

This makes for much simpler and much easier to maintain code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2024-01-09 15:10:12 -08:00
parent 867d31bcbc
commit 14e715be6e
7 changed files with 39 additions and 79 deletions

View file

@ -2,7 +2,19 @@
# use to assemble the details for our release notes and write them to a file
#
# Usage: create-releasenotes.sh pr_num pr_url pr_title commit_id commit_url
# Usage: create-releasenotes.sh merge_sha
sed "s/PRNUM/$1/;s/PRURL/$2/;s/PRTITLE/$3/;s/COMMITID/$4/;s/COMMITURL/$5/" < gh_release_notes.in > gh_release_notes
json=$(gh pr list -s merged -S "$1" --json title,number,url)
cp gh_release_notes_top gh_release_notes
(
echo -n 'This build was created by [merging PR'
echo -n $json | jq -j '.[0]|{number}|join(" ")'
echo -n '('
echo -n $json | jq -j '.[0]|{title}|join(" ")'
echo -n ')]('
echo -n $json | jq -j '.[0]|{url}|join(" ")'
echo ' )'
) >> gh_release_notes
cat gh_release_notes_bottom >> gh_release_notes