mirror of
https://github.com/KenanZhu/AutoLibrary.git
synced 2026-06-18 07:23:03 +08:00
ci(workflows): 修改 build.yml 中 PyInstaller 打包参数,发布压缩包修改为为文件夹模式
This commit is contained in:
+18
-11
@@ -164,10 +164,7 @@ jobs:
|
|||||||
"exe = EXE("
|
"exe = EXE("
|
||||||
" pyz,"
|
" pyz,"
|
||||||
" a.scripts,"
|
" a.scripts,"
|
||||||
" a.binaries,"
|
" name=AutoLibrary,"
|
||||||
" a.datas,"
|
|
||||||
" [],"
|
|
||||||
" name='$exeName',"
|
|
||||||
" debug=False,"
|
" debug=False,"
|
||||||
" bootloader_ignore_signals=False,"
|
" bootloader_ignore_signals=False,"
|
||||||
" strip=False,"
|
" strip=False,"
|
||||||
@@ -182,10 +179,20 @@ jobs:
|
|||||||
" entitlements_file=None,"
|
" entitlements_file=None,"
|
||||||
" icon=['src\\gui\\resources\\icons\\AutoLibrary_32x32.ico'],"
|
" 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
|
$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 ============"
|
Write-Host "`nGenerated Main.spec ============"
|
||||||
Get-Content "Main.spec" | Write-Host
|
Get-Content "Main.spec" | Write-Host
|
||||||
Write-Host "==================================`n"
|
Write-Host "==================================`n"
|
||||||
@@ -200,17 +207,17 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
$tagName = "${{ steps.get_version.outputs.TAG_NAME }}"
|
$tagName = "${{ steps.get_version.outputs.TAG_NAME }}"
|
||||||
$version = "${{ steps.get_version.outputs.VERSION }}"
|
$version = "${{ steps.get_version.outputs.VERSION }}"
|
||||||
$exeName = "AutoLibrary-$version.exe"
|
$distDir = "dist/AutoLibrary-$version"
|
||||||
$zipName = "AutoLibrary.$tagName-windows-x86_64.zip"
|
$zipName = "AutoLibrary.$tagName-windows-x86_64.zip"
|
||||||
|
|
||||||
echo "ZIP_PATH=$zipName" >> $env:GITHUB_OUTPUT
|
echo "ZIP_PATH=$zipName" >> $env:GITHUB_OUTPUT
|
||||||
|
|
||||||
Write-Host "Looking for executable: dist/$exeName"
|
Write-Host "Looking for distribution directory: $distDir"
|
||||||
if (Test-Path "dist/$exeName") {
|
if (Test-Path $distDir) {
|
||||||
Compress-Archive -Path "dist/$exeName" -DestinationPath $zipName
|
Compress-Archive -Path "$distDir/*" -DestinationPath $zipName
|
||||||
Write-Host "✓ Created release archive: $zipName"
|
Write-Host "✓ Created release archive (directory mode): $zipName"
|
||||||
} else {
|
} else {
|
||||||
Write-Error "✗ Executable not found: dist/$exeName"
|
Write-Error "✗ Distribution directory not found: $distDir"
|
||||||
Write-Host "Files in dist directory:"
|
Write-Host "Files in dist directory:"
|
||||||
Get-ChildItem "dist" | ForEach-Object { Write-Host " - $($_.Name)" }
|
Get-ChildItem "dist" | ForEach-Object { Write-Host " - $($_.Name)" }
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user