mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-07-03 11:16:42 -04:00
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>
This commit is contained in:
committed by
GitHub
parent
d93b381719
commit
0306826613
@@ -2,6 +2,8 @@ on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
on-release:
|
||||
name: Re-tag latest
|
||||
@@ -21,3 +23,18 @@ jobs:
|
||||
run: |
|
||||
VERSION=${GITHUB_REF#refs/*/}
|
||||
docker buildx imagetools create clockworklabs/spacetimedb:$VERSION --tag clockworklabs/spacetimedb:latest
|
||||
|
||||
announce-release:
|
||||
name: Announce GitHub release
|
||||
runs-on: ubuntu-latest
|
||||
needs: on-release
|
||||
if: always()
|
||||
steps:
|
||||
- name: Send Discord notification
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
message="SpacetimeDB GitHub release published: [${{ github.event.release.name }}](<${{ github.event.release.html_url }}>)"
|
||||
|
||||
data="$(jq --null-input --arg msg "$message" '.content=$msg')"
|
||||
curl -X POST -H 'Content-Type: application/json' -d "$data" "${{ secrets.DISCORD_WEBHOOK_RELEASE_ANNOUNCE_URL }}"
|
||||
|
||||
Reference in New Issue
Block a user