From 44a65133550d83f677c7a4c97aad421d3771a2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guilloux?= Date: Wed, 8 May 2024 23:01:47 +0200 Subject: [PATCH] Codechange: [Actions] manually install vcpkg in all workflows (#38) --- .github/workflows/release.yml | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8d5837..b9e8a26 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,27 +76,24 @@ jobs: run: | tar --xz -xf *-source.tar.xz --strip-components=1 - - name: Prepare cache key - id: key - shell: powershell - run: | - # Work around caching failure with GNU tar - New-Item -Type Junction -Path vcpkg -Target c:\vcpkg + - name: Setup vcpkg caching + 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 || ''); + core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite') - Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT + - name: Install vcpkg + run: | + git clone https://github.com/microsoft/vcpkg + .\vcpkg\bootstrap-vcpkg.bat -disableMetrics - - name: Enable vcpkg cache - uses: actions/cache@v4 - with: - path: vcpkg/installed - key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified - restore-keys: | - ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }} - name: Prepare vcpkg shell: bash run: | - vcpkg install --triplet=${{ matrix.arch }}-windows-static \ + ./vcpkg/vcpkg install --triplet=${{ matrix.arch }}-windows-static \ boost-bimap \ boost-date-time \ boost-foreach \ @@ -120,7 +117,7 @@ jobs: cmake .. \ -GNinja \ -DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \ - -DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \ + -DCMAKE_TOOLCHAIN_FILE="${GITHUB_WORKSPACE}\vcpkg\scripts\buildsystems\vcpkg.cmake" \ -DCMAKE_BUILD_TYPE=Release \ # EOF echo "::endgroup::"