From f942687250366bba27ef87097d970ecff58644cb Mon Sep 17 00:00:00 2001 From: chuan Date: Wed, 3 Jun 2026 15:31:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=89=93=E5=8C=85?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +++- pack.bat | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 pack.bat diff --git a/.gitignore b/.gitignore index 440a0be..df122e4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ build/ dist/ wheels/ *.egg-info +pack/ +*.spec # Virtual environments .venv @@ -13,4 +15,4 @@ wheels/ # Local browser login state .auth/ -.playwright-mcp/ \ No newline at end of file +.playwright-mcp/ diff --git a/pack.bat b/pack.bat new file mode 100644 index 0000000..52a2c5d --- /dev/null +++ b/pack.bat @@ -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