Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions .agents/skills/release-update/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: release-update
description: Build, verify, submit, and publish BooKoo releases through EAS Build, Expo Updates, Google Play, and App Store Connect. Use when the user runs `/release-update` or `$release-update`, asks to release or deploy BooKoo, upload IPA/AAB artifacts, submit store builds for review, add release notes, choose between a native build and an OTA update, or finish a version rollout after review and E2E.
description: Build, verify, submit, and publish BooKoo releases through local EAS Build, Codemagic Patch OTA, Google Play, and App Store Connect. Use when the user runs `/release-update` or `$release-update`, asks to release or deploy BooKoo, upload IPA/AAB artifacts, submit store builds for review, add release notes, choose between a native build and an OTA update, or finish a version rollout after review and E2E.
---

# Release Update
Expand Down Expand Up @@ -44,18 +44,19 @@ Require new iOS and Android binaries when any of these changed:
permissions, targets, manifests, Info.plist, Pod/Gradle inputs, or native
assets — including anything under `plugins/` and the social-login SDKs;
- app version/build numbers or store compliance requirements;
- behavior that cannot run safely on the installed runtime version.
- behavior that cannot run safely on the installed binary version.

For the explicit native runtime, follow `$update-version`: native-contract
changes must advance `app.config.ts`'s shared runtimeVersion and ship new
iOS and Android binaries before OTA delivery. A proven metadata-only store patch
may retain the existing
compatible runtime and build only the platform that requires a new store version
(iOS1.1.1 retains runtime1.1.0; Android32 stays public). Record the exception and
verify the installed native version separately from the OTA manifest version.
Over-the-air updates come from Codemagic Patch (`@codemagic/react-native-patch`,
team OpenIAP on `https://ota.codemagicpatch.dev`, apps `BooKoo-iOS` and
`BooKoo-Android`). A release targets the binary's marketing version and Patch
also checks the native fingerprint, so an OTA never lands on an incompatible
binary. Native-contract changes need new iOS and Android binaries before any
OTA that relies on them; follow `$update-version`. The first Patch binary is
1.5.0; store binaries up to 1.4.0 still run expo-updates and receive nothing
from Patch.

Use Expo Updates only when the change is JavaScript/assets compatible with the
existing production runtime and no store binary or compliance update is needed.
Use a Codemagic Patch OTA only when the change is JavaScript/assets compatible with the
existing production binary and no store binary or compliance update is needed.

## Verify Before Shipping

Expand Down Expand Up @@ -99,15 +100,19 @@ existing production runtime and no store binary or compliance update is needed.
2. Publish an OTA only for a JavaScript/assets-compatible change from a clean
checkout whose `HEAD` exactly matches `origin/main`. Record that decision and
a useful message explicitly:
- `EAS_UPDATE_CONFIRM_COMPATIBLE=1 EAS_UPDATE_MESSAGE="<notes>" bun eas:prod:updates`
- `OTA_CONFIRM_COMPATIBLE=1 OTA_MESSAGE="<notes>" bun ota:release`
- append `:ios` or `:android` to target one platform.
The guard publishes to the `production` channel with the `production` EAS
environment. Never publish automatically on every merge: native modules,
config plugins, permissions, entitlements, and native assets require new
locally built binaries even when the semantic app version is unchanged.
- add `EAS_UPDATE_DRY_RUN=1` to verify the exact-main and successful-CI gates
The guard publishes to the Patch `Production` deployment, bundling with
the `production` EAS environment through `eas env:exec`. Never publish
automatically on every merge: native modules, config plugins, permissions,
entitlements, and native assets require new locally built binaries even
when the semantic app version is unchanged.
- Sign in once with `bunx @codemagic/patch-cli@0.10.0 login --server-url
https://ota.codemagicpatch.dev`. QA builds read the `Staging` deployment;
test there first with `cmpatch release-react --deployment Staging`.
- add `OTA_DRY_RUN=1` to verify the exact-main and successful-CI gates
without bundling or publishing.
- when GitHub Actions cannot run, add `EAS_UPDATE_VERIFY=local`: the script
- when GitHub Actions cannot run, add `OTA_VERIFY=local`: the script
runs CI's `check` commands (`bun lint:all`, `bun typecheck`, `bun run
test`) on that exact clean commit instead of looking up the CI run. Never
use it for a change under `convex/`.
Expand Down Expand Up @@ -145,7 +150,7 @@ Include:
- Convex deploy result and the deployment targeted;
- AAB/IPA inspection results;
- `$perf-audit` and `$e2e-test` summaries;
- Expo update IDs, branch, and runtime version when OTA was used;
- Patch release labels, deployment, and target binary version when OTA was used;
- per-store upload, review, approval, and release states;
- release-note text and any remaining manual action.

Expand Down
10 changes: 5 additions & 5 deletions .agents/skills/update-version/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Use `references/workflow.md` as the detailed version and force-update checklist.
1. Parse the requested semantic version and whether `--force` was requested.
2. Update the marketing/store `version` in `package.json`; `app.config.ts`
reads it. Never duplicate that marketing version in a screen.
3. Inspect native compatibility before building or publishing: `app.config.ts`
owns an explicit `runtimeVersion`. Advance it to the new release version
whenever native dependencies, plugins, permissions or the native contract
change. A shared top-level runtime bump requires both new iOS and Android
binaries before compatible OTA delivery.
3. Inspect native compatibility before building or publishing. Codemagic Patch
targets OTA releases by this marketing version and checks the native
fingerprint. Whenever native dependencies, plugins, permissions or the
native contract change, ship new iOS and Android binaries before any OTA
that depends on them.
A metadata-only version change may retain the existing runtime only after
confirming the native contract is unchanged and recording that decision.
Historical iOS1.1.1 deliberately retained runtime1.1.0 for live Android32/iOS41.
Expand Down
10 changes: 5 additions & 5 deletions .agents/skills/update-version/references/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ installed native version; the update manifest is only a web/Expo Go fallback.

### Step 1b — Review native runtime compatibility

`app.config.ts` owns the independent explicit `runtimeVersion`. If the release
changes native dependencies, plugins, permissions, entitlements or the native
contract, advance this value to the new release version. A shared top-level
runtime bump requires both new iOS and Android binaries before OTA delivery.
An OTA requiring those native APIs must never target older binaries.
Codemagic Patch targets each OTA release at the marketing version in
`package.json` and also compares the native fingerprint. If the release changes
native dependencies, plugins, permissions, entitlements or the native contract,
ship both new iOS and Android binaries before OTA delivery. An OTA requiring
those native APIs must never target older binaries.

For a metadata-only patch with an unchanged native contract, explicitly retain
the compatible runtime and record the decision in release evidence. Historical
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/release-update/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: release-update
description: Build, verify, submit, and publish BooKoo releases through EAS Build, Expo Updates, Google Play, and App Store Connect. Use when the user runs `/release-update` or `$release-update`, asks to release or deploy BooKoo, upload IPA/AAB artifacts, submit store builds for review, add release notes, choose between a native build and an OTA update, or finish a version rollout after review and E2E.
description: Build, verify, submit, and publish BooKoo releases through local EAS Build, Codemagic Patch OTA, Google Play, and App Store Connect. Use when the user runs `/release-update` or `$release-update`, asks to release or deploy BooKoo, upload IPA/AAB artifacts, submit store builds for review, add release notes, choose between a native build and an OTA update, or finish a version rollout after review and E2E.
---

# Release Update (Claude Code)
Expand Down
2 changes: 1 addition & 1 deletion .codex/skills/release-update/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: release-update
description: Build, verify, submit, and publish BooKoo releases through EAS Build, Expo Updates, Google Play, and App Store Connect. Use when the user runs `/release-update` or `$release-update`, asks to release or deploy BooKoo, upload IPA/AAB artifacts, submit store builds for review, add release notes, choose between a native build and an OTA update, or finish a version rollout after review and E2E.
description: Build, verify, submit, and publish BooKoo releases through local EAS Build, Codemagic Patch OTA, Google Play, and App Store Connect. Use when the user runs `/release-update` or `$release-update`, asks to release or deploy BooKoo, upload IPA/AAB artifacts, submit store builds for review, add release notes, choose between a native build and an OTA update, or finish a version rollout after review and E2E.
---

# Release Update (Codex)
Expand Down
2 changes: 1 addition & 1 deletion .cursor/rules/release-update.mdc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Build, verify, submit, and publish BooKoo releases through EAS Build, Expo Updates, Google Play, and App Store Connect. Use when the user runs `/release-update` or `$release-update`, asks to release or deploy BooKoo, upload IPA/AAB artifacts, submit store builds for review, add release notes, choose between a native build and an OTA update, or finish a version rollout after review and E2E.
description: Build, verify, submit, and publish BooKoo releases through local EAS Build, Codemagic Patch OTA, Google Play, and App Store Connect. Use when the user runs `/release-update` or `$release-update`, asks to release or deploy BooKoo, upload IPA/AAB artifacts, submit store builds for review, add release notes, choose between a native build and an OTA update, or finish a version rollout after review and E2E.
globs:
alwaysApply: false
---
Expand Down
2 changes: 1 addition & 1 deletion .grok/skills/release-update/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: release-update
description: Build, verify, submit, and publish BooKoo releases through EAS Build, Expo Updates, Google Play, and App Store Connect. Use when the user runs `/release-update` or `$release-update`, asks to release or deploy BooKoo, upload IPA/AAB artifacts, submit store builds for review, add release notes, choose between a native build and an OTA update, or finish a version rollout after review and E2E.
description: Build, verify, submit, and publish BooKoo releases through local EAS Build, Codemagic Patch OTA, Google Play, and App Store Connect. Use when the user runs `/release-update` or `$release-update`, asks to release or deploy BooKoo, upload IPA/AAB artifacts, submit store builds for review, add release notes, choose between a native build and an OTA update, or finish a version rollout after review and E2E.
---

# Release Update (Grok)
Expand Down
6 changes: 3 additions & 3 deletions .notes/design/release-and-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ from a verified release branch, with remote EAS build numbers, store record ids,
and the exact Convex production deployment recorded in a private release manifest. No secret, service
account JSON, `.p8`, keystore, OTP, or reviewer credential is committed.

EAS Update is a manual production tool, not a per-merge deployment. A compatible JavaScript/assets-only
Codemagic Patch (`bun ota:release`) is a manual production tool, not a per-merge deployment. A compatible JavaScript/assets-only
change may be published only from a clean checkout whose `HEAD` exactly matches `origin/main`, after an
exact successful push CI run plus an explicit compatibility acknowledgement and release message. The guarded
`eas:prod:updates*` scripts target the `production` channel and EAS environment;
`runtimeVersion.policy = appVersion` keeps updates scoped to matching installed binaries. Native dependency/
`ota:release*` scripts publish to the Patch `Production` deployment with the `production` EAS environment;
the target binary version plus Patch's native fingerprint keep updates scoped to matching installed binaries. Native dependency/
config/permission/entitlement/manifest/asset changes require new local-only IPA/AAB builds. The EAS `preview`
profile is retained only for explicit local internal-device testing and is unrelated to Convex cloud preview
deployments.
Expand Down
45 changes: 36 additions & 9 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,23 @@ const {applicationId: APPLICATION_ID, qaApplicationId: QA_APPLICATION_ID} =
JSON.parse(
fs.readFileSync(path.join(projectRoot, 'shared/application.json'), 'utf8'),
) as {applicationId: string; qaApplicationId: string};
// Codemagic Patch delivers over-the-air updates. The deployment keys only let a
// build ask for updates, so they ship inside every binary and live in the repo.
interface OtaDeployments {
apiUrl: string;
downloadBaseUrl: string;
deploymentKeys: Record<
'ios' | 'android',
{staging: string; production: string}
>;
}
const OTA = JSON.parse(
fs.readFileSync(path.join(projectRoot, 'shared/otaDeployments.json'), 'utf8'),
) as OtaDeployments;

// `EXPO_NO_DOTENV=1` means "the environment is already correct, do not read
// local env files". `scripts/eas-update-production.zsh` sets it alongside
// `--environment production` so a production OTA is built from the EAS
// local env files". `scripts/ota-release.zsh` sets it inside
// `eas env:exec production`, so a production OTA is built from the EAS
// Environment and nothing else.
//
// Expo honours the flag for its own dotenv loading, but this config does its
Expand Down Expand Up @@ -165,6 +178,27 @@ export default ({config}: ConfigContext): ExpoConfig => ({
typedRoutes: true,
},
plugins: [
[
'@codemagic/react-native-patch',
{
ios: {
apiUrl: OTA.apiUrl,
downloadBaseUrl: OTA.downloadBaseUrl,
// QA builds read Staging so local testing never takes or replaces a
// production update.
deploymentKey: qa
? OTA.deploymentKeys.ios.staging
: OTA.deploymentKeys.ios.production,
},
android: {
apiUrl: OTA.apiUrl,
downloadBaseUrl: OTA.downloadBaseUrl,
deploymentKey: qa
? OTA.deploymentKeys.android.staging
: OTA.deploymentKeys.android.production,
},
},
],
'expo-iap',
'expo-router',
'expo-asset',
Expand Down Expand Up @@ -428,11 +462,4 @@ export default ({config}: ConfigContext): ExpoConfig => ({
eas: {projectId: EAS_PROJECT_ID},
stage: qa ? 'preview' : (process.env.STAGE ?? 'development'),
},
// Vietnamese native declarations belong to the1.4.0 runtime; QA remains
// isolated so local testing cannot receive or replace production updates.
runtimeVersion: qa ? `qa-${version}` : '1.4.0',
updates: {
fallbackToCacheTimeout: 0,
url: `https://u.expo.dev/${EAS_PROJECT_ID}`,
},
});
4 changes: 2 additions & 2 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {styled, css} from 'kstyled';
import {useMMKVString} from 'react-native-mmkv';
import {Stack, usePathname} from 'expo-router';
import * as SplashScreen from 'expo-splash-screen';
import * as Updates from 'expo-updates';
import * as Patch from '@codemagic/react-native-patch';
import {wrapWithObserveRoot} from '../src/features/runtime/observeRoot';
import {CustomPressable, Icon, useCPK} from 'cpk-ui';
import StatusBarBrightness from 'cpk-ui/components/uis/StatusbarBrightness/StatusBarBrightness';
Expand Down Expand Up @@ -120,7 +120,7 @@ function Navigator(): ReactElement | null {
icon="WifiSlash"
primaryAction={{
label: t('common.tryAgain'),
onPress: () => void Updates.reloadAsync().catch(() => undefined),
onPress: () => void Patch.restartApp().catch(() => undefined),
}}
secondaryAction={{
label: t('permission.openSettings'),
Expand Down
Loading
Loading