Skip to content
Merged
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
23 changes: 16 additions & 7 deletions .github/workflows/build+test+deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,26 @@ on:
push:
branches: [ "main" ]
workflow_dispatch:
inputs:
notify_wrappers_only:
description: Notify wrapper SDKs without building or publishing
type: boolean
default: false
version:
description: Stable released version (required when notifying wrappers only)
type: string

permissions:
contents: write

# Prevents running a bunch of we push right back to back
# Keep manual wrapper notifications separate from build/publish runs.
concurrency:
group: test-${{ github.event.pull_request.number || github.ref }}
group: test-${{ github.event.pull_request.number || github.ref }}-${{ inputs.notify_wrappers_only && format('notify-{0}', inputs.version) || 'build' }}
cancel-in-progress: true

jobs:
build:
if: ${{ github.event_name != 'workflow_dispatch' || !inputs.notify_wrappers_only }}

runs-on: android-large-runner

Expand Down Expand Up @@ -180,14 +189,14 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

# Lets Flutter, Expo and KMP open a bump PR for this version. Called directly
# because the release above is created with GITHUB_TOKEN, which never fires
# `release` events for other workflows.
# Lets Flutter, Expo and KMP open a bump PR for a release, or re-send one
# manually without running the build. The release above uses GITHUB_TOKEN,
# which never fires `release` events for other workflows.
notify_wrappers:
needs: build
if: ${{ !cancelled() && needs.build.outputs.released == 'true' && needs.build.outputs.prerelease == 'false' }}
if: ${{ !cancelled() && ((github.event_name == 'workflow_dispatch' && inputs.notify_wrappers_only) || (needs.build.outputs.released == 'true' && needs.build.outputs.prerelease == 'false')) }}
uses: ./.github/workflows/notify-wrappers.yml
with:
version: ${{ needs.build.outputs.version }}
version: ${{ inputs.notify_wrappers_only && inputs.version || needs.build.outputs.version }}
secrets:
WRAPPER_DISPATCH_TOKEN: ${{ secrets.WRAPPER_DISPATCH_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/notify-wrappers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ jobs:
run: |
VERSION="${VERSION#v}"
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
if [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
echo "::error::Enter a stable x.y.z version when notifying wrappers manually."
exit 1
fi
echo "::notice::'$VERSION' is not a stable x.y.z version, not notifying wrappers."
exit 0
fi
Expand Down
Loading