Repository navigation
ci(win): mirror GisInternals SDK on GitHub releases, cache it separately - #255
MaxRev-Dev wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Cached SDK archives bypass checksum verification, and the mirror workflow permits modifying regular project releases.
2 open issues
What changed in this PR
This PR reduces Windows CI’s dependence on GisInternals availability by adding a GitHub release mirror and a separate SDK archive cache.
Changes:
- Adds mirror-first downloads with fallback, retries, timeouts, and optional pinned checksum verification.
- Caches the pristine SDK zip independently of build outputs.
- Adds a manual mirror-publishing workflow and refresh documentation.
| File | Description |
|---|---|
win/README.md |
Documents mirror refreshes and checksum pinning. |
win/partials.psm1 |
Adds mirror-first downloads and checksum verification. |
.github/workflows/windows.yml |
Separates SDK zip caching from build-output caching. |
.github/workflows/mirror-gisinternals-sdk.yml |
Adds manual SDK download and release-asset publishing. |
Review effort: Balanced
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| set -euo pipefail | ||
| TAG="${{ inputs.mirror-tag }}" |
There was a problem hiding this comment.
Removed the mirror-tag input and hardcoded the release tag to deps-gisinternals-sdk so the workflow can only ever target its own mirror release, in 2ae2cc9.
| Test-SdkZipChecksum -ZipPath "$env:DOWNLOADS_DIR\$env:SDK_ZIP" | ||
| Write-BuildStep "GDAL SDK was downloaded" | ||
| } |
There was a problem hiding this comment.
Moved the checksum verification outside the download branch so it runs on every use of the zip (cached, downloaded, or left over), deleting it on mismatch so the next run re-downloads, in 2ae2cc9.
The PowerShell Gallery v2 API returned intermittent errors on 2026-10-27,
which made PowerShellGet v2 skip the default PSGallery registration and
reject package downloads ("Source Location ... is not valid"). The build
only used Pscx (Import-VisualStudioVars, Expand-PscxArchive) and VSSetup
behind it; WebKitDev and Choco were never reached.
Locate Visual Studio with vswhere.exe and import the vcvarsall.bat
environment directly, and unpack the 7za console build with the
standalone 7zr.exe. No gallery modules, NuGet package provider or
PSGallery registration are needed any more, which supersedes the
Register-PSRepository workaround.

Change
Windows builds download the GisInternals SDK (
release-1930-x64-dev.zip) from download.gisinternals.com. When that host is unreachable, every Windows build with a cold build cache fails, and the SDK was cached only inside thebuilds-cache, whose key changes with any build-script edit.win/partials.psm1: download the SDK from a GitHub release mirror in this repo (deps-gisinternals-sdk) first, then fall back to GisInternals. Both URLs can be overridden viaSDK_MIRROR_URL/SDK_URL. Downloads use a timeout and retries. The zip is verified against a pinned SHA256 once the mirror is populated (until then the check warns and is skipped)..github/workflows/windows.yml: cache the pristine SDK zip separately, keyed only on the SDK name, and drop the extracted SDK from thebuilds-cache (it is re-extracted from the zip; the extracted copy has build-path rewrites applied)..github/workflows/mirror-gisinternals-sdk.yml(new, manual): downloads the zip, prints its SHA256 and uploads it to thedeps-gisinternals-sdkprerelease. It does not touch regular releases.win/README.md: documents the mirror and how to refresh it.win/functions.psm1,win/partials.psm1: the Windows bootstrap no longer installs PowerShell Gallery modules (VSSetup, Pscx, WebKitDev, Choco), so intermittent PSGallery errors (No repository with the name 'PSGallery' was found,Source Location ... is not valid) cannot break the build. Visual Studio is located withvswhere.exeand thevcvarsall.batenvironment is imported directly (replaces PscxImport-VisualStudioVars); the 7za console build is unpacked with the standalone7zr.exe(replacesExpand-PscxArchive).Verification
functions.psm1,partials.psm1,install.ps1andtest.ps1parse cleanly (PowerShell parser); both workflow files load as valid YAML; actionlint reports no new findings.Get-VisualStudioVarsexercised in pwsh with stand-invswhere.exe/cmd.exe: imports the variables printed aftervcvarsall.batand fails with a clear error whenvswhere.exeis missing orvcvarsall.batexits non-zero.