From 7f5afe0ddbf27ba3ccbede084c268a57ae5f1d94 Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Mon, 10 Nov 2025 07:35:08 -0800 Subject: [PATCH] Fixing CI builds for Windows on GitHub Actions --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d199b5..e8f6222 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,7 +89,7 @@ jobs: - name: Fix permissions run: sudo chown -R $(id -u):$(id -g) target - + - name: Build Debian package run: | cargo deb --no-build --target aarch64-unknown-linux-musl \ @@ -151,7 +151,6 @@ jobs: name: kingfisher-darwin-x64.tgz path: dist/kingfisher-darwin-x64.tgz - macos-arm64: name: macOS arm64 runs-on: macos-14 @@ -182,11 +181,18 @@ jobs: name: kingfisher-darwin-arm64.tgz path: dist/kingfisher-darwin-arm64.tgz - # ──────────────── Windows ──────────────── windows: name: Windows x64 runs-on: windows-latest + + # Windows-only env to keep vcpkg consistent and enable caching + env: + VCPKG_ROOT: C:\vcpkg + VCPKG_DOWNLOADS: C:\vcpkg\downloads + VCPKG_FEATURE_FLAGS: binarycaching + VCPKG_BINARY_SOURCES: clear;x-gha,readwrite + steps: - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 @@ -195,8 +201,9 @@ jobs: profile: minimal override: true + # Cache vcpkg artifacts & downloads (so we only fetch PCRE once) - name: Cache vcpkg artifacts - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | C:\vcpkg\buildtrees @@ -209,7 +216,21 @@ jobs: restore-keys: | ${{ runner.os }}-vcpkg- - - uses: Swatinem/rust-cache@v2 + # Ensure downloads dir exists and seed PCRE 8.45 zip from a working mirror + - name: Pre-seed PCRE 8.45 for vcpkg (bypass SourceForge redirect) + shell: pwsh + run: | + New-Item -ItemType Directory -Force -Path "$env:VCPKG_DOWNLOADS" | Out-Null + $dst = Join-Path $env:VCPKG_DOWNLOADS "pcre-8.45.zip" + if (-not (Test-Path $dst)) { + Invoke-WebRequest ` + -Uri "https://versaweb.dl.sourceforge.net/project/pcre/pcre/8.45/pcre-8.45.zip" ` + -OutFile $dst -UseBasicParsing + } + Get-ChildItem $env:VCPKG_DOWNLOADS + + - uses: swatinem/rust-cache@v2 + - name: Build run: .\buildwin.bat shell: cmd @@ -268,6 +289,6 @@ jobs: with: tag: v${{ steps.version.outputs.version }} name: "Kingfisher v${{ steps.version.outputs.version }}" - bodyFile: .latest_changelog.md # ← only the most-recent entry + bodyFile: .latest_changelog.md # ← only the most-recent entry generateReleaseNotes: false - artifacts: target/release/** \ No newline at end of file + artifacts: target/release/**