-
Notifications
You must be signed in to change notification settings - Fork 60
Notify wrapper SDKs of new releases #538
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
Open
ianrumac
wants to merge
1
commit into
develop
Choose a base branch
from
ir/cool-thompson-kpjizz
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # Tells the cross-platform wrappers (Flutter, Expo, KMP) that a new native SDK | ||
| # release exists. Each wrapper's native-sdk-bump.yml picks the event up, bumps | ||
| # its pinned native version, and opens a PR (with any integration work done by | ||
| # an agent on top). | ||
| # | ||
| # iOS releases are created by hand (tag-version.yml only pings Slack), so | ||
| # `release: published` fires for them. `published` rather than `created`: | ||
| # `created` also fires for drafts. | ||
| # | ||
| # Requires the WRAPPER_DISPATCH_TOKEN secret: a fine-grained PAT (or GitHub App | ||
| # token) with "Contents: read & write" on every repo in WRAPPER_REPOS — that is | ||
| # the permission the repository_dispatch API checks. GITHUB_TOKEN cannot | ||
| # dispatch into other repositories. | ||
| name: Notify wrapper SDKs | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: Released version to announce (e.g. 4.18.0) | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| PLATFORM: ios | ||
| WRAPPER_REPOS: superwall/Superwall-Flutter superwall/expo-superwall superwall/Superwall-KMP | ||
|
|
||
| jobs: | ||
| dispatch: | ||
| runs-on: ubuntu-latest | ||
| # Wrappers only ship stable native versions. | ||
| if: github.event_name != 'release' || !github.event.release.prerelease | ||
| steps: | ||
| - name: Dispatch native-sdk-release | ||
| env: | ||
| GH_TOKEN: ${{ secrets.WRAPPER_DISPATCH_TOKEN }} | ||
| VERSION: ${{ inputs.version || github.event.release.tag_name }} | ||
| run: | | ||
| VERSION="${VERSION#v}" | ||
| if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
| echo "::notice::'$VERSION' is not a stable x.y.z version, not notifying wrappers." | ||
| exit 0 | ||
| fi | ||
| failed=0 | ||
| for repo in $WRAPPER_REPOS; do | ||
| # One wrapper being unreachable must not stop the others. | ||
| if gh api "repos/$repo/dispatches" \ | ||
| -f event_type=native-sdk-release \ | ||
| -f "client_payload[platform]=$PLATFORM" \ | ||
| -f "client_payload[version]=$VERSION"; then | ||
| echo "Notified $repo of $PLATFORM $VERSION" | ||
| else | ||
| echo "::error::Could not dispatch to $repo" | ||
| failed=1 | ||
| fi | ||
| done | ||
| exit $failed | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tag-version.ymlrunspod trunk pushand the Slack "please create a release" ping at the same time, since both only depend ontag. Trunk push is a macOS lint and build that can take a while or fail outright, so a release can be published before the pod exists on CocoaPods. When that happens, Flutter and Expo get a bump PR whosepod installcan't resolveSuperwallKitat that version. Consider waiting for the version to show up on trunk before dispatching. The manualworkflow_dispatchpath can still be used to re-send the event.Technical details