Add way to override changelog used for release (#53)

This commit is contained in:
Caedis 2025-10-27 13:39:30 -05:00 committed by GitHub
parent 7efb286761
commit 3b8ebe9c6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,12 +76,20 @@ jobs:
if [[ "$SNAPSHOT" == "true" ]]; then
PRERELEASE="--prerelease"
fi
export "CHANGELOG_FILE=$(mktemp --suffix=.md)"
echo "CHANGELOG_FILE=${CHANGELOG_FILE}" >> $GITHUB_ENV
gh api --method POST -H "Accept: application/vnd.github+json" \
"/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
-f tag_name="${RELEASE_VERSION}" \
--jq ".body" > "${CHANGELOG_FILE}"
CHANGELOG_OVERRIDE=".changelogs/${RELEASE_VERSION}.md"
if [[ -f "$CHANGELOG_OVERRIDE" ]]; then
echo "Using changelog override: $CHANGELOG_OVERRIDE"
export "CHANGELOG_FILE=$CHANGELOG_OVERRIDE"
echo "CHANGELOG_FILE=${CHANGELOG_FILE}" >> $GITHUB_ENV
else
echo "Generating changelog notes..."
export "CHANGELOG_FILE=$(mktemp --suffix=.md)"
echo "CHANGELOG_FILE=${CHANGELOG_FILE}" >> $GITHUB_ENV
gh api --method POST -H "Accept: application/vnd.github+json" \
"/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
-f tag_name="${RELEASE_VERSION}" \
--jq ".body" > "${CHANGELOG_FILE}"
fi
cat "${CHANGELOG_FILE}"
gh release create "${RELEASE_VERSION}" -F "${CHANGELOG_FILE}" $PRERELEASE ./build/libs/*.jar
shell: bash