Skip to content

Commit 9035166

Browse files
authored
build(vcpkg): Add lockfile and binary cache (#1862)
1 parent 3934164 commit 9035166

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

.github/workflows/build-toolchain.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,22 @@ jobs:
3131
name: ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }}
3232
runs-on: windows-2022
3333
timeout-minutes: 20
34+
env:
35+
VCPKG_FILE_CACHE: ${{ github.workspace }}\vcpkg-bincache
36+
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}\vcpkg-bincache,readwrite
37+
VCPKG_FEATURE_FLAGS: manifests,versions,binarycaching
3438
steps:
3539
- name: Checkout Code
3640
uses: actions/checkout@v4
3741

42+
- name: Cache vcpkg binary artifacts
43+
uses: actions/cache@v4
44+
with:
45+
path: ${{ github.workspace }}\vcpkg-bincache
46+
key: vcpkg-bincache-${{ runner.os }}-${{ hashFiles('vcpkg.json','vcpkg-lock.json') }}
47+
restore-keys: |
48+
vcpkg-bincache-${{ runner.os }}-
49+
3850
- name: Cache VC6 Installation
3951
if: startsWith(inputs.preset, 'vc6')
4052
id: cache-vc6

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ We provide support for building the project using Visual Studio 6 (VS6) and Visu
6565
instructions, check the [Wiki](https://github.com/TheSuperHackers/GeneralsGameCode/wiki/build_guides), which also
6666
includes guides for building with Docker, CLion, and links to forks supporting additional versions.
6767

68+
### Dependency management
69+
70+
The repository uses a vcpkg manifest (`vcpkg.json`) paired with a lockfile (`vcpkg-lock.json`). When you add or upgrade
71+
dependencies, run `vcpkg install --x-manifest-root . --triplet <triplet>` with `VCPKG_FEATURE_FLAGS=versions` so the
72+
lockfile picks up the new versions and include the updated lockfile in your change. GitHub Actions consumes these ports
73+
through `VCPKG_BINARY_SOURCES=clear;files,<workspace>/vcpkg-bincache,readwrite` (paired with an `actions/cache` entry for
74+
that folder), so the first CI build warms the cache and subsequent builds pull prebuilt binaries instead of
75+
re-compiling everything.
76+
6877
## Contributing
6978

7079
We welcome contributions to the project! If you’re interested in contributing, you need to have knowledge of C++. Join

vcpkg-lock.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"version": 1,
3+
"dependencies": [
4+
{
5+
"name": "ffmpeg",
6+
"version-string": "7.1.1",
7+
"port-version": 1,
8+
"git-tree": "6ff75f1f596ada519241989f44077cda442480b2"
9+
},
10+
{
11+
"name": "pkgconf",
12+
"version-string": "2.3.0",
13+
"port-version": 0,
14+
"git-tree": "ae3886d8a627ec99dd18890389b6d5d331e29799"
15+
},
16+
{
17+
"name": "vcpkg-cmake",
18+
"version-string": "2024-04-23",
19+
"port-version": 0,
20+
"git-tree": "e74aa1e8f93278a8e71372f1fa08c3df420eb840"
21+
},
22+
{
23+
"name": "vcpkg-cmake-get-vars",
24+
"version-string": "2024-09-22",
25+
"port-version": 0,
26+
"git-tree": "f23148add155147f3d95ae622d3b0031beb25acf"
27+
},
28+
{
29+
"name": "vcpkg-pkgconfig-get-modules",
30+
"version-string": "2024-04-03",
31+
"port-version": 0,
32+
"git-tree": "6845369c8cb7d3c318e8e3ae92fd2b7570a756ca"
33+
},
34+
{
35+
"name": "vcpkg-tool-meson",
36+
"version-string": "1.6.1",
37+
"port-version": 0,
38+
"git-tree": "dc948c67d7f1359319f801078422e996b0a89fd0"
39+
},
40+
{
41+
"name": "zlib",
42+
"version-string": "1.3.1",
43+
"port-version": 0,
44+
"git-tree": "3f05e04b9aededb96786a911a16193cdb711f0c9"
45+
}
46+
]
47+
}
48+

0 commit comments

Comments
 (0)