Skip to content

Commit 0306826

Browse files
Announce GitHub releases in Discord (#5314)
## Summary - Add a Discord announcement job for published GitHub releases. - Use `DISCORD_WEBHOOK_RELEASE_CHANNEL_URL` so the target channel can be configured as a GitHub secret. - Run the announcement job even if Docker `latest` retagging fails, and include the retag result in the message. ## Verification - `ruby -e 'require "yaml"; YAML.load_file(".github/workflows/tag-release.yml")'` - `git diff --check` --------- Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com> Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com> Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
1 parent d93b381 commit 0306826

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/tag-release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ on:
22
release:
33
types: [published]
44

5+
permissions: {}
6+
57
jobs:
68
on-release:
79
name: Re-tag latest
@@ -21,3 +23,18 @@ jobs:
2123
run: |
2224
VERSION=${GITHUB_REF#refs/*/}
2325
docker buildx imagetools create clockworklabs/spacetimedb:$VERSION --tag clockworklabs/spacetimedb:latest
26+
27+
announce-release:
28+
name: Announce GitHub release
29+
runs-on: ubuntu-latest
30+
needs: on-release
31+
if: always()
32+
steps:
33+
- name: Send Discord notification
34+
run: |
35+
set -euo pipefail
36+
37+
message="SpacetimeDB GitHub release published: [${{ github.event.release.name }}](<${{ github.event.release.html_url }}>)"
38+
39+
data="$(jq --null-input --arg msg "$message" '.content=$msg')"
40+
curl -X POST -H 'Content-Type: application/json' -d "$data" "${{ secrets.DISCORD_WEBHOOK_RELEASE_ANNOUNCE_URL }}"

0 commit comments

Comments
 (0)