🐛 Fix: signed path extract error (#1407)

This commit is contained in:
PiEgg
2026-04-11 19:42:20 +08:00
committed by GitHub
parent e1b04b838e
commit d3dcd2362b
+29 -3
View File
@@ -201,9 +201,34 @@ jobs:
- name: Replace Unsigned with Signed & Update latest.yml
shell: powershell
run: |
# Move signed artifacts to dist folder, overwriting existing ones
Move-Item -Path "signed-artifact\*.exe" -Destination "dist\" -Force
Write-Host "✅ Signed artifacts moved to dist folder."
Write-Host "[Info] Contents of signed-artifact:"
Get-ChildItem -Path "signed-artifact" -Recurse | Format-Table FullName, Length
# If returned zip files, extract them first
$zips = Get-ChildItem -Path "signed-artifact\*.zip" -ErrorAction SilentlyContinue
if ($zips) {
Write-Host "[Info] Found zip file(s), extracting..."
foreach ($zip in $zips) {
Expand-Archive -Path $zip.FullName -DestinationPath "signed-artifact" -Force
Remove-Item -Path $zip.FullName -Force
Write-Host "[Done] Extracted: $($zip.Name)"
}
Write-Host "[Info] Contents after extraction:"
Get-ChildItem -Path "signed-artifact" -Recurse | Format-Table FullName, Length
}
$exeFiles = Get-ChildItem -Path "signed-artifact\*.exe" -ErrorAction SilentlyContinue
if ($exeFiles) {
foreach ($exe in $exeFiles) {
Move-Item -Path $exe.FullName -Destination "dist\" -Force
Write-Host "[Done] Moved signed artifact: $($exe.Name)"
}
} else {
Write-Host "[Error] No .exe files found in signed-artifact!"
Get-ChildItem -Path "signed-artifact" -Recurse
exit 1
}
# Run the Node.js script to update latest.yml
node scripts/update-win-yaml.js
@@ -297,6 +322,7 @@ jobs:
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: PicGo-*
- name: List artifacts
run: ls -laR artifacts/