ci: add workflow to build and publish React Native Playground APK on release#192
ci: add workflow to build and publish React Native Playground APK on release#192ffmcgee725 merged 6 commits intomainfrom
Conversation
| secrets: | ||
| PUBLISH_DOCS_TOKEN: ${{ secrets.PUBLISH_DOCS_TOKEN }} | ||
|
|
||
| build-rn-playground-apk: |
There was a problem hiding this comment.
would this trigger on release of any package? Do we need to make this step run only if the react native playground is specifically being released?
There was a problem hiding this comment.
perhaps we need to target a new tag entirely, not the root level package.json version?
There was a problem hiding this comment.
This is a good point. I think I had pointed Joao down this path of targeting any release, but I suppose it wouldn't make sense to run this unless the react-native-playground itself is being released
There was a problem hiding this comment.
I think as @jiexi suggests we need a new tag format specifically for the rn playground package to do the proper gating comparison
There was a problem hiding this comment.
Yes, it would run on every monorepo release regardless of which package changed. Since the playground depends on workspace packages (@metamask/connect-multichain, @metamask/connect-evm, etc.), rebuilding the APK on any release is actually desirable -- the playground bundles those packages at build time, so a new @metamask/connect-multichain release means the APK should be rebuilt to include it. The APK filename will still reflect the playground's own version, which only bumps when the playground itself changes (enforced by validate-release-playground-bumps.yml).
There was a problem hiding this comment.
I think that on the mobile side when we specify the github release url (identified by tag) to download the built RN playground APK from, that APK should never change. If the APK changes, it should be only if the github release url (i.e. tag) changes too.
If we allow clobbering the existing apk in a tag, this violates the assumptions of versioning (since there is a version in the github release url)
There was a problem hiding this comment.
I don’t think b4ea0d6 fully closes the loop on Jiexi’s concern yet. The new gate is checking whether the RN playground tag already exists at all, not whether the playground was actually released in this specific run, so it could still fire on unrelated releases. On top of that, the APK is still being uploaded to the generic RELEASE_TAG, and with --clobber we can still overwrite an asset behind an existing release URL, which is the versioning issue Jiexi called out.
I think the safer path is:
- only run the APK job when the RN playground itself is part of the current release
- upload the APK to the RN-playground-specific tag (for example
@metamask/[email protected]), not the generic release tag - avoid
--clobberonce that tag-to-APK mapping is versioned and stable
That way the mobile side can rely on a release URL never changing underneath it.
There was a problem hiding this comment.
This looks right to me now! Will let @jiexi confirm though!
Explanation
Adds automated CI infrastructure to build the React Native Playground Android APK and attach it to GitHub Releases, eliminating the manual build-and-transfer process that blocks running multichain RN connect E2E tests in metamask-mobile.
What
New workflow (
.github/workflows/build-rn-playground-apk.yml):workflow_call(reusable from the release pipeline) +workflow_dispatch(manual/ad-hoc builds from any branch)yarn build→ Infura.envfrom secret →expo prebuild→gradlew assembleReleasern-playground-<version>.apkto the GitHub Release viagh release uploadRelease pipeline integration (
publish-release.yml,main.yml):build-rn-playground-apkjob runs afterget-release-version(parallel with the existing gh-pages deployments)INFURA_API_KEYsecret through the workflow call chainWhy
The metamask-mobile Appwright E2E tests (multichain RN connect specs) require a prebuilt playground APK. Until now, generating it required manually cloning connect-monorepo, building locally, and transferring the APK — a process that doesn't scale for CI or new contributors. With this change, every release automatically produces a fetchable APK artifact.
Setup required
Add the
INFURA_API_KEYsecret to the connect-monorepo repository settings. The APK is signed with Expo's default debug keystore, which is sufficient for a test dApp.Files changed
.github/workflows/build-rn-playground-apk.yml.github/workflows/publish-release.ymlbuild-rn-playground-apkjob,INFURA_API_KEYsecret passthrough.github/workflows/main.ymlINFURA_API_KEYtopublish-release.ymlplayground/react-native-playground/README.mdReferences
Checklist