Skip to content

Commit 535654a

Browse files
committed
ci: fixed vcpkg binary assets caching in nightly builds workflow, vcpkg won't directly support GHA caching anymore
1 parent a0ca518 commit 535654a

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

.github/workflows/nightly-builds.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,7 @@ jobs:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3838
# Enables the vcpkg dependency graph integration.
3939
VCPKG_FEATURE_FLAGS: dependencygraph
40-
# Let's use GitHub Action cache as storage for the vcpkg Binary Caching feature.
41-
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
4240
steps:
43-
# Set env vars needed for vcpkg to leverage the GitHub Action cache as a storage
44-
# for Binary Caching.
45-
- name: Set env vars needed for vcpkg to leverage the GitHub Action cache
46-
uses: actions/github-script@v6
47-
with:
48-
script: |
49-
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
50-
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
51-
5241
- name: Checkout repository
5342
uses: actions/checkout@v4
5443
with:
@@ -63,9 +52,9 @@ jobs:
6352
with:
6453
arch: ${{ matrix.devenv_arch }}
6554

66-
- name: Dynamically set vcpkg-related environment variables
67-
# We need this because previous step overwrites VCPKG_ROOT envvar on Windows runners
68-
uses: actions/github-script@v6
55+
# We need this because previous step overwrites VCPKG_ROOT envvar on Windows runners
56+
- name: Setup vcpkg-related environment variables
57+
uses: actions/github-script@v7
6958
with:
7059
script: |
7160
core.exportVariable('VCPKG_ROOT', `${process.env.GITHUB_WORKSPACE}/external/vcpkg`.replaceAll('\\', '/'));
@@ -87,8 +76,8 @@ jobs:
8776

8877
# Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching
8978
# when it is being run afterwards by CMake.
90-
- name: Restore vcpkg
91-
uses: actions/cache@v3
79+
- name: Caching of vcpkg assets
80+
uses: actions/cache@v4
9281
with:
9382
# The first path is the location of vcpkg: it contains the vcpkg executable and data files, as long as the
9483
# built package archives (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE env var.
@@ -101,7 +90,7 @@ jobs:
10190
!${{ env.VCPKG_ROOT }}/installed
10291
# The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used.
10392
key: |
104-
${{ hashFiles( '.git/modules/external/vcpkg/HEAD' )}}
93+
vcpkg-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}-${{ runner.os }}
10594
10695
- name: Configure CMake
10796
working-directory: ${{ github.workspace }}/build

0 commit comments

Comments
 (0)