Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,22 @@ jobs:

- name: Publish GitHub release
run: cargo-release release github-release ${{ github.event.inputs.release_tag }}

- name: Trigger release notifications
if: ${{ !inputs.dry_run }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.event.inputs.release_tag }}
run: |
set -euo pipefail

release_json="$(gh release view "$RELEASE_TAG" --repo clockworklabs/SpacetimeDB --json body,url)"
body="$(jq -r '.body' <<< "$release_json")"
url="$(jq -r '.url' <<< "$release_json")"

jq -n \
--arg tag "$RELEASE_TAG" \
--arg url "$url" \
--arg body "$body" \
'{release_tag: $tag, release_url: $url, release_body: $body, dry_run: "false"}' \
| gh workflow run tag-release.yml --repo clockworklabs/SpacetimeDB --ref master --json
19 changes: 16 additions & 3 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,29 @@ jobs:
announce-release:
name: Announce GitHub release (Internal)
runs-on: ubuntu-latest
if: github.event_name == 'release'
if: >-
${{
github.event_name == 'release'
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run != 'true')
}}
steps:
- name: Send Discord notification
env:
RELEASE_NAME: ${{ github.event.release.name || github.event.inputs.release_tag }}
RELEASE_URL: ${{ github.event.release.html_url || github.event.inputs.release_url }}
DRY_RUN: ${{ github.event.inputs.dry_run }}
run: |
set -euo pipefail

message="SpacetimeDB GitHub release published: [${{ github.event.release.name }}](<${{ github.event.release.html_url }}>)"
message="SpacetimeDB GitHub release published: [${RELEASE_NAME}](<${RELEASE_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 }}"
if [ "${DRY_RUN}" = "true" ]; then
echo "=== DRY RUN ==="
echo "$data" | jq .
else
curl -X POST -H 'Content-Type: application/json' -d "$data" "${{ secrets.DISCORD_WEBHOOK_RELEASE_ANNOUNCE_URL }}"
fi

# Public announcement with full release notes
public-discord-notification:
Expand Down
Loading