Skip to content

Commit 84e8970

Browse files
committed
fix(ci): bundle linux codex cli instead of dmg mac binary
1 parent f3670b3 commit 84e8970

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,33 @@ jobs:
2929
- name: Install npm dependencies
3030
run: npm install
3131

32+
- name: Install Linux Codex CLI payload
33+
run: npm install --no-save @openai/codex@0.112.0
34+
3235
- name: Download Codex DMG
3336
run: curl -fL "https://persistent.oaistatic.com/codex-app-prod/Codex.dmg" -o Codex.dmg
3437

38+
- name: Resolve Linux Codex CLI binary path
39+
id: linux_cli
40+
run: |
41+
set -euo pipefail
42+
CLI_BIN="$(find node_modules/@openai -type f -path "*/@openai/codex-linux-*/vendor/*/path/codex" | head -n 1)"
43+
if [[ -z "${CLI_BIN}" ]]; then
44+
echo "Could not locate Linux codex binary under node_modules/@openai." >&2
45+
exit 1
46+
fi
47+
echo "path=${CLI_BIN}" >> "${GITHUB_OUTPUT}"
48+
file "${CLI_BIN}"
49+
3550
- name: Setup app payload for packaging
36-
run: SKIP_APP_INSTALL=1 bash scripts/setup.sh ./Codex.dmg
51+
run: CODEX_CLI_SOURCE_PATH="${{ steps.linux_cli.outputs.path }}" SKIP_APP_INSTALL=1 bash scripts/setup.sh ./Codex.dmg
3752

3853
- name: Verify CLI payload extracted
3954
run: |
4055
test -x app_resources/bin/codex
4156
ls -l app_resources/bin/codex
57+
file app_resources/bin/codex
58+
file app_resources/bin/codex | grep -E "ELF"
4259
4360
- name: Build DEB and AppImage
4461
run: npm run build:linux
@@ -47,6 +64,8 @@ jobs:
4764
run: |
4865
test -x dist/linux-unpacked/resources/bin/codex
4966
ls -l dist/linux-unpacked/resources/bin/codex
67+
file dist/linux-unpacked/resources/bin/codex
68+
file dist/linux-unpacked/resources/bin/codex | grep -E "ELF"
5069
5170
- name: Create or update GitHub release
5271
uses: softprops/action-gh-release@v2

scripts/internal/extract-dmg.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ WORK_DIR="${ROOT_DIR}/work_dmg"
66
APP_ASAR_DIR="${ROOT_DIR}/app_asar"
77
APP_RESOURCES_DIR="${ROOT_DIR}/app_resources"
88
DMG_PATH="${1:-${ROOT_DIR}/Codex.dmg}"
9+
CODEX_CLI_SOURCE_PATH="${CODEX_CLI_SOURCE_PATH:-}"
910

1011
if [[ ! -f "${DMG_PATH}" ]]; then
1112
echo "DMG not found: ${DMG_PATH}" >&2
@@ -79,6 +80,17 @@ if [[ ! -f "${APP_RESOURCES_DIR}/bin/codex" ]]; then
7980
exit 1
8081
fi
8182

83+
# Optional Linux override for CI packaging. Useful because DMG bundles
84+
# macOS binaries, while Linux packages require a Linux codex binary.
85+
if [[ -n "${CODEX_CLI_SOURCE_PATH}" ]]; then
86+
if [[ ! -f "${CODEX_CLI_SOURCE_PATH}" ]]; then
87+
echo "CODEX_CLI_SOURCE_PATH does not exist: ${CODEX_CLI_SOURCE_PATH}" >&2
88+
exit 1
89+
fi
90+
cp -f "${CODEX_CLI_SOURCE_PATH}" "${APP_RESOURCES_DIR}/bin/codex"
91+
chmod +x "${APP_RESOURCES_DIR}/bin/codex" || true
92+
fi
93+
8294
echo "Done."
8395
echo "app_asar: ${APP_ASAR_DIR}"
8496
if [[ -d "${APP_RESOURCES_DIR}/bin" ]]; then

0 commit comments

Comments
 (0)