Skip to content
Draft
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
54 changes: 54 additions & 0 deletions .github/workflows/publish-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ name: Publish testing images + promote
# in the customers account via OIDC; the image-updater Lambda there rolls every
# tier=testing service (new image + fresh extras together). The full-stack image
# is not part of the managed fleet, so it has no SSM tier.
#
# Notify subscribers: after the same scan gate, announces the published release to
# the repositories that follow it. Skipped until the `testing` environment has the
# RELEASE_NOTIFY_* secrets.

on:
push:
Expand Down Expand Up @@ -335,6 +339,56 @@ jobs:
--region "$AWS_REGION"
echo "promoted $SSM_PARAM = ${VERSION}-php85" >> "$GITHUB_STEP_SUMMARY"

notify-subscribers:
name: Notify subscribers — release published
needs: [resolve, scan-minimal]
# NOTE: same gate as promote: never for a dry run, never past a failed scan.
if: ${{ needs.resolve.outputs.dry_run != 'true' }}
environment: testing
runs-on: ubuntu-latest
timeout-minutes: 5
permissions: {}
steps:
- name: Check notifications are configured
id: wired
env:
CLIENT_ID: ${{ secrets.RELEASE_NOTIFY_CLIENT_ID }}
run: |
if [ -n "$CLIENT_ID" ]; then
echo "wired=true" >> "$GITHUB_OUTPUT"
else
echo "::notice::RELEASE_NOTIFY_CLIENT_ID is not set; no one is notified"
echo "wired=false" >> "$GITHUB_OUTPUT"
fi

- name: Mint a token for the subscribers
if: steps.wired.outputs.wired == 'true'
id: token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
client-id: ${{ secrets.RELEASE_NOTIFY_CLIENT_ID }}
private-key: ${{ secrets.RELEASE_NOTIFY_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ${{ secrets.RELEASE_NOTIFY_REPOSITORIES }}
permission-contents: write

- name: Send release-published
if: steps.wired.outputs.wired == 'true'
env:
GH_TOKEN: ${{ steps.token.outputs.token }}
OWNER: ${{ github.repository_owner }}
REPOSITORIES: ${{ secrets.RELEASE_NOTIFY_REPOSITORIES }}
VERSION: ${{ needs.resolve.outputs.version }}
run: |
set -euo pipefail
for repo in ${REPOSITORIES//,/ }; do
gh api "repos/${OWNER}/${repo}/dispatches" \
-f event_type=release-published \
-f "client_payload[version]=${VERSION}" \
-f "client_payload[tag]=${VERSION}-php85" >/dev/null
done
echo "announced ${VERSION}-php85" >> "$GITHUB_STEP_SUMMARY"

# The full-stack image is built here for the same build-once reason as the
# minimal one: GA promotes this digest rather than rebuilding from the prod
# bundle. It is amd64-only, matching what the release build published before.
Expand Down
Loading