diff --git a/.github/workflows/build-loader.yml b/.github/workflows/build-loader.yml index f1f4cc9..1e15de8 100644 --- a/.github/workflows/build-loader.yml +++ b/.github/workflows/build-loader.yml @@ -22,7 +22,15 @@ jobs: # wins over a job-level env in PowerShell expansions. We export # the right VCPKG_ROOT into $GITHUB_ENV inside the clone step # so every later step sees our copy. - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + # + # We rely on actions/cache for the installed Qt artifacts; the + # vcpkg x-gha backend depends on the v1 GitHub Actions cache API + # which has been deprecated, and a fresh runner image often does + # not have ACTIONS_RESULTS_URL set for non-Node actions yet. + # Setting "files" as the binary source means vcpkg will still + # populate ${VCPKG_ROOT}/archives, which actions/cache then + # snapshots along with installed/. + VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}\\vcpkg-archives,readwrite" steps: - name: Checkout @@ -49,17 +57,6 @@ jobs: with: arch: x64 - # Expose ACTIONS_CACHE_URL / ACTIONS_RUNTIME_TOKEN to subsequent - # steps so vcpkg's x-gha cache backend works. These are set by - # the runner but only exposed to actions via the toolkit; we - # forward them manually for the shell-based vcpkg calls below. - - name: Export GitHub Actions cache tokens - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Clone & bootstrap vcpkg shell: pwsh run: | @@ -74,6 +71,22 @@ jobs: "VCPKG_ROOT=$vcpkg" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append Write-Host "Exported VCPKG_ROOT=$vcpkg to GITHUB_ENV" + # Cache the resolved Qt install + the file-backed binary archive. + # Key is keyed on vcpkg.json so any dependency change invalidates; + # restore-keys lets a vcpkg.json bump still warm-start from the + # previous build's archives. installed/ alone makes CMake's manifest + # mode skip rebuilding qtbase; archives/ also fills back transitive + # deps if a partial rebuild is needed. + - name: Cache vcpkg installed + archives + uses: actions/cache@v4 + with: + path: | + vcpkg\installed + vcpkg-archives + key: vcpkg-qt-${{ runner.os }}-${{ hashFiles('native/vcpkg.json') }} + restore-keys: | + vcpkg-qt-${{ runner.os }}- + - name: Install UPX shell: pwsh run: choco install upx -y --no-progress