Skip to content

Commit 91b8f02

Browse files
committed
ci(release): notify Discord after Docker publish, include GHCR image
Move the Discord notification out of the Release job into a terminal discord-notify job that runs after publish-docker, so the message can include the GHCR image (docker pull + alpine tag). This also fully removes the earlier concern about a notification failure affecting Docker publishing (Discord is now downstream of it). Webhook secret is a repo secret (used by request-approval without the release environment), so no environment/approval gate is needed.
1 parent 36989b2 commit 91b8f02

1 file changed

Lines changed: 36 additions & 21 deletions

File tree

.github/workflows/release.yml

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -216,27 +216,6 @@ jobs:
216216
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
217217
run: gh release edit "v${VERSION}" --draft=false --repo "${{ github.repository }}"
218218

219-
# Non-blocking: a notification failure must not fail the Release job
220-
# (npm/GitHub release are already published) or skip downstream publishing
221-
# such as publish-docker.
222-
- name: Send Discord notification
223-
continue-on-error: true
224-
uses: tsickert/discord-webhook@b217a69502f52803de774ded2b1ab7c282e99645 # v7.0.0
225-
with:
226-
webhook-url: ${{ secrets.DISCORD_RELEASES_WEBHOOK_URL }}
227-
embed-title: vite-plus v${{ env.VERSION }}
228-
embed-description: |
229-
A new release is available!
230-
231-
**Published Packages:**
232-
• @voidzero-dev/vite-plus-core@${{ env.VERSION }}
233-
• vite-plus@${{ env.VERSION }}
234-
235-
**Install:**
236-
• macOS/Linux: `curl -fsSL https://vite.plus | bash`
237-
• Windows: `irm https://vite.plus/ps1 | iex`
238-
embed-url: https://github.com/${{ github.repository }}/releases/tag/v${{ env.VERSION }}
239-
240219
# Build and push the official toolchain Docker image to GHCR after the npm
241220
# release is published (the image installs vp from npm, so the version must
242221
# exist first). See docker/Dockerfile and docs/guide/docker.md.
@@ -303,3 +282,39 @@ jobs:
303282
build-args: |
304283
VP_VERSION=${{ env.VERSION }}
305284
provenance: false
285+
286+
# Announce the release on Discord last, after the Docker images are published,
287+
# so the message can include the GHCR image. Runs after the npm release
288+
# (Release) and the images (publish-docker).
289+
discord-notify:
290+
name: Notify Discord
291+
runs-on: ubuntu-latest
292+
needs: [check, Release, publish-docker]
293+
if: needs.check.outputs.version_changed == 'true'
294+
env:
295+
VERSION: ${{ needs.check.outputs.version }}
296+
IMAGE: ghcr.io/voidzero-dev/vite-plus
297+
steps:
298+
# Non-blocking: a webhook failure must not mark the release run as failed
299+
# (npm, GitHub release, and Docker images are already published).
300+
- name: Send Discord notification
301+
continue-on-error: true
302+
uses: tsickert/discord-webhook@b217a69502f52803de774ded2b1ab7c282e99645 # v7.0.0
303+
with:
304+
webhook-url: ${{ secrets.DISCORD_RELEASES_WEBHOOK_URL }}
305+
embed-title: vite-plus v${{ env.VERSION }}
306+
embed-description: |
307+
A new release is available!
308+
309+
**Published Packages:**
310+
• @voidzero-dev/vite-plus-core@${{ env.VERSION }}
311+
• vite-plus@${{ env.VERSION }}
312+
313+
**Docker (GHCR):**
314+
• `docker pull ${{ env.IMAGE }}:${{ env.VERSION }}`
315+
• Alpine: `${{ env.IMAGE }}:${{ env.VERSION }}-alpine`
316+
317+
**Install:**
318+
• macOS/Linux: `curl -fsSL https://vite.plus | bash`
319+
• Windows: `irm https://vite.plus/ps1 | iex`
320+
embed-url: https://github.com/${{ github.repository }}/releases/tag/v${{ env.VERSION }}

0 commit comments

Comments
 (0)