Skip to content

Commit 12cfd3c

Browse files
committed
fix(ci): detect codex linux binary path and add arch fallback install
1 parent 84e8970 commit 12cfd3c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,27 @@ jobs:
3939
id: linux_cli
4040
run: |
4141
set -euo pipefail
42-
CLI_BIN="$(find node_modules/@openai -type f -path "*/@openai/codex-linux-*/vendor/*/path/codex" | head -n 1)"
42+
find_cli_bin() {
43+
find node_modules/@openai -type f -name codex \
44+
| grep -E '/@openai/codex-linux-[^/]+/vendor/.+/(codex/codex|path/codex)$' \
45+
| head -n 1 || true
46+
}
47+
48+
CLI_BIN="$(find_cli_bin)"
49+
50+
if [[ -z "${CLI_BIN}" ]]; then
51+
ARCH="$(uname -m)"
52+
if [[ "${ARCH}" == "x86_64" ]]; then
53+
npm install --no-save "@openai/codex-linux-x64@npm:@openai/codex@0.112.0-linux-x64"
54+
elif [[ "${ARCH}" == "aarch64" || "${ARCH}" == "arm64" ]]; then
55+
npm install --no-save "@openai/codex-linux-arm64@npm:@openai/codex@0.112.0-linux-arm64"
56+
else
57+
echo "Unsupported Linux arch for Codex CLI payload: ${ARCH}" >&2
58+
exit 1
59+
fi
60+
CLI_BIN="$(find_cli_bin)"
61+
fi
62+
4363
if [[ -z "${CLI_BIN}" ]]; then
4464
echo "Could not locate Linux codex binary under node_modules/@openai." >&2
4565
exit 1

0 commit comments

Comments
 (0)