forked from siddharthvaddem/openscreen
-
Notifications
You must be signed in to change notification settings - Fork 80
ci(release): make the Discord announcement dispatchable on its own #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+164
−13
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # Announcing a release lived only inside prerelease.yml and promote.yml, as the | ||
| # last step of each. Both promotions so far failed before reaching it — v1.8.0 on | ||
| # a merge conflict, v1.9.0 on a non-rebasable sync branch — and each time the | ||
| # announcement was silently skipped along with everything downstream of the | ||
| # 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. | ||
| name: Announce a release on Discord | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| tag: | ||
| description: "Release tag to announce (e.g. v1.9.0)" | ||
| required: true | ||
| type: string | ||
| kind: | ||
| description: "stable posts to the release channel, rc to the testing channel" | ||
| required: true | ||
| type: choice | ||
| options: [stable, rc] | ||
| default: stable | ||
| release_notes_extra: | ||
| description: "Optional message prepended to the announcement" | ||
| required: false | ||
| type: string | ||
| default: "" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| announce: | ||
| name: Announce ${{ inputs.tag }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Announce on Discord | ||
| env: | ||
| DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }} | ||
| # 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 || '' }} | ||
| # 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 }} | ||
| EXTRA: ${{ inputs.release_notes_extra }} | ||
| KIND: ${{ inputs.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. | ||
| STRICT: "1" | ||
| run: node .github/scripts/discord-release-announce.mjs | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.