ci: mac x64 改为 Apple 芯片交叉打包;原生依赖免编译并加打包冒烟测试 - #109
Merged
Merged
Conversation
- 原生依赖均为 N-API 预编译:去掉 @electron/rebuild,better-sqlite3 不再跑空转的 node-gyp(Windows 约 78s),node-pty 直接用自带 prebuilds - mac x64 在 macos-15 上按目标架构装包(--cpu + npm_config_arch,关构建结果缓存) - afterPack 只留目标架构的 node-pty / pi-tui 预编译,并校验包内 Mach-O 均含目标架构 - 三平台打包后用产物自带 Electron 冒烟加载 better-sqlite3、sqlite-vec、classic-level、 node-pty、node-datachannel,并执行 ripgrep、rtk
收集器漏掉 optional 平台兄弟包(同 node-datachannel),v0.1.34 Windows 包内无 sqlite-vec-windows-x64,记忆向量检索退回扫 BLOB。显式拷贝平台包进包。
node-pty 1.1.0 发布包内 prebuilds/darwin-*/spawn-helper 为 644;不再为 Electron 重编后直接用 prebuilds,posix_spawnp 失败导致终端起不来。afterPack 与 postinstall 都补执行位。
mac 包里 Linux/Windows/Android 预编译约 3.9MB,dmg 小 1.8MB。支持 x64+arm64 这类多架构目录名。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
结果
构建(build-app 起到最后一个平台结束):v0.1.34 17m12s → #108 后 9m58s → 本 PR 5m44s
验证 run:https://github.com/J3n5en/EnsoCode/actions/runs/35901114803 (未发布)
改动
@electron/rebuild;better-sqlite3 移入ignoredBuiltDependencies(有预编译时 node-gyp 也只是空转,Windows 约 78s)pnpm install --cpu=x64,npm_config_arch=x64(ripgrep),关构建结果缓存(否则复用本机架构的 postinstall 产物)<platform>-<arch>;mac 包签名前校验所有 Mach-O 含目标架构,不符即失败冒烟测试顺带查出的两个问题
prebuilds/darwin-*/spawn-helper是 644,不再重编后直接用它会posix_spawnp failed。afterPack 与 postinstall 都补执行位files拷真实目录供require.resolve,dll 本体经extraResources放进app.asar.unpacked(from/to 拷贝不吃 asarUnpack,loadExtension读不了 asar)本地验证
pnpm typecheck、pnpm test、biome check .通过注意
node-pty/build(旧 electron-rebuild 产物)仍会被优先加载,无害;全新安装走 prebuilds后续补充
x64+arm64多架构目录):安装包 mac -1.8MB、Windows -1.4MB最终验证 run:https://github.com/J3n5en/EnsoCode/actions/runs/35921218319