diff --git a/.github/actions/setup-vcpkg/action.yml b/.github/actions/setup-vcpkg/action.yml new file mode 100644 index 00000000..a1d3aa4e --- /dev/null +++ b/.github/actions/setup-vcpkg/action.yml @@ -0,0 +1,17 @@ +name: Set up vcpkg +description: Check out and bootstrap the vcpkg revision pinned by the build. + +runs: + using: composite + steps: + - name: Set up pinned vcpkg + shell: pwsh + run: | + $baseline = (Get-Content -Raw "$env:GITHUB_WORKSPACE/vcpkg-configuration.json" | ConvertFrom-Json).'default-registry'.baseline + git -C "$env:VCPKG_INSTALLATION_ROOT" fetch --depth=1 origin $baseline + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + git -C "$env:VCPKG_INSTALLATION_ROOT" checkout --detach $baseline + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + & "$env:VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.bat" -disableMetrics + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + "$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append \ No newline at end of file diff --git a/.github/workflows/python-wheels.yml b/.github/workflows/python-wheels.yml index 15266ced..c8370084 100644 --- a/.github/workflows/python-wheels.yml +++ b/.github/workflows/python-wheels.yml @@ -45,6 +45,9 @@ jobs: steps: - uses: actions/checkout@v7 + - name: Set up vcpkg + uses: ./.github/actions/setup-vcpkg + - name: Cache vcpkg installed packages id: cache-vcpkg uses: actions/cache@v6 diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml index 82466cc4..014ff017 100644 --- a/.github/workflows/release-package.yml +++ b/.github/workflows/release-package.yml @@ -322,6 +322,9 @@ jobs: with: submodules: recursive + - name: Set up vcpkg + uses: ./.github/actions/setup-vcpkg + - name: Set up MSVC developer environment uses: microsoft/setup-msbuild@v3 @@ -428,6 +431,9 @@ jobs: with: submodules: recursive + - name: Set up vcpkg + uses: ./.github/actions/setup-vcpkg + - name: Set up MSVC developer environment uses: microsoft/setup-msbuild@v3 diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index aaaa7049..2a2947c0 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -28,6 +28,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v7 + - name: Set up vcpkg + uses: ./.github/actions/setup-vcpkg + - name: Set up MSVC uses: microsoft/setup-msbuild@v3 @@ -76,6 +79,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v7 + - name: Set up vcpkg + uses: ./.github/actions/setup-vcpkg + - name: Set up MSVC uses: microsoft/setup-msbuild@v3 @@ -126,6 +132,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v7 + - name: Set up vcpkg + uses: ./.github/actions/setup-vcpkg + - name: Set up MSVC uses: microsoft/setup-msbuild@v3 @@ -203,6 +212,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v7 + - name: Set up vcpkg + uses: ./.github/actions/setup-vcpkg + - name: Set up MSVC uses: microsoft/setup-msbuild@v3 diff --git a/BUILD.md b/BUILD.md index 5ffeffe1..70ba0f64 100644 --- a/BUILD.md +++ b/BUILD.md @@ -121,10 +121,12 @@ Building on Windows with MSVC is supported with VCPKG and CMake. ### Build with VCPKG in manifest mode -1. Install [VCPKG](https://github.com/microsoft/vcpkg) and required dependencies: +1. Install [VCPKG](https://github.com/microsoft/vcpkg) 2026.10.16 and required dependencies: ```ps1 git clone https://github.com/microsoft/vcpkg.git -cd vcpkg; .\bootstrap-vcpkg.bat +cd vcpkg +git checkout 9eec002df1cd109f8f104cd966a763daf9751489 +.\bootstrap-vcpkg.bat ``` 2. Use CMake preset for vcpkg: diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index f30ff34f..1165280e 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -1,7 +1,7 @@ { "default-registry": { "kind": "git", - "baseline": "319504a5326aa870edde46438c5455fa76305a56", + "baseline": "9eec002df1cd109f8f104cd966a763daf9751489", "repository": "https://github.com/microsoft/vcpkg" }, "overlay-ports": [