Files
codex-register/build.sh
237899745 0f9948ffc3
Some checks are pending
Docker Image CI / build-and-push-image (push) Waiting to run
feat: codex-register with Sub2API增强 + Playwright引擎
2026-03-22 00:24:16 +08:00

50 lines
1.1 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 跨平台打包脚本(在各平台上分别运行)
set -e
OS=$(uname -s)
ARCH=$(uname -m)
case "$OS" in
Darwin)
PLATFORM="macos"
EXT=""
;;
Linux)
PLATFORM="linux"
EXT=""
;;
MINGW*|CYGWIN*|MSYS*)
PLATFORM="windows"
EXT=".exe"
;;
*)
PLATFORM="$OS"
EXT=""
;;
esac
OUTPUT_NAME="codex-register-${PLATFORM}-${ARCH}${EXT}"
echo "=== 构建平台: ${PLATFORM} (${ARCH}) ==="
echo "=== 输出文件: dist/${OUTPUT_NAME} ==="
# 安装打包依赖
pip install pyinstaller --quiet 2>/dev/null || \
uv run --with pyinstaller pyinstaller --version > /dev/null 2>&1
# 执行打包(优先用 uv回退到直接调用
if command -v uv &>/dev/null; then
uv run --with pyinstaller pyinstaller codex_register.spec --clean --noconfirm
else
pyinstaller codex_register.spec --clean --noconfirm
fi
# 重命名输出文件
mv dist/codex-register${EXT} dist/${OUTPUT_NAME} 2>/dev/null || \
mv "dist/codex-register" "dist/${OUTPUT_NAME}" 2>/dev/null || true
echo "=== 构建完成: dist/${OUTPUT_NAME} ==="
ls -lh dist/${OUTPUT_NAME}