Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

ci(release): announce off the release itself, not off the ceremony that made it

Etienne Lescot7d9329167fa3
diff --git a/.github/workflows/announce-release.yml b/.github/workflows/announce-release.yml
index de53beafe..078195c88 100644
--- a/.github/workflows/announce-release.yml
+++ b/.github/workflows/announce-release.yml
@@ -5,12 +5,28 @@
# failure, with no way to send it afterwards short of re-running the whole
# promotion over an already-tagged release.
#
-# This exposes the same script on its own, so a missed announcement is a dispatch
-# rather than a recovery operation. It reads nothing but the tag and the matching
-# milestone, so it produces the identical message whenever it runs.
+# It now runs off the release itself, which is the only event every path shares.
+# Being a step of the two ceremony workflows meant it announced what those two
+# workflows happened to do, not what actually shipped: a release cut by pushing a
+# tag straight to build.yml — which is how 1.9.2 shipped — went out silent,
+# because neither ceremony ran. Worse, prerelease.yml announced immediately after
+# DISPATCHING build.yml rather than after it finished, so the RC message could
+# precede the artifacts it pointed at by the length of a full matrix build.
+#
+# `release: published` fires for both, and `github.event.release.prerelease`
+# already carries the stable/rc distinction that was previously hand-passed. This
+# works only because build.yml creates the release with OPENSCREEN_RELEASE_TOKEN:
+# releases created with the default GITHUB_TOKEN trigger no workflows at all.
+#
+# The dispatch inputs stay, for the case this was extracted for — a missed
+# announcement is still a dispatch rather than a recovery operation. The script
+# reads nothing but the tag and the matching milestone, so it produces the
+# identical message whichever way it is entered.
name: Announce a release on Discord
on:
+ release:
+ types: [published]
workflow_dispatch:
inputs:
tag:
@@ -34,12 +50,24 @@ permissions:
jobs:
announce:
- name: Announce ${{ inputs.tag }}
+ name: Announce ${{ inputs.tag || github.event.release.tag_name }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
+ # Resolved once, in one place, because the channel selection below needs to
+ # branch on `kind` and a step cannot read an `env:` entry declared beside it.
+ # On a release event `inputs.*` are empty strings, which GitHub expressions
+ # treat as falsy, so `||` picks the event side without any explicit test.
+ - name: Resolve what is being announced
+ id: ctx
+ run: |
+ {
+ echo "tag=${{ inputs.tag || github.event.release.tag_name }}"
+ echo "kind=${{ inputs.kind || (github.event.release.prerelease && 'rc' || 'stable') }}"
+ } >> "$GITHUB_OUTPUT"
+
- name: Setup Node.js
uses: ./.github/actions/setup
@@ -49,19 +77,20 @@ jobs:
# The script prefers the RC channel whenever that variable is non-empty,
# so exactly one of these may be set — blanking the other is what selects
# the destination, not the KIND value.
- DISCORD_RELEASE_CHANNEL_ID: ${{ inputs.kind == 'stable' && vars.DISCORD_RELEASE_CHANNEL_ID || '' }}
- DISCORD_RC_TESTING_CHANNEL_ID: ${{ inputs.kind == 'rc' && vars.DISCORD_RC_TESTING_CHANNEL_ID || '' }}
+ DISCORD_RELEASE_CHANNEL_ID: ${{ steps.ctx.outputs.kind == 'stable' && vars.DISCORD_RELEASE_CHANNEL_ID || '' }}
+ DISCORD_RC_TESTING_CHANNEL_ID: ${{ steps.ctx.outputs.kind == 'rc' && vars.DISCORD_RC_TESTING_CHANNEL_ID || '' }}
# Only used to list the closed issues of the matching milestone; the
# announcement still posts without it, just without that section.
GITHUB_TOKEN: ${{ secrets.OPENSCREEN_RELEASE_TOKEN }}
- STABLE_TAG: ${{ inputs.tag }}
+ STABLE_TAG: ${{ steps.ctx.outputs.tag }}
EXTRA: ${{ inputs.release_notes_extra }}
- KIND: ${{ inputs.kind }}
+ KIND: ${{ steps.ctx.outputs.kind }}
# Every path that ends without posting exits 0 by default, which is what
- # prerelease.yml and promote.yml need — the release is already out and a
- # failed announcement must not report it as broken. Here the contract is
- # inverted: this workflow is dispatched *because* an announcement was
- # missed, so a green run that posted nothing would recreate exactly the
- # failure it was invoked to repair. That is how v1.9.0 shipped silent.
+ # this was when it lived inside prerelease.yml and promote.yml — the
+ # release was already out, and a failed announcement had to not report it
+ # as broken. Standing on its own inverts that: nothing downstream depends
+ # on this job, so a red run costs a notification and a green run that
+ # posted nothing recreates exactly the failure it exists to prevent. That
+ # is how v1.9.0 shipped silent.
STRICT: "1"
run: node .github/scripts/discord-release-announce.mjs
diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml
index 110406c17..965a6e93e 100644
--- a/.github/workflows/prerelease.yml
+++ b/.github/workflows/prerelease.yml
@@ -159,15 +159,12 @@ jobs:
-f arch=both \
--repo "$GITHUB_REPOSITORY"
- - name: Announce RC on Discord (#rc-testing)
- if: success()
- env:
- DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
- DISCORD_RC_TESTING_CHANNEL_ID: ${{ vars.DISCORD_RC_TESTING_CHANNEL_ID }}
- GITHUB_TOKEN: ${{ secrets.OPENSCREEN_RELEASE_TOKEN }}
- STABLE_TAG: ${{ steps.version.outputs.rc_tag }}
- KIND: rc
- run: node .github/scripts/discord-release-announce.mjs
+ # No announcement step here any more — see the note in promote.yml. This one
+ # was the worse of the two: it ran immediately after DISPATCHING build.yml,
+ # not after it finished, so #rc-testing was told to go test a build whose
+ # artifacts would not exist for another twenty minutes. announce-release.yml
+ # now fires on `release: published`, which by definition means the assets are
+ # attached, and reads `github.event.release.prerelease` to pick this channel.
- name: Workflow summary
run: |
@@ -177,5 +174,6 @@ jobs:
echo "- RC tag: \`${{ steps.version.outputs.rc_tag }}\`"
echo "- Stable target: \`v${{ steps.version.outputs.next }}\`"
echo "- Build workflow triggered by the tag push will publish the GitHub pre-release."
- echo "- Announce in #rc-testing on Discord, then run \`Promote RC to stable\` when QA is green."
+ echo "- #rc-testing is announced automatically once the build publishes the pre-release."
+ echo "- Run \`Promote RC to stable\` when QA is green."
} >> "$GITHUB_STEP_SUMMARY"
diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml
index ee4cc1fb3..7bc090534 100644
--- a/.github/workflows/promote.yml
+++ b/.github/workflows/promote.yml
@@ -127,17 +127,15 @@ jobs:
-f arch=both \
--repo "$GITHUB_REPOSITORY"
- - name: Announce stable on Discord
- if: success()
- env:
- DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
- DISCORD_RELEASE_CHANNEL_ID: ${{ vars.DISCORD_RELEASE_CHANNEL_ID }}
- GITHUB_TOKEN: ${{ secrets.OPENSCREEN_RELEASE_TOKEN }}
- STABLE_TAG: ${{ steps.version.outputs.stable_tag }}
- RC_TAG: ${{ steps.version.outputs.rc_tag }}
- EXTRA: ${{ inputs.release_notes_extra }}
- KIND: stable
- run: node .github/scripts/discord-release-announce.mjs
+ # No announcement step here any more. It moved to announce-release.yml, which
+ # runs on `release: published` — the one event every release path shares,
+ # including a tag pushed straight to build.yml with no promotion at all. This
+ # step could only ever announce what THIS workflow did, and it announced it
+ # from here, before build.yml had produced a single asset.
+ #
+ # `release_notes_extra` consequently no longer reaches Discord from this
+ # workflow. Pass it to the announce dispatch instead when there is something
+ # to prepend; the automatic run posts the standard message.
# Bookkeeping, not publishing: the release is already out by now. Allowed to fail
# so a stuck PR never masks a successful release — the summary reports it and it