feat: 增加打包脚本

This commit is contained in:
2026-06-03 15:31:51 +08:00
Unverified
parent c10f7582ca
commit f942687250
2 changed files with 40 additions and 1 deletions
+2
View File
@@ -5,6 +5,8 @@ build/
dist/
wheels/
*.egg-info
pack/
*.spec
# Virtual environments
.venv
+37
View File
@@ -0,0 +1,37 @@
@echo off
setlocal
cd /d "%~dp0"
uv run --with pyinstaller pyinstaller --clean --noconfirm --onedir --console --noupx ^
--name sinopec-auto-answer ^
--paths src ^
--collect-all playwright ^
--add-binary "C:\ProgramData\miniconda3\Library\bin\libmpdec-4.dll;." ^
--add-binary "C:\ProgramData\miniconda3\Library\bin\libcrypto-3-x64.dll;." ^
--add-binary "C:\ProgramData\miniconda3\Library\bin\liblzma.dll;." ^
--add-binary "C:\ProgramData\miniconda3\Library\bin\libbz2.dll;." ^
--add-binary "C:\ProgramData\miniconda3\Library\bin\libssl-3-x64.dll;." ^
--add-binary "C:\ProgramData\miniconda3\Library\bin\ffi.dll;." ^
--add-binary "C:\ProgramData\miniconda3\Library\bin\libexpat.dll;." ^
--distpath pack ^
--workpath build\pyinstaller ^
src\auto_answer\cli.py
if errorlevel 1 exit /b %errorlevel%
copy /Y ".env.example" "pack\sinopec-auto-answer\.env.example" >nul
copy /Y ".env.example" "pack\sinopec-auto-answer\.env" >nul
(
echo @echo off
echo cd /d "%%~dp0"
echo sinopec-auto-answer.exe practice --answer-count -1 --answer-wait-s 5-10 --result-delay-s 2
echo pause
) > "pack\sinopec-auto-answer\start.bat"
if exist "pack\sinopec-auto-answer.zip" del /f /q "pack\sinopec-auto-answer.zip"
powershell -NoProfile -ExecutionPolicy Bypass -Command "Compress-Archive -Path 'pack\sinopec-auto-answer' -DestinationPath 'pack\sinopec-auto-answer.zip' -Force"
echo.
echo Package created: pack\sinopec-auto-answer.zip