Skip to content

Commit 3080531

Browse files
ci(mobile): symlink react-native CLI for CodePush OTA bundling (#14387)
## Summary - Fixes Mobile OTA Release (CodePush) jobs failing with `node_modules/.bin/react-native: not found` (exit 127). Example: [run 26308703765](https://github.com/AudiusProject/apps/actions/runs/26308703765/job/77452051457). - After [#14365](#14365) regenerated the lockfile, `react-native` (and the bin from `@react-native-community/cli`) hoists to the monorepo root `node_modules/`, so `packages/mobile/node_modules/.bin/react-native` no longer exists. - [`@bravemobile/react-native-code-push@12.3.2`](https://app.unpkg.com/@bravemobile/react-native-code-push@12.3.2/files/cli/dist/functions/runReactNativeBundleCommand.js) hardcodes the relative path `node_modules/.bin/react-native` (cwd is `packages/mobile`) when invoking `react-native bundle`, so the lookup fails. - Add a symlink step before `npx code-push release` in both `mobile-ota-release` and `mobile-ota-release-production` that points `packages/mobile/node_modules/.bin/react-native` at the hoisted root binary. ## Test plan - [ ] Mobile OTA Release (CodePush, ios) on this PR's merge to `main` succeeds (or workflow_dispatch w/ `rc` channel). - [ ] Mobile OTA Release (CodePush, android) on this PR's merge to `main` succeeds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 802487b commit 3080531

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/mobile.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,15 @@ jobs:
285285
echo "channel=rc" >> "$GITHUB_OUTPUT"
286286
fi
287287
288+
# @bravemobile/react-native-code-push@12.3.2 hardcodes
289+
# `node_modules/.bin/react-native` relative to cwd. After #14365 the
290+
# react-native dep hoists to root node_modules, so the bin is only at
291+
# ./node_modules/.bin/react-native — not packages/mobile/node_modules/.bin/.
292+
- name: Symlink react-native CLI into packages/mobile/node_modules/.bin
293+
run: |
294+
mkdir -p packages/mobile/node_modules/.bin
295+
ln -sf "$(pwd)/node_modules/.bin/react-native" packages/mobile/node_modules/.bin/react-native
296+
288297
- name: Publish OTA update (${{ matrix.platform }})
289298
env:
290299
OTA_S3_BUCKET: ${{ secrets.OTA_S3_BUCKET }}
@@ -390,6 +399,15 @@ jobs:
390399
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
391400
aws-region: us-east-1
392401

402+
# @bravemobile/react-native-code-push@12.3.2 hardcodes
403+
# `node_modules/.bin/react-native` relative to cwd. After #14365 the
404+
# react-native dep hoists to root node_modules, so the bin is only at
405+
# ./node_modules/.bin/react-native — not packages/mobile/node_modules/.bin/.
406+
- name: Symlink react-native CLI into packages/mobile/node_modules/.bin
407+
run: |
408+
mkdir -p packages/mobile/node_modules/.bin
409+
ln -sf "$(pwd)/node_modules/.bin/react-native" packages/mobile/node_modules/.bin/react-native
410+
393411
- name: Publish OTA update to production (${{ matrix.platform }})
394412
env:
395413
OTA_S3_BUCKET: ${{ secrets.OTA_S3_BUCKET }}

0 commit comments

Comments
 (0)