diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87f4e16b..6c7c1a2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,11 @@ jobs: runs-on: ubuntu-latest + permissions: + # vcpkg caching action + actions: read + contents: read + strategy: matrix: platform: @@ -74,17 +79,17 @@ jobs: - name: Install Dependencies (host) run: sudo apt update && sudo apt -y install cmake pkg-config nasm - - 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 (target) env: ANDROID_NDK_HOME: ${{steps.setup_ndk.outputs.ndk-path}} - 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 --overlay-triplets=vcpkg_android_triplets --triplet ${{matrix.platform.vcpkg_toolkit}} libsodium opus libvpx libpng libjpeg-turbo freetype # vcpkg scripts root /usr/local/share/vcpkg/scripts @@ -143,16 +148,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 opus:x64-windows-static libvpx:x64-windows-static zstd:x64-windows-static libwebp:x64-windows-static libpng:x64-windows-static libjpeg-turbo:x64-windows-static freetype:x64-windows-static # setup vs env