Skip to content

Commit 1da5852

Browse files
authored
Merge pull request #41 from pylon-code/fix/mobile-cd-eas22
fix(ci): unbreak mobile preview CD against eas-cli 22
2 parents aac74ee + 396ae12 commit 1da5852

2 files changed

Lines changed: 78 additions & 5 deletions

File tree

.github/workflows/mobile-eas-preview.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,15 @@ jobs:
6666
if: steps.expo-token.outputs.present == 'true'
6767
uses: expo/expo-github-action@v8
6868
with:
69-
eas-version: latest
69+
# Pinned below eas-cli 22 for continuous-deploy-fingerprint, which still
70+
# reads `build.project.ownerAccount` when it posts the PR comment. eas-cli
71+
# 22 renamed those build JSON fields (project → app, channel →
72+
# updateChannel, runtimeVersion → runtime), so `project` is undefined and
73+
# the step fails after the builds have already succeeded.
74+
# See https://github.com/expo/expo-github-action/issues/358 — raise this
75+
# back to `latest` once that issue closes. The production workflow stays
76+
# on `latest` because it calls eas directly and never runs this action.
77+
eas-version: 21.8.0
7078
token: ${{ secrets.EXPO_TOKEN }}
7179
# npm, not pnpm: this only installs eas-cli into the action's own
7280
# tool dir, and pnpm 11 hard-fails that install on dtrace-provider's
@@ -82,7 +90,11 @@ jobs:
8290

8391
- name: Deploy with fingerprint check
8492
if: steps.expo-token.outputs.present == 'true'
85-
uses: expo/expo-github-action/continuous-deploy-fingerprint@main
93+
# Pinned to a release rather than @main: this is the only action reference
94+
# in the repository that tracked an unreleased branch, so it could change
95+
# under CI without a commit here. The sub-action does not exist in v8, which
96+
# is why the setup action above is a different major.
97+
uses: expo/expo-github-action/continuous-deploy-fingerprint@v9
8698
env:
8799
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
88100
with:

apps/mobile/README.md

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,70 @@ The native lint task runs SwiftLint for Swift plus ktlint and detekt for Kotlin.
9191

9292
CI uses Expo fingerprinting with the `preview:dev` profile to reuse an existing compatible build when possible, or start a new internal EAS build when native runtime inputs change. Production and default local builds continue to use the `appVersion` runtime policy.
9393

94-
For preview or production EAS environments, set `T3CODE_CLERK_PUBLISHABLE_KEY`,
95-
`T3CODE_CLERK_JWT_TEMPLATE`, and `T3CODE_RELAY_URL`
96-
as EAS environment variables. Expo config maps the canonical values into the mobile build.
94+
### EAS environment variables
95+
96+
EAS build servers read the EAS-hosted environment, **not this checkout**. `eas build`
97+
archives the project with git, so every gitignored file — including the repository-root
98+
`.env` and `.env.local` — is absent on the builder. Anything `app.config.ts` needs must
99+
therefore exist in the EAS environment for `production`, `preview`, and `development`:
100+
101+
| Variable | Missing it means |
102+
| ------------------------------ | ---------------------------------------------------------------- |
103+
| `PYLON_EAS_PROJECT_ID` | `extra.eas.projectId` is null and **`updates.enabled` is false** |
104+
| `PYLON_EAS_OWNER` | no `owner` in the manifest |
105+
| `T3CODE_CLERK_PUBLISHABLE_KEY` | Pylon Connect UI is omitted entirely |
106+
| `T3CODE_CLERK_JWT_TEMPLATE` | Pylon Connect UI is omitted entirely |
107+
| `T3CODE_RELAY_URL` | Pylon Connect UI is omitted entirely |
108+
109+
List or set them with:
110+
111+
```bash
112+
eas env:list preview
113+
eas env:create --name PYLON_EAS_PROJECT_ID --value <id> \
114+
--environment production --environment preview --environment development \
115+
--visibility plaintext --type string --scope project --force
116+
```
117+
118+
All of these are public identifiers — the project ID ships inside every app's update
119+
URL — so they are plaintext variables, not secrets.
120+
121+
**Both failures are silent.** A build missing the Clerk or relay values renders no error
122+
and no empty state; `hasCloudPublicConfig()` simply omits every Connect surface, so the
123+
app reads as though it never had the feature. A build missing `PYLON_EAS_PROJECT_ID`
124+
installs and runs normally but can never receive an over-the-air update, because Expo
125+
disabled the update client at build time. In CI the project ID fails louder: every `eas`
126+
command reports "EAS project not configured".
127+
128+
Verify a finished build rather than assuming, by reading the manifest baked into the
129+
artifact:
130+
131+
```bash
132+
unzip -qo <build>.ipa -d /tmp/ipa
133+
node -e 'const c=require("/tmp/ipa/Payload/PylonPreview.app/EXConstants.bundle/app.config");
134+
console.log("updates:", JSON.stringify(c.updates), "| projectId:", c.extra?.eas?.projectId);
135+
console.log("connect:", Boolean(c.extra?.clerk?.publishableKey && c.extra?.relay?.url))'
136+
```
137+
138+
### Installing a build on a device
139+
140+
Internal-distribution builds install straight from the build page in **Safari** on the
141+
device — no Expo Go or Orbit needed — provided the device UDID is on the provisioning
142+
profile. Open the URL that `eas build` prints, or scan its QR code.
143+
144+
### Over-the-air updates
145+
146+
An update only reaches a binary whose `runtimeVersion` matches, so publish with the same
147+
policy the target build used. The `preview:local` profile pins `appVersion`, so:
148+
149+
```bash
150+
APP_VARIANT=preview MOBILE_VERSION_POLICY=appVersion \
151+
eas update --branch preview --environment preview --platform ios --message "..."
152+
```
153+
154+
Publishing under the default `fingerprint` policy instead produces a runtime version no
155+
`appVersion` build will ever match, and the update silently never lands. `eas
156+
update:roll-back-to-embedded` reverts a channel to the bundle inside the binary, which is
157+
also the quickest way to test whether a published bundle caused a regression.
97158

98159
Create a PR preview dev-client build manually:
99160

0 commit comments

Comments
 (0)