Skip to content

Commit 9546bc7

Browse files
committed
Codechange: [Actions] manually install vcpkg in all workflows
1 parent ce5e6ad commit 9546bc7

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

.github/workflows/release.yml

+13-16
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,24 @@ jobs:
7676
run: |
7777
tar --xz -xf *-source.tar.xz --strip-components=1
7878
79-
- name: Prepare cache key
80-
id: key
81-
shell: powershell
82-
run: |
83-
# Work around caching failure with GNU tar
84-
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
79+
- name: Setup vcpkg caching
80+
uses: actions/github-script@v7
81+
with:
82+
script: |
83+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
84+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
85+
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
8586
86-
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
87+
- name: Install vcpkg
88+
run: |
89+
git clone https://github.com/microsoft/vcpkg
90+
.\vcpkg\bootstrap-vcpkg.bat -disableMetrics
8791
88-
- name: Enable vcpkg cache
89-
uses: actions/cache@v4
90-
with:
91-
path: vcpkg/installed
92-
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
93-
restore-keys: |
94-
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
9592
9693
- name: Prepare vcpkg
9794
shell: bash
9895
run: |
99-
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
96+
./vcpkg/vcpkg install --triplet=${{ matrix.arch }}-windows-static \
10097
boost-bimap \
10198
boost-date-time \
10299
boost-foreach \
@@ -120,7 +117,7 @@ jobs:
120117
cmake .. \
121118
-GNinja \
122119
-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-windows-static \
123-
-DCMAKE_TOOLCHAIN_FILE="c:\vcpkg\scripts\buildsystems\vcpkg.cmake" \
120+
-DCMAKE_TOOLCHAIN_FILE="${GITHUB_WORKSPACE}\vcpkg\scripts\buildsystems\vcpkg.cmake" \
124121
-DCMAKE_BUILD_TYPE=Release \
125122
# EOF
126123
echo "::endgroup::"

0 commit comments

Comments
 (0)