From fdb0cea373893ce7d40bcfcfbeb7fd091a3c4020 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 13 Sep 2024 12:33:38 +0200 Subject: [PATCH] ci-artifacts: provide zip and SFX variants of the minimal SDK Since `.tar.gz` has its preferred habitat safely outside the Windows world, let's also provide a `.zip` version of the artifact, and for good measure even a self-extracting 7-Zip archive (which can be run everywhere, without having to rely on PowerShell or a native `tar.exe`). In my tests, both sizes and extract times vary greatly depending on the used file format. Here are manual measurements as of time of writing: .tar.gz .zip .7z.exe Size 95.7MB 84.2MB 41.6MB Time 4.1s 4.3s 11.1s Note that I used the native Windows `tar.exe` that is available in the `C:\Windows\system32` directory which is a BSD tar and comes preinstalled with Windows build 17063 and later; It is vastly faster both in extracting `.zip` and `.tar.gz` files (sadly, it has no support for `.7z` archives) than the corresponding MSYS utilities `unzip` and `tar` distributed with Git for Windows. In any scenario where all three formats can be extracted (with roughly the same speeds as in my tests), and where Defender does not need to scan the downloaded `.7z.exe` file first (which added up to 8s in my testing), it therefore depends on the available bandwidth when fetching from Azure Blobs (where GitHub release assets seem to be stored nowadays) which one is preferable. At download speeds above 6MB/s, the `.zip` archive is the fastest to download and extract, below that, the self-extracting 7-Zip archive provides the best overall speed. Obviously this should be measured in each particular use case instead of basing any decision on above-mentioned numbers. Signed-off-by: Johannes Schindelin --- .github/workflows/ci-artifacts.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-artifacts.yml b/.github/workflows/ci-artifacts.yml index 99b5129dd5f..328436fd43d 100644 --- a/.github/workflows/ci-artifacts.yml +++ b/.github/workflows/ci-artifacts.yml @@ -59,6 +59,24 @@ jobs: with: name: git-artifacts path: git-artifacts.tar.gz + - name: create zip and 7z SFX variants of the minimal SDK + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + shell: bash + run: | + for path in mingw64/bin/7z.exe mingw64/bin/7z.dll mingw64/lib/7zip/7zCon.sfx + do + git --git-dir=git-sdk-64.git show HEAD:$path >${path##*/} + done && + mkdir minimal-sdk-extra && + (cd minimal-sdk && ../7z.exe a -mmt=on -mx9 ../minimal-sdk-extra/git-sdk-x86_64-minimal.zip * .?*) && + (cd minimal-sdk && ../7z.exe a -t7z -mmt=on -m0=lzma -mqs -mlc=8 -mx=9 -md=256M -mfb=273 -ms=256M -sfx../7zCon.sfx \ + ../minimal-sdk-extra/git-sdk-x86_64-minimal.7z.exe * .?*) + - name: upload minimal-sdk-extra artifacts + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: actions/upload-artifact@v4 + with: + name: minimal-sdk-extra + path: minimal-sdk-extra test-minimal-sdk: runs-on: windows-latest needs: [minimal-sdk-artifact] @@ -168,6 +186,11 @@ jobs: with: name: minimal-sdk path: ${{github.workspace}} + - name: download minimal-sdk artifact + uses: actions/download-artifact@v4 + with: + name: minimal-sdk-extra + path: ${{github.workspace}} - name: publish release asset uses: actions/github-script@v7 with: @@ -198,7 +221,11 @@ jobs: })() const fs = require('fs') - for (const fileName of ['git-sdk-x86_64-minimal.tar.gz']) { + for (const fileName of [ + 'git-sdk-x86_64-minimal.tar.gz', + 'git-sdk-x86_64-minimal.zip', + 'git-sdk-x86_64-minimal.7z.exe', + ]) { console.log(`Uploading ${fileName}`) const uploadReq = { ...req,