Skip to content

Commit

Permalink
Codechange: [Actions] manually install vcpkg in all workflows (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
glx22 committed May 8, 2024
1 parent ce5e6ad commit 44a6513
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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::"
Expand Down

0 comments on commit 44a6513

Please sign in to comment.