From 6857e893a121b21af1d2755f2a214f9f7e1a7aa3 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Wed, 6 Aug 2025 17:13:00 +0200 Subject: [PATCH] ci/cd vcpkg caching --- .github/workflows/cd.yml | 12 ++++++------ .github/workflows/ci.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 4c8271d..2b076de 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -67,16 +67,16 @@ jobs: with: submodules: recursive - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@v7 + - name: Restore vcpkg cache + id: vcpkg-cache + uses: TAServers/vcpkg-cache@v3 with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + token: ${{secrets.GITHUB_TOKEN}} - name: Install Dependencies env: - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + VCPKG_FEATURE_FLAGS: "binarycaching" + VCPKG_BINARY_SOURCES: "clear;files,${{steps.vcpkg-cache.outputs.path}},readwrite" run: vcpkg install pkgconf:x64-windows libsodium:x64-windows-static pthreads:x64-windows-static # setup vs env diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2a1391..81cdb7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,16 +140,16 @@ jobs: with: submodules: recursive - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@v7 + - name: Restore vcpkg cache + id: vcpkg-cache + uses: TAServers/vcpkg-cache@v3 with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + token: ${{secrets.GITHUB_TOKEN}} - name: Install Dependencies env: - VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + VCPKG_FEATURE_FLAGS: "binarycaching" + VCPKG_BINARY_SOURCES: "clear;files,${{steps.vcpkg-cache.outputs.path}},readwrite" run: vcpkg install pkgconf:x64-windows libsodium:x64-windows-static pthreads:x64-windows-static # setup vs env