diff --git a/.changeset/186-eas-config.md b/.changeset/186-eas-config.md new file mode 100644 index 0000000..b0c1557 --- /dev/null +++ b/.changeset/186-eas-config.md @@ -0,0 +1,16 @@ +--- +"mobile": patch +--- + +Clause-②: no +Metadata-protocol: none + +EAS keeps the build numbers: `eas.json` sets `cli.appVersionSource` to +`remote`, so iOS `buildNumber` and Android `versionCode` live on EAS servers and +`production` builds increment them there. The first remote build seeds them from +the app config, which sets none, so they start from 1. + +`eas-build.yml` builds each platform in its own job, so a failing iOS build no +longer stops the Android one. A push to `main` builds Android only; iOS builds +run by hand (`workflow_dispatch`) until the project has Apple signing +credentials. diff --git a/.github/workflows/eas-build.yml b/.github/workflows/eas-build.yml index f4283fa..d8f04a6 100644 --- a/.github/workflows/eas-build.yml +++ b/.github/workflows/eas-build.yml @@ -27,13 +27,20 @@ on: permissions: contents: read +# One job per platform, so a failing iOS build cannot stop the Android one. +# +# EAS needs an account credential this repo can't provide by default. The secret +# can't be read in a job-level `if`, so each job mirrors it into an env var and +# guards each step — a job is a clean no-op (green) when it's unset. jobs: - build: - name: EAS Build (${{ inputs.platform || 'all' }}) + ios: + name: EAS Build iOS (${{ inputs.profile || 'preview' }}) + # iOS runs on workflow_dispatch only (platform `ios` or `all`) until Apple + # signing credentials exist for the EAS project. To build iOS on every push + # to main as well, replace the `if:` line below with: + # if: ${{ github.event_name == 'push' || inputs.platform == 'ios' || inputs.platform == 'all' }} + if: ${{ github.event_name == 'workflow_dispatch' && (inputs.platform == 'ios' || inputs.platform == 'all') }} runs-on: ubuntu-latest - # EAS needs an account credential this repo can't provide by default. The - # secret can't be read in a job-level `if`, so mirror it into an env var and - # guard each step — the job is a clean no-op (green) when it's unset. env: EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} steps: @@ -56,8 +63,36 @@ jobs: - run: pnpm install if: ${{ env.EXPO_TOKEN != '' }} - name: Build iOS - if: ${{ env.EXPO_TOKEN != '' && (inputs.platform == 'ios' || inputs.platform == 'all' || inputs.platform == '') }} + if: ${{ env.EXPO_TOKEN != '' }} run: eas build --platform ios --profile ${{ inputs.profile || 'preview' }} --non-interactive + + android: + name: EAS Build Android (${{ inputs.profile || 'preview' }}) + # Every push to main builds Android with the `preview` profile; a + # workflow_dispatch builds it for platform `android` or `all`. + if: ${{ github.event_name == 'push' || inputs.platform == 'android' || inputs.platform == 'all' }} + runs-on: ubuntu-latest + env: + EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} + steps: + - uses: actions/checkout@v4 + if: ${{ env.EXPO_TOKEN != '' }} + - uses: pnpm/action-setup@v4 + if: ${{ env.EXPO_TOKEN != '' }} + with: + version: 10 + - uses: actions/setup-node@v4 + if: ${{ env.EXPO_TOKEN != '' }} + with: + node-version: 22 + cache: pnpm + - uses: expo/expo-github-action@v8 + if: ${{ env.EXPO_TOKEN != '' }} + with: + eas-version: latest + token: ${{ secrets.EXPO_TOKEN }} + - run: pnpm install + if: ${{ env.EXPO_TOKEN != '' }} - name: Build Android - if: ${{ env.EXPO_TOKEN != '' && (inputs.platform == 'android' || inputs.platform == 'all' || inputs.platform == '') }} + if: ${{ env.EXPO_TOKEN != '' }} run: eas build --platform android --profile ${{ inputs.profile || 'preview' }} --non-interactive diff --git a/docs/DEPLOYMENT.md b/docs/DEPLOYMENT.md index 61a6f7b..4eb05df 100644 --- a/docs/DEPLOYMENT.md +++ b/docs/DEPLOYMENT.md @@ -122,10 +122,20 @@ eas submit --platform ios|android --profile production The app builds under the EAS project `@objectstack/objectos`. `owner`, `slug` and `extra.eas.projectId` in `app.config.ts` name it together. +Build numbers (iOS `buildNumber`, Android `versionCode`) live on EAS servers +(`cli.appVersionSource: "remote"` in `eas.json`), not in `app.config.ts`. A +`production` build increments them (`autoIncrement`); other profiles reuse the +latest. `eas build:version:get` reads them and `eas build:version:set` changes +them. + CI (`.github/workflows/`): - `ci.yml` — Jest with coverage on every PR; - `lint-typecheck.yml` — `tsc` + ESLint; +- `eas-build.yml` — a push to `main` builds Android with the `preview` + profile. iOS builds only when run by hand (`workflow_dispatch`, platform `ios` + or `all`) until the project has Apple signing credentials. Each platform is + its own job, so one failing does not stop the other; - `eas-build.yml`, `eas-update.yml`, `eas-submit.yml` — need the `EXPO_TOKEN` secret and are clean no-ops without it. diff --git a/eas.json b/eas.json index d84b56f..b08606d 100644 --- a/eas.json +++ b/eas.json @@ -1,6 +1,7 @@ { "cli": { - "version": ">= 14.0.0" + "version": ">= 14.0.0", + "appVersionSource": "remote" }, "build": { "development": {