Skip to content

Notify wrapper SDKs of new releases - #538

Open
ianrumac wants to merge 1 commit into
developfrom
ir/cool-thompson-kpjizz
Open

ianrumac wants to merge 1 commit into
developfrom
ir/cool-thompson-kpjizz

Conversation

@ianrumac

@ianrumac ianrumac commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Changes in this pull request

  • Adds .github/workflows/notify-wrappers.yml. When a stable release is published, it sends a native-sdk-release repository_dispatch ({platform: "ios", version}) to Superwall-Flutter, expo-superwall and Superwall-KMP. Each wrapper's native-sdk-bump.yml then opens a bump PR, and an agent pushes any integration work onto it.
  • Triggers on release: published because iOS releases are created by hand. created would also fire for drafts. Prereleases and non-x.y.z tags are skipped. It can also be run by hand (workflow_dispatch with a version).
  • If dispatching to one wrapper fails, the others are still tried; the run goes red at the end.

Setup: needs a WRAPPER_DISPATCH_TOKEN secret, a fine-grained PAT or App token with Contents: read & write on the three wrapper repos. GITHUB_TOKEN can't dispatch to other repos.

Counterparts: superwall/Superwall-Android#473, plus the native-sdk-bump.yml PRs in Superwall-Flutter, expo-superwall and Superwall-KMP.

Checklist

  • All unit tests pass.
  • All UI tests pass.
  • Demo project builds and runs on iOS.
  • Demo project builds and runs on Mac Catalyst.
  • Demo project builds and runs on visionOS.
  • I added/updated tests or detailed why my change isn't tested. CI-only change: checked with actionlint and shellcheck. The dispatch itself can only run once the secret exists.
  • I added an entry to the CHANGELOG.md for any breaking changes, enhancements, or bug fixes. Not applicable: no customer-facing change.
  • I have run swiftlint in the main directory and fixed any issues. Not applicable: no Swift changes.
  • I have updated the SDK documentation as well as the online docs. Not applicable.
  • I have reviewed the contributing guide

🤖 Generated with Claude Code

https://claude.ai/code/session_015S6mZpaJyu9J5v7NPv2WCS


Generated by Claude Code

Adds notify-wrappers.yml: on a published (non-prerelease) release it
sends a native-sdk-release repository_dispatch ({platform, version}) to
Superwall-Flutter, expo-superwall and Superwall-KMP so they can open a
bump PR. Needs the WRAPPER_DISPATCH_TOKEN secret.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015S6mZpaJyu9J5v7NPv2WCS
@greptile-apps

greptile-apps Bot commented Oct 2, 2026

Copy link
Copy Markdown

This PR does not match any of the 1 configured review trigger rule.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues. One timing edge case is noted inline.

Reviewed changes

Reviewed the new notify-wrappers.yml workflow, which tells the Flutter, Expo and KMP wrappers about stable iOS releases.

  • Trigger and filtering: The workflow runs on release: published and on manual workflow_dispatch. It skips prereleases and any tag that is not x.y.z. Existing iOS tags are plain x.y.z (for example 4.17.0), so the regex matches them.
  • Dispatch loop: For each wrapper repo it calls gh api repos/$repo/dispatches with {platform: ios, version} in the payload. If one repo fails, it still tries the rest and then exits non-zero. Untrusted values reach the script through env, not inline ${{ }}, so there is no script-injection risk.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5.5 | 𝕏

echo "::notice::'$VERSION' is not a stable x.y.z version, not notifying wrappers."
exit 0
fi
failed=0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag-version.yml runs pod trunk push and the Slack "please create a release" ping at the same time, since both only depend on tag. 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 whose pod install can't resolve SuperwallKit at that version. Consider waiting for the version to show up on trunk before dispatching. The manual workflow_dispatch path can still be used to re-send the event.

Technical details
# Dispatch can race the CocoaPods trunk push

## Affected sites
- .github/workflows/notify-wrappers.yml:49 — dispatches right after the version check passes
- .github/workflows/tag-version.yml — `cocoapods` and `slack` jobs both `needs: tag` and run in parallel

## Required outcome
- Wrappers that consume iOS through CocoaPods are only notified once `SuperwallKit $VERSION` can be resolved from trunk. If it never appears, the run fails visibly instead of opening bump PRs that can't build.

## Suggested approach
Before the loop, poll the trunk API with a bounded timeout:
```bash
for _ in $(seq 1 60); do
  curl -sfo /dev/null "https://trunk.cocoapods.org/api/v1/pods/SuperwallKit/specs/$VERSION" && break
  sleep 30
done || true
curl -sfo /dev/null "https://trunk.cocoapods.org/api/v1/pods/SuperwallKit/specs/$VERSION" \
  || { echo "::error::SuperwallKit $VERSION not on CocoaPods trunk"; exit 1; }
```
CDN propagation can lag trunk slightly, but this closes most of the window.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants