Skip to content

Commit

Permalink
ci-artifacts: provide zip and SFX variants of the minimal SDK
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dscho committed Sep 15, 2024
1 parent 49ecbeb commit fdb0cea
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion .github/workflows/ci-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit fdb0cea

Please sign in to comment.