feat: add discord automated release notifications (#564)

This commit is contained in:
Zach
2026-04-22 17:27:39 -04:00
committed by Zach Yale
parent 9c3ecc58d4
commit e65536de1c
11 changed files with 938 additions and 59 deletions
+65
View File
@@ -131,6 +131,71 @@ jobs:
release_tag: ${{ needs.semantic-release.outputs.release_tag }}
commit_sha: ${{ needs.semantic-release.outputs.release_sha }}
prepare-release-notification:
name: Prepare Stable Release Notification
if: ${{ needs.semantic-release.outputs.released == 'true' && needs.publish-release.result == 'success' }}
needs: [semantic-release, publish-release]
runs-on: ubuntu-latest
outputs:
base_tag: ${{ steps.metadata.outputs.base_tag }}
compare_url: ${{ steps.metadata.outputs.compare_url }}
release_url: ${{ steps.metadata.outputs.release_url }}
release_version: ${{ steps.metadata.outputs.release_version }}
permissions:
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
ref: ${{ needs.semantic-release.outputs.release_sha }}
- name: Extract Stable Release Metadata
id: metadata
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN != '' && secrets.RELEASE_BOT_TOKEN || github.token }}
RELEASE_TAG: ${{ needs.semantic-release.outputs.release_tag }}
run: |
set -eu
git fetch origin main --tags --force
release_json="$(gh release view "$RELEASE_TAG" --json body,url)"
release_version="${RELEASE_TAG#v}"
base_tag="$(git tag --sort=-version:refname 'v*' | grep -Fxv "$RELEASE_TAG" | head -n 1 || true)"
compare_url=""
release_url="$(printf '%s' "$release_json" | jq -r '.url')"
if [ -n "$base_tag" ]; then
compare_url="https://github.com/${GITHUB_REPOSITORY}/compare/${base_tag}...${RELEASE_TAG}"
fi
{
echo "base_tag=${base_tag}"
echo "compare_url=${compare_url}"
echo "release_url=${release_url}"
echo "release_version=${release_version}"
} >> "$GITHUB_OUTPUT"
notify-discord:
name: Notify Discord (Stable)
if: ${{ needs.semantic-release.outputs.released == 'true' && needs.publish-release.result == 'success' && needs.prepare-release-notification.result == 'success' }}
needs: [semantic-release, publish-release, prepare-release-notification]
permissions: {}
uses: ./.github/workflows/notify-discord-release-notes.yml
secrets:
discord_webhook: ${{ secrets.DISCORD_STABLE_WEBHOOK != '' && secrets.DISCORD_STABLE_WEBHOOK || secrets.DISCORD_RELEASE_WEBHOOK }}
with:
channel: stable
candidate_sha: ${{ needs.semantic-release.outputs.release_sha }}
base_tag: ${{ needs.prepare-release-notification.outputs.base_tag }}
current_version: ${{ needs.semantic-release.outputs.release_tag }}
details_url: ${{ needs.prepare-release-notification.outputs.release_url }}
compare_url: ${{ needs.prepare-release-notification.outputs.compare_url }}
mention_text: ${{ vars.DISCORD_STABLE_MENTIONS }}
predicted_version: ${{ needs.prepare-release-notification.outputs.release_version }}
backport-release:
name: Backport Release Commit to Develop
if: ${{ needs.semantic-release.outputs.released == 'true' && needs.publish-release.result == 'success' }}