From 6e1b8e6b10b5a5fb2db294f3a8370f40428e4e31 Mon Sep 17 00:00:00 2001 From: KenanZhu <3471685733@qq.com> Date: Tue, 24 Feb 2026 17:39:49 +0800 Subject: [PATCH] =?UTF-8?q?ci(workflows):=20=E4=BF=AE=E6=94=B9=20build.yml?= =?UTF-8?q?=20=E4=B8=AD=20PyInstaller=20=E6=89=93=E5=8C=85=E5=8F=82?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E5=8F=91=E5=B8=83=E5=8E=8B=E7=BC=A9=E5=8C=85?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E4=B8=BA=E6=96=87=E4=BB=B6=E5=A4=B9?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b27fab..0b54f37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -164,10 +164,7 @@ jobs: "exe = EXE(" " pyz," " a.scripts," - " a.binaries," - " a.datas," - " []," - " name='$exeName'," + " name=AutoLibrary," " debug=False," " bootloader_ignore_signals=False," " strip=False," @@ -182,10 +179,20 @@ jobs: " entitlements_file=None," " icon=['src\\gui\\resources\\icons\\AutoLibrary_32x32.ico']," ")" + "" + "coll = COLLECT(" + " exe," + " a.binaries," + " a.datas," + " strip=False," + " upx=True," + " upx_exclude=[]," + " name='$exeName'" + ")" ) $specLines | Out-File -FilePath "Main.spec" -Encoding UTF8 - Write-Host "✓ Main.spec generated successfully" + Write-Host "✓ Main.spec (non-single file) generated successfully" Write-Host "`nGenerated Main.spec ============" Get-Content "Main.spec" | Write-Host Write-Host "==================================`n" @@ -200,17 +207,17 @@ jobs: run: | $tagName = "${{ steps.get_version.outputs.TAG_NAME }}" $version = "${{ steps.get_version.outputs.VERSION }}" - $exeName = "AutoLibrary-$version.exe" + $distDir = "dist/AutoLibrary-$version" $zipName = "AutoLibrary.$tagName-windows-x86_64.zip" echo "ZIP_PATH=$zipName" >> $env:GITHUB_OUTPUT - Write-Host "Looking for executable: dist/$exeName" - if (Test-Path "dist/$exeName") { - Compress-Archive -Path "dist/$exeName" -DestinationPath $zipName - Write-Host "✓ Created release archive: $zipName" + Write-Host "Looking for distribution directory: $distDir" + if (Test-Path $distDir) { + Compress-Archive -Path "$distDir/*" -DestinationPath $zipName + Write-Host "✓ Created release archive (directory mode): $zipName" } else { - Write-Error "✗ Executable not found: dist/$exeName" + Write-Error "✗ Distribution directory not found: $distDir" Write-Host "Files in dist directory:" Get-ChildItem "dist" | ForEach-Object { Write-Host " - $($_.Name)" } exit 1