Use the official way for binary cache with vcpkg

https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache
This commit is contained in:
Hiroshi SHIBATA 2024-06-21 14:42:22 +09:00
parent ac9e84df3d
commit bf061ce6fe

View File

@ -97,25 +97,18 @@ jobs:
bundler: none
windows-toolchain: none
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
path: C:\vcpkg\downloads
key: ${{ runner.os }}-vcpkg-download-${{ env.OS_VER }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-vcpkg-download-${{ env.OS_VER }}-
${{ runner.os }}-vcpkg-download-
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: C:\vcpkg\installed
key: ${{ runner.os }}-vcpkg-installed-${{ env.OS_VER }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-vcpkg-installed-${{ env.OS_VER }}-
${{ runner.os }}-vcpkg-installed-
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install libraries with vcpkg
run: |
vcpkg --triplet x64-windows install gmp libffi libyaml openssl zlib
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
- name: Install libraries with scoop
run: |