-
Notifications
You must be signed in to change notification settings - Fork 753
Expand file tree
/
Copy pathbuild.sh
More file actions
49 lines (40 loc) · 1.08 KB
/
build.sh
File metadata and controls
49 lines (40 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/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}