diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a66f37b..1a0956e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -62,6 +62,11 @@ jobs: runs-on: ubuntu-latest + permissions: + # vcpkg caching action + actions: read + contents: read + strategy: matrix: platform: @@ -97,17 +102,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 @@ -154,22 +159,27 @@ jobs: runs-on: windows-2019 + permissions: + # vcpkg caching action + actions: read + contents: read + steps: - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - - 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 @@ -223,22 +233,27 @@ jobs: runs-on: windows-2019 + permissions: + # vcpkg caching action + actions: read + contents: read + steps: - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - - 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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c7c1a2..949490a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -143,6 +143,11 @@ jobs: runs-on: windows-latest + permissions: + # vcpkg caching action + actions: read + contents: read + steps: - uses: actions/checkout@v4 with: