feat: 增加打包脚本
This commit is contained in:
+3
-1
@@ -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/
|
||||
.playwright-mcp/
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user