CICD: Add a File Containing the Release Title to CICD Releases.

Add a file containing the release title (derived from the pull request
title / commit message) to CICD releases - this is so that it will be
able to pick this up by the process updating the release pages on our
webserver, and show a list of the last few changes for each release.

Signed-off-by: Michael Keller <mikeller@042.ch>
This commit is contained in:
Michael Keller 2024-02-01 10:14:20 +13:00 committed by Dirk Hohndel
parent 94a7ba9097
commit 9cdb9f7989
3 changed files with 20 additions and 15 deletions

View file

@ -8,19 +8,23 @@ json=$(gh pr list -s merged -S "$1" --json title,number,url)
cp gh_release_notes_top.md gh_release_notes.md
if [[ $json != "[]" ]]; then
(
echo -n 'This build was created by [merging pull request '
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.md
echo -n $json | jq -j '.[0]|{title}|join(" ")' > release_content_title.txt
(
echo -n 'This build was created by [merging pull request '
echo -n $json | jq -j '.[0]|{number}|join(" ")'
echo -n ' ('
cat release_content_title.txt
echo -n ')]('
echo -n $json | jq -j '.[0]|{url}|join(" ")'
echo ' )'
) >> gh_release_notes.md
else
(
echo "This build was created by directly pushing to the Subsurface repo."
echo "The latest commit was [$(git log --pretty=format:"%an: '%s'" -n1)](https://github.com/subsurface/subsurface/commit/$1 )"
) >> gh_release_notes.md
git log --pretty=format:"%an: '%s'" -n1 > release_content_title.txt
(
echo "This build was created by directly pushing to the Subsurface repo."
echo "The latest commit was [$(cat release_content_title.txt)](https://github.com/subsurface/subsurface/commit/$1 )"
) >> gh_release_notes.md
fi
cat gh_release_notes_bottom.md >> gh_release_notes.md