Skip to content

ci(win): mirror GisInternals SDK on GitHub releases, cache it separately - #255

Open
MaxRev-Dev wants to merge 4 commits into
mainfrom
ci/win-sdk-mirror
Open

MaxRev-Dev wants to merge 4 commits into
mainfrom
ci/win-sdk-mirror

Conversation

@MaxRev-Dev

@MaxRev-Dev MaxRev-Dev commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

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 the builds- 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 via SDK_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 the builds- 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 the deps-gisinternals-sdk prerelease. 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 with vswhere.exe and the vcvarsall.bat environment is imported directly (replaces Pscx Import-VisualStudioVars); the 7za console build is unpacked with the standalone 7zr.exe (replaces Expand-PscxArchive).

Verification

  • functions.psm1, partials.psm1, install.ps1 and test.ps1 parse cleanly (PowerShell parser); both workflow files load as valid YAML; actionlint reports no new findings.
  • Windows CI on this PR exercises the GisInternals fallback path (mirror not populated yet).
  • Get-VisualStudioVars exercised in pwsh with stand-in vswhere.exe / cmd.exe: imports the variables printed after vcvarsall.bat and fails with a clear error when vswhere.exe is missing or vcvarsall.bat exits non-zero.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment on lines +54 to +57
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
TAG="${{ inputs.mirror-tag }}"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread win/partials.psm1 Outdated
Comment on lines 217 to 219
Test-SdkZipChecksum -ZipPath "$env:DOWNLOADS_DIR\$env:SDK_ZIP"
Write-BuildStep "GDAL SDK was downloaded"
}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants