From e737c6d617427976665dd8d6f399f1355c7792a9 Mon Sep 17 00:00:00 2001 From: Kenny Van de Maele Date: Fri, 20 Nov 2026 20:20:13 +0100 Subject: [PATCH] ci: announce editor releases on Discord Post the editor release once its builds and checksums are attached. --- .github/workflows/release.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d8ae64..1e21ebd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -137,3 +137,26 @@ jobs: gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --notes "$note $changelog" + + announce: + needs: [release-please, attach] + runs-on: ubuntu-latest + permissions: {} + steps: + - name: Post the editor release to Discord + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELEASES_WEBHOOK }} + TAG: ${{ needs.release-please.outputs.tag }} + run: | + if [ -z "$DISCORD_WEBHOOK" ]; then + printf '%s\n' 'Discord webhook is not configured.' + exit 0 + fi + release_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/releases/tag/$TAG" + editor_page="https://openreliant.github.io/openreliant/#editor" + payload=$(jq -cn --arg title "OpenReliant Editor $TAG" --arg page "$editor_page" --arg url "$release_url" \ + '{content: ("**" + $title + "**\n[Editor page](" + $page + ") ยท [Release notes](" + $url + ")"), + allowed_mentions: {parse: []}}') + curl --fail --silent --show-error --retry 3 --retry-max-time 40 --max-time 15 \ + --output /dev/null --header 'Content-Type: application/json' \ + --data "$payload" "$DISCORD_WEBHOOK?wait=true"