From 07f4c94397f582ca512205dde4e32b5729ce2584 Mon Sep 17 00:00:00 2001 From: Bobby Battista Date: Sat, 15 Nov 2025 14:34:23 -0500 Subject: [PATCH] chore(vcpkg): add lockfile and binary cache --- .github/workflows/build-toolchain.yml | 12 +++++++ README.md | 9 +++++ vcpkg-lock.json | 48 +++++++++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 vcpkg-lock.json diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index e7f185a078..0ac783ed54 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -31,10 +31,22 @@ jobs: name: ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} runs-on: windows-2022 timeout-minutes: 20 + env: + VCPKG_FILE_CACHE: ${{ github.workspace }}\vcpkg-bincache + VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}\vcpkg-bincache,readwrite + VCPKG_FEATURE_FLAGS: manifests,versions,binarycaching steps: - name: Checkout Code uses: actions/checkout@v4 + - name: Cache vcpkg binary artifacts + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}\vcpkg-bincache + key: vcpkg-bincache-${{ runner.os }}-${{ hashFiles('vcpkg.json','vcpkg-lock.json') }} + restore-keys: | + vcpkg-bincache-${{ runner.os }}- + - name: Cache VC6 Installation if: startsWith(inputs.preset, 'vc6') id: cache-vc6 diff --git a/README.md b/README.md index aa780c6724..27149141ca 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,15 @@ We provide support for building the project using Visual Studio 6 (VS6) and Visu instructions, check the [Wiki](https://github.com/TheSuperHackers/GeneralsGameCode/wiki/build_guides), which also includes guides for building with Docker, CLion, and links to forks supporting additional versions. +### Dependency management + +The repository uses a vcpkg manifest (`vcpkg.json`) paired with a lockfile (`vcpkg-lock.json`). When you add or upgrade +dependencies, run `vcpkg install --x-manifest-root . --triplet ` with `VCPKG_FEATURE_FLAGS=versions` so the +lockfile picks up the new versions and include the updated lockfile in your change. GitHub Actions consumes these ports +through `VCPKG_BINARY_SOURCES=clear;files,/vcpkg-bincache,readwrite` (paired with an `actions/cache` entry for +that folder), so the first CI build warms the cache and subsequent builds pull prebuilt binaries instead of +re-compiling everything. + ## Contributing We welcome contributions to the project! If you’re interested in contributing, you need to have knowledge of C++. Join diff --git a/vcpkg-lock.json b/vcpkg-lock.json new file mode 100644 index 0000000000..422998f037 --- /dev/null +++ b/vcpkg-lock.json @@ -0,0 +1,48 @@ +{ + "version": 1, + "dependencies": [ + { + "name": "ffmpeg", + "version-string": "7.1.1", + "port-version": 1, + "git-tree": "6ff75f1f596ada519241989f44077cda442480b2" + }, + { + "name": "pkgconf", + "version-string": "2.3.0", + "port-version": 0, + "git-tree": "ae3886d8a627ec99dd18890389b6d5d331e29799" + }, + { + "name": "vcpkg-cmake", + "version-string": "2024-04-23", + "port-version": 0, + "git-tree": "e74aa1e8f93278a8e71372f1fa08c3df420eb840" + }, + { + "name": "vcpkg-cmake-get-vars", + "version-string": "2024-09-22", + "port-version": 0, + "git-tree": "f23148add155147f3d95ae622d3b0031beb25acf" + }, + { + "name": "vcpkg-pkgconfig-get-modules", + "version-string": "2024-04-03", + "port-version": 0, + "git-tree": "6845369c8cb7d3c318e8e3ae92fd2b7570a756ca" + }, + { + "name": "vcpkg-tool-meson", + "version-string": "1.6.1", + "port-version": 0, + "git-tree": "dc948c67d7f1359319f801078422e996b0a89fd0" + }, + { + "name": "zlib", + "version-string": "1.3.1", + "port-version": 0, + "git-tree": "3f05e04b9aededb96786a911a16193cdb711f0c9" + } + ] +} +