From f67df92f0e2ff4d71cd12c213786ebc37c633639 Mon Sep 17 00:00:00 2001 From: Laurent Trinques Date: Sun, 10 May 2026 13:04:31 +0200 Subject: [PATCH] Update windows-build.yml Use 7-Zip is already installed on all GitHub Windows computers (C:\Program Files\7-Zip\7z.exe), and it is much faster than Compress-Archive when dealing with 9,931 files. --- .github/workflows/windows-build.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index c0976e89d..6300730d4 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -317,17 +317,23 @@ jobs: if-no-files-found: warn - name: Zip portable (readytouse) - shell: msys2 {0} - run: | - set -euo pipefail - VERSION="${{ steps.qet_version.outputs.base_version }}" - HEAD="${{ steps.qet_version.outputs.head }}" - ZIP_NAME="qelectrotech-${VERSION}+git${HEAD}-x86-win64-readytouse.zip" - cd "$GITHUB_WORKSPACE/nsis_root/files" - zip -r "$GITHUB_WORKSPACE/dist/$ZIP_NAME" . - echo "ZIP created: $ZIP_NAME ($(du -sh "$GITHUB_WORKSPACE/dist/$ZIP_NAME" | cut -f1))" - echo "zip_name=$ZIP_NAME" >> "$GITHUB_OUTPUT" id: zip_portable + shell: pwsh + run: | + $version = "${{ steps.qet_version.outputs.base_version }}" + $head = "${{ steps.qet_version.outputs.head }}" + $zipName = "qelectrotech-${version}+git${head}-x86-win64-readytouse.zip" + $src = "$env:GITHUB_WORKSPACE\nsis_root\files" + $dst = "$env:GITHUB_WORKSPACE\dist\$zipName" + $7z = "C:\Program Files\7-Zip\7z.exe" + + New-Item -ItemType Directory -Force -Path "$env:GITHUB_WORKSPACE\dist" | Out-Null + & $7z a -tzip -mx=5 -mmt=on $dst "$src\*" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + + $sizeMB = [math]::Round((Get-Item $dst).Length / 1MB, 1) + Write-Output "ZIP created: $zipName ($sizeMB MB)" + "zip_name=$zipName" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append - name: Upload portable (files/ without installer) uses: actions/upload-artifact@v4