[patch] 修正ks3问题且优化pillow依赖安装时间
This commit is contained in:
@@ -398,10 +398,10 @@ class DatabaseVersionManager:
|
||||
f"+{stats['lines_added']}/-{stats['lines_deleted']} 行")
|
||||
|
||||
# 6. 创建版本记录
|
||||
# 生成下载地址(KS3对象存储 - 广州节点)
|
||||
# 生成下载地址(KS3对象存储 - 广州节点,使用三级域名格式)
|
||||
installer_filename = f"ShuiDi_AI_Assistant_Setup_v{next_version}.exe"
|
||||
download_url = f"https://ks3-cn-guangzhou.ksyuncs.com/shuidrop-chat-server/installers/{installer_filename}"
|
||||
# 完整示例: https://ks3-cn-guangzhou.ksyuncs.com/shuidrop-chat-server/installers/ShuiDi_AI_Assistant_Setup_v1.5.0.exe
|
||||
download_url = f"https://shuidrop-chat-server.ks3-cn-guangzhou.ksyuncs.com/installers/{installer_filename}"
|
||||
# 完整示例: https://shuidrop-chat-server.ks3-cn-guangzhou.ksyuncs.com/installers/ShuiDi_AI_Assistant_Setup_v1.5.0.exe
|
||||
|
||||
version_record = {
|
||||
'version': next_version,
|
||||
|
||||
@@ -96,9 +96,10 @@ def upload_installer(connection, installer_path):
|
||||
policy='public-read' # Set ACL policy
|
||||
)
|
||||
|
||||
# Generate download URL (using HTTPS)
|
||||
# Generate download URL (using KS3 third-level domain format)
|
||||
# Format: https://{bucket}.{endpoint}/{key}
|
||||
protocol = 'https' if KS3_IS_SECURE else 'http'
|
||||
download_url = f"{protocol}://{KS3_ENDPOINT}/{KS3_BUCKET}/{ks3_key}"
|
||||
download_url = f"{protocol}://{KS3_BUCKET}.{KS3_ENDPOINT}/{ks3_key}"
|
||||
|
||||
logger.info(f"Upload successful!")
|
||||
logger.info(f"Download URL: {download_url}")
|
||||
|
||||
@@ -140,19 +140,32 @@ jobs:
|
||||
Write-Host "Step 4.5: Build production executable";
|
||||
Write-Host "==========================================";
|
||||
|
||||
# Ensure PyInstaller and Pillow are in the same Python environment
|
||||
Write-Host "Installing dependencies...";
|
||||
python -m pip install --upgrade pip --quiet;
|
||||
python -m pip install pyinstaller --upgrade --quiet;
|
||||
python -m pip install Pillow --quiet;
|
||||
# Check and install dependencies only if needed
|
||||
Write-Host "Checking dependencies...";
|
||||
|
||||
# Verify installation
|
||||
Write-Host "Python version:";
|
||||
python --version;
|
||||
Write-Host "PyInstaller version:";
|
||||
python -m PyInstaller --version;
|
||||
Write-Host "Pillow version:";
|
||||
python -c "from PIL import Image; print(Image.__version__)";
|
||||
# Check PyInstaller
|
||||
$pyinstallerInstalled = python -c "try: import PyInstaller; print('installed')`nexcept: print('not-installed')" 2>$null;
|
||||
if ($pyinstallerInstalled -ne "installed") {
|
||||
Write-Host "Installing PyInstaller...";
|
||||
python -m pip install pyinstaller --quiet;
|
||||
} else {
|
||||
Write-Host "PyInstaller: already installed";
|
||||
}
|
||||
|
||||
# Check Pillow
|
||||
$pillowInstalled = python -c "try: from PIL import Image; print('installed')`nexcept: print('not-installed')" 2>$null;
|
||||
if ($pillowInstalled -ne "installed") {
|
||||
Write-Host "Installing Pillow...";
|
||||
python -m pip install Pillow --quiet;
|
||||
} else {
|
||||
Write-Host "Pillow: already installed";
|
||||
}
|
||||
|
||||
Write-Host "";
|
||||
Write-Host "Environment ready:";
|
||||
Write-Host " Python:" (python --version);
|
||||
Write-Host " PyInstaller:" (python -m PyInstaller --version);
|
||||
Write-Host " Pillow:" (python -c "from PIL import Image; print(Image.__version__)");
|
||||
Write-Host "";
|
||||
|
||||
python build_production.py;
|
||||
|
||||
Reference in New Issue
Block a user