From 2684c0a608e2b602a51243b70fa47a4d58452413 Mon Sep 17 00:00:00 2001 From: lyc Date: Tue, 7 Apr 2026 09:39:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?ci(build):=20=E9=85=8D=E7=BD=AE=20npm=20?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E5=B9=B6=E4=BC=98=E5=8C=96=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 .npmrc 文件,配置 npmmirror 镜像 - 增加 npm registry 日志输出 - 使用 verbose 级别安装构建依赖 - 修改文件属性清理方式,提高兼容性 --- .npmrc | 1 + codex-intel.sh | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..5e4086a --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +registry=https://registry.npmmirror.com/ diff --git a/codex-intel.sh b/codex-intel.sh index c81280c..4b4bc2a 100755 --- a/codex-intel.sh +++ b/codex-intel.sh @@ -305,8 +305,9 @@ prepare_artifacts() { npm init -y >/dev/null fi + log "npm registry: $(npm config get registry 2>/dev/null || true)" log "Installing build dependencies" - npm install \ + npm install --loglevel verbose \ "electron@${ELECTRON_VERSION}" \ "better-sqlite3@${BETTER_SQLITE3_VERSION}" \ "node-pty@${NODE_PTY_VERSION}" \ @@ -553,7 +554,7 @@ repackage_app() { log "Removing stale signatures and quarantine metadata" find "$OUTPUT_APP" -name _CodeSignature -type d -prune -exec rm -rf {} + - xattr -cr "$OUTPUT_APP" + find "$OUTPUT_APP" -exec xattr -c {} + >/dev/null 2>&1 || true log "Ad-hoc signing rebuilt app" codesign --force --deep --sign - "$OUTPUT_APP" From b26e3576fde7110159431620c7e1607d1239a152 Mon Sep 17 00:00:00 2001 From: lyc Date: Tue, 7 Apr 2026 09:50:57 +0800 Subject: [PATCH 2/2] ci: auto-install Intel Codex CLI during build --- codex-intel.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/codex-intel.sh b/codex-intel.sh index 4b4bc2a..7ee6275 100755 --- a/codex-intel.sh +++ b/codex-intel.sh @@ -280,11 +280,28 @@ detect_cli_bin() { return 1 } +ensure_global_codex_cli() { + if command -v codex >/dev/null 2>&1; then + return 0 + fi + + if ! command -v npm >/dev/null 2>&1; then + return 1 + fi + + log "Intel Codex CLI not found; installing globally via npm" + npm install -g @openai/codex --registry https://registry.npmmirror.com/ --no-audit +} + prepare_artifacts() { require_command npm require_command npx require_command xcode-select + if [[ "$SKIP_CLI_BUNDLE" -eq 0 ]]; then + ensure_global_codex_cli || true + fi + if ! xcode-select -p >/dev/null 2>&1; then log "Xcode Command Line Tools are required." log "Attempting to launch installer: xcode-select --install" @@ -532,8 +549,12 @@ repackage_app() { log "Bundling x64 codex CLI" copy_file "$CLI_BIN" "${output_resources_dir}/codex" chmod +x "${output_resources_dir}/codex" + copy_file "$CLI_BIN" "${output_resources_dir}/bin/codex" + chmod +x "${output_resources_dir}/bin/codex" copy_file "$CLI_BIN" "${output_unpacked_dir}/codex" chmod +x "${output_unpacked_dir}/codex" + copy_file "$CLI_BIN" "${output_unpacked_dir}/bin/codex" + chmod +x "${output_unpacked_dir}/bin/codex" else log "Skipping bundled CLI" rm -f "${output_resources_dir}/codex"