fix(ci): keep mobile asset builds on one pnpm layout

This commit is contained in:
DIYgod
2026-09-22 16:42:50 +08:00
parent 2f392594d5
commit fac0b0832a
6 changed files with 26 additions and 20 deletions
+1 -3
View File
@@ -85,7 +85,7 @@ jobs:
run: pnpm install --frozen-lockfile --child-concurrency=1
- name: Build mobile web assets
run: pnpm --dir apps/mobile/web-app build --outDir ../../../out/rn-web/html-renderer
run: pnpm --dir apps/mobile/web-app build --outDir "${{ github.workspace }}/out/rn-web/html-renderer"
- name: Validate release profile
if: github.event.inputs.release == 'true'
@@ -102,8 +102,6 @@ jobs:
env:
EAS_BUILD_DISABLE_EXPO_DOCTOR_STEP: "1"
EAS_NO_FROZEN_LOCKFILE: "1"
pnpm_config_node_linker: isolated
pnpm_config_shamefully_hoist: "false"
- name: 📤 Upload apk Artifact
if: github.event.inputs.profile != 'production'
+3 -9
View File
@@ -55,7 +55,7 @@ jobs:
run: pnpm install --frozen-lockfile --child-concurrency=1
- name: Build mobile web assets
run: pnpm --dir apps/mobile/web-app build --outDir ../../../out/rn-web/html-renderer
run: pnpm --dir apps/mobile/web-app build --outDir "${{ github.workspace }}/out/rn-web/html-renderer"
- name: 🔨 Build iOS IPA
working-directory: apps/mobile
@@ -65,8 +65,6 @@ jobs:
EAS_NO_FROZEN_LOCKFILE: "1"
SENTRY_AUTH_TOKEN: ${{ secrets.RN_SENTRY_AUTH_TOKEN }}
CI: true
pnpm_config_node_linker: isolated
pnpm_config_shamefully_hoist: "false"
# Optional: Upload artifact
- name: 📤 Upload IPA
@@ -112,7 +110,7 @@ jobs:
run: pnpm install --frozen-lockfile --child-concurrency=1
- name: Build mobile web assets
run: pnpm --dir apps/mobile/web-app build --outDir ../../../out/rn-web/html-renderer
run: pnpm --dir apps/mobile/web-app build --outDir "${{ github.workspace }}/out/rn-web/html-renderer"
- name: 🔨 Build iOS IPA
working-directory: apps/mobile
@@ -122,8 +120,6 @@ jobs:
EAS_NO_FROZEN_LOCKFILE: "1"
CI: true
SENTRY_AUTH_TOKEN: ${{ secrets.RN_SENTRY_AUTH_TOKEN }}
pnpm_config_node_linker: isolated
pnpm_config_shamefully_hoist: "false"
# Optional: Upload artifact
- name: 📤 Upload IPA
uses: actions/upload-artifact@v7
@@ -163,7 +159,7 @@ jobs:
run: pnpm install --frozen-lockfile --child-concurrency=1
- name: Build mobile web assets
run: pnpm --dir apps/mobile/web-app build --outDir ../../../out/rn-web/html-renderer
run: pnpm --dir apps/mobile/web-app build --outDir "${{ github.workspace }}/out/rn-web/html-renderer"
- name: 🔨 Build iOS IPA
working-directory: apps/mobile
@@ -173,8 +169,6 @@ jobs:
EAS_NO_FROZEN_LOCKFILE: "1"
CI: true
SENTRY_AUTH_TOKEN: ${{ secrets.RN_SENTRY_AUTH_TOKEN }}
pnpm_config_node_linker: isolated
pnpm_config_shamefully_hoist: "false"
# Optional: Upload artifact
- name: 📤 Upload IPA
uses: actions/upload-artifact@v7
+2 -6
View File
@@ -70,7 +70,7 @@ jobs:
run: pnpm install --frozen-lockfile --child-concurrency=1
- name: Build mobile web assets
run: pnpm --dir apps/mobile/web-app build --outDir ../../../out/rn-web/html-renderer
run: pnpm --dir apps/mobile/web-app build --outDir "${{ github.workspace }}/out/rn-web/html-renderer"
- name: 🔨 Build iOS IPA
working-directory: apps/mobile
@@ -80,8 +80,6 @@ jobs:
EAS_NO_FROZEN_LOCKFILE: "1"
SENTRY_AUTH_TOKEN: ${{ secrets.RN_SENTRY_AUTH_TOKEN }}
CI: true
pnpm_config_node_linker: isolated
pnpm_config_shamefully_hoist: "false"
# Optional: Upload artifact
- name: 📤 Upload IPA
@@ -132,7 +130,7 @@ jobs:
run: pnpm install --frozen-lockfile --child-concurrency=1
- name: Build mobile web assets
run: pnpm --dir apps/mobile/web-app build --outDir ../../../out/rn-web/html-renderer
run: pnpm --dir apps/mobile/web-app build --outDir "${{ github.workspace }}/out/rn-web/html-renderer"
- name: 🔨 Build iOS IPA
working-directory: apps/mobile
@@ -142,8 +140,6 @@ jobs:
EAS_NO_FROZEN_LOCKFILE: "1"
CI: true
SENTRY_AUTH_TOKEN: ${{ secrets.RN_SENTRY_AUTH_TOKEN }}
pnpm_config_node_linker: isolated
pnpm_config_shamefully_hoist: "false"
# Optional: Upload artifact
- name: 📤 Upload IPA
uses: actions/upload-artifact@v7
+1 -1
View File
@@ -17,7 +17,7 @@ Exact npm metadata, refs, raw diffs and focused source diffs are retained in `/t
- TypeScript stays on 6.0.3: the real TypeScript 7.0.2 substitution fails in typescript-eslint because its package exports no JS compiler API. See the [executable compatibility investigation](dependency-upgrade-typescript-2026-09-22.md).
- `@vercel/node` uses 12.0.1, the latest release with public source/changelog provenance. Version 13.0.1 has identical published runtime but an untraceable newer build-utils peer. See [source verification](dependency-upgrade-vercel-node-2026-09-22.md).
- pnpm 12.5.1 migrates `.npmrc` layout policy into workspace settings, replaces `onlyBuiltDependencies` with `allowBuilds`, removes the obsolete `ignorePatchFailures: false` flag, and renames mobile CI overrides to `pnpm_config_*`. Frozen installation and graph checks are recorded in [the package-manager audit](dependency-upgrade-pnpm-2026-09-22.md).
- pnpm 12.5.1 migrates `.npmrc` layout policy into workspace settings, replaces `onlyBuiltDependencies` with `allowBuilds`, removes the obsolete `ignorePatchFailures: false` flag, and preserves one consistent hoisted dependency layout throughout mobile CI (see the post-publication configuration fix in the package-manager audit). Frozen installation and graph checks are recorded in [the package-manager audit](dependency-upgrade-pnpm-2026-09-22.md).
## Required adaptations
@@ -83,3 +83,7 @@ The regression tests compile all nine semantic classes with and without `/50`. T
The mobile and HTML-renderer packages now expose their existing Vitest configurations through `scripts.test`, so root recursive tests include their auth, purchase, migration and reader regressions. Existing TTS/spotlight tests use the Vitest runner, release-script tests resolve fixtures from their own file URL, and GitHub-output assertions check the existing delimiter format. These changes fix test discovery/cwd assumptions without changing release scripts.
Final Node 24 / pnpm 12 checks passed: mobile typecheck; lint with no errors; the complete mobile suite (35 files, 152 tests); HTML renderer (2 files, 12 tests); root recursive test command (130 files, 688 passed, 2 existing CLI skips). Logs: `/tmp/folo-frontend-final-{typecheck,lint,test,format}.log`. The migration snapshot/multiple-subscriber regression and UIKit tests are included in this count.
## Dev build workflow follow-up
The first published dev SHA passed local native acceptance but exposed a clean-runner Expo configuration failure before native compilation. The workflow HTML assets path resolved to `apps/out` instead of repository-root `out`. The fallback renderer build then inherited conflicting pnpm 12 linker overrides and automatically replaced modules inside the active Expo process. All six mobile build jobs now use an absolute repository-root output path and the same hoisted workspace layout throughout. The exact failure evidence, install recovery and validation boundary are recorded in [the pnpm audit](dependency-upgrade-pnpm-2026-09-22.md#dev-ci-follow-up-mobile-config-evaluation). This is build-environment repair; application code and reviewed dependency versions are unchanged.
+15 -1
View File
@@ -14,7 +14,7 @@ Configuration now comes from camelCase workspace settings; `.npmrc` retains only
- Translate the existing build allowlist into `allowBuilds` without allowing every package. Additional lifecycle decisions, if required by the clean install, are recorded below.
- Remove `ignorePatchFailures: false`, keeping the new mandatory failure behavior.
- Update the root package-manager pin. GitHub workflows already obtain their version from this field.
- Rename the existing mobile build-job linker environment overrides from `npm_config_*` to `pnpm_config_*`; their intended isolated EAS install layout must still apply.
- Keep the EAS jobs on the same workspace `hoisted` layout as their initial install. The first publication exposed that renaming the legacy linker environment overrides to `pnpm_config_*` activated an unsafe mid-command layout change; those overrides are removed in the follow-up below.
- Keep all dependency manifests, override versions, and patch contents unchanged during this migration.
## Validation
@@ -30,3 +30,17 @@ Configuration now comes from camelCase workspace settings; `.npmrc` retains only
- Fresh pnpm 12 installation correctly omits `electron-windows-store` on macOS. This exposed a top-level AppX maker import in Forge configuration. The Windows Store maker now uses Forge's lazy `name`/`config` registration inside the existing Microsoft Store branch, so macOS configuration loading no longer imports a Windows-only package. Its publisher, assets, identity and protocol configuration are retained.
- After that fix, the unsigned macOS arm64 `.app` was rebuilt from the pnpm 12 tree and launched. Its asar resolves jsdom 30 (including computed CSS and Unicode HTML), font-list and language detection; the preload IPC bridge works. Logs: `/tmp/folo-pnpm12-package.log`, `/tmp/folo-pnpm12-packaged-runtime.log`. No signing/notarization or publishing occurred.
## Dev CI follow-up: mobile config evaluation
The first dev publication (`2f392594d5ab02c35707f4f0639e3abcb50d37b2`) passed the full quality workflow, desktop builds on macOS/Linux/Windows, and all three Cloudflare deployments. The Android, iOS and iOS development workflows failed before native compilation, while running Expo `config --json` ([Android log](https://github.com/RSSNext/Folo/actions/runs/35704331868)).
The HTML build wrapper changes its directory again to `apps/mobile/web-app/html-renderer`. Its workflow argument `../../../out/rn-web/html-renderer` therefore wrote to `apps/out`, while the Expo asset plugin requires repository-root `out/rn-web`. Existing local output had concealed this clean-checkout discrepancy. All six mobile jobs now pass the quoted absolute `${{ github.workspace }}/out/rn-web/html-renderer` path.
A clean fixture also reproduced the dependency-layout failure: the asset plugin's fallback invokes `pnpm build` during Expo configuration. Under pnpm 12, the EAS step's `pnpm_config_node_linker=isolated` and `pnpm_config_shamefully_hoist=false` trigger an automatic install before the script, replacing the hoisted modules while Expo is still using them. The HTML build then loses hoisted icon/Tailwind resolution, and Expo's error handler loses `chalk`. The three workflows now remove these conflicting overrides and preserve `nodeLinker: hoisted` / `shamefullyHoist: true` from the workspace for the entire build. No dependency versions change.
The initial diagnostic fixture used source symlinks, so its automatic install also relinked the local workspace. The owner stopped the affected quality run and restored the standard hoisted tree with `pnpm install --frozen-lockfile`; the lockfile is byte-identical to the published SHA and Expo/CLI/chalk resolution is restored. Evidence: `/tmp/folo-ci-expo-clean-fixture-error.log` and `/tmp/folo-ci-layout-restore-install.log`. The first repair restored root modules but left an obsolete package-local Vitest shim from the isolated layout; the subsequent test failed before running tests (`/tmp/folo-ci-layout-stale-bin-test-failure.log`). All generated workspace `node_modules` directories were therefore removed and restored from the same frozen lockfile to eliminate the mixed layout. These failed-run records are retained; interrupted or failed checks are not counted as successful validation.
The corrected absolute renderer build was exercised both directly with Vite and through the exact `pnpm --dir apps/mobile/web-app build --outDir <absolute-path>` wrapper. A fixture with no initial root `out` then passed Expo `config --json` under CI's Node 22.23.2, `env -i`, and `EXPO_NO_DOTENV=1`, with no `pnpm` available on PATH: valid SDK 57 / 24-plugin JSON and empty stderr prove the asset fallback was not invoked. Both lockfile and module-layout metadata stayed unchanged. Logs: `/tmp/folo-ci-absolute-assets-build.log`, `/tmp/folo-ci-absolute-pnpm-assets-build.log`, `/tmp/folo-ci-expo-absolute-assets-error.log`.
After the clean restoration, the ordered root checks passed: typecheck 20/20 tasks, lint 0 errors / 977 warnings, tests 130 files / 688 passed / 2 existing skips with no unhandled errors, and whole-repository formatting. Evidence: `/tmp/folo-ci-layout-clean-install.log` and `/tmp/folo-dev-assets-fix-{typecheck,lint,test,format}.log`. A structural check parsed all three workflow YAML files and verified every renderer output path and the absence of conflicting linker overrides. Remote CI results for the follow-up commit are verified separately from these local checks.