Initial commit

This commit is contained in:
doujiang
2026-03-21 23:00:03 +08:00
commit 8f51c3d378
92 changed files with 28858 additions and 0 deletions

50
build.sh Normal file
View File

@@ -0,0 +1,50 @@
#!/bin/bash
# Cross-platform build script. Run it on the target OS you want to package for.
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-console-${PLATFORM}-${ARCH}${EXT}"
echo "=== Build platform: ${PLATFORM} (${ARCH}) ==="
echo "=== Output file: dist/${OUTPUT_NAME} ==="
# Install build dependency.
pip install pyinstaller --quiet 2>/dev/null || \
uv run --with pyinstaller pyinstaller --version > /dev/null 2>&1
# Run PyInstaller. Prefer uv when available.
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
# Rename the generated binary to include platform metadata.
rm -f "dist/${OUTPUT_NAME}"
mv "dist/codex-console${EXT}" "dist/${OUTPUT_NAME}" 2>/dev/null || \
mv "dist/codex-console" "dist/${OUTPUT_NAME}" 2>/dev/null
echo "=== Build complete: dist/${OUTPUT_NAME} ==="
ls -lh "dist/${OUTPUT_NAME}"