GHA CI: ditch unusable build step

lukka/run-vcpkg v11.3 has deliberately changed to avoid writing outside of `GITHUB_WORKSPACE`
directory and this conflict with our usage. So ditch it and invoke vcpkg directly.
https://github.com/lukka/run-vcpkg/releases/tag/v11.3

PR #20202.
This commit is contained in:
Chocobo1 2023-12-31 14:03:42 +08:00 committed by GitHub
parent 8dcc734df5
commit be5bf9a138
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,7 +22,7 @@ jobs:
env: env:
boost_path: "${{ github.workspace }}/../boost" boost_path: "${{ github.workspace }}/../boost"
libtorrent_path: "${{ github.workspace }}/../libtorrent" libtorrent_path: "${{ github.workspace }}/../libtorrent"
vpkg_triplet_path: "${{ github.workspace }}/../triplets_overlay" vcpkg_path: "c:/vcpkg"
steps: steps:
- name: Checkout repository - name: Checkout repository
@ -40,13 +40,13 @@ jobs:
where.exe ninja where.exe ninja
ninja --version ninja --version
# use the preinstalled vcpkg from image # https://learn.microsoft.com/en-us/vcpkg/users/binarycaching#gha
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#package-management - name: Set variables for vcpkg
- name: Setup vcpkg uses: actions/github-script@v7
uses: lukka/run-vcpkg@v11
with: with:
vcpkgDirectory: C:/vcpkg script: |
doNotUpdateVcpkg: true # the preinstalled vcpkg is updated regularly core.exportVariable('ACTIONS_CACHE_URL', (process.env.ACTIONS_CACHE_URL || ''));
core.exportVariable('ACTIONS_RUNTIME_TOKEN', (process.env.ACTIONS_RUNTIME_TOKEN || ''));
- name: Install dependencies with vcpkg - name: Install dependencies with vcpkg
run: | run: |
@ -54,9 +54,9 @@ jobs:
New-Item ` New-Item `
-Force ` -Force `
-ItemType File ` -ItemType File `
-Path "${{ env.vpkg_triplet_path }}/x64-windows-static-md-release.cmake" -Path "${{ env.vcpkg_path }}/triplets_overlay/x64-windows-static-md-release.cmake"
Add-Content ` Add-Content `
-Path "${{ env.vpkg_triplet_path }}/x64-windows-static-md-release.cmake" ` -Path "${{ env.vcpkg_path }}/triplets_overlay/x64-windows-static-md-release.cmake" `
-Value @("set(VCPKG_TARGET_ARCHITECTURE x64)", -Value @("set(VCPKG_TARGET_ARCHITECTURE x64)",
"set(VCPKG_LIBRARY_LINKAGE static)", "set(VCPKG_LIBRARY_LINKAGE static)",
"set(VCPKG_CRT_LINKAGE dynamic)", "set(VCPKG_CRT_LINKAGE dynamic)",
@ -68,12 +68,13 @@ jobs:
$packages = ` $packages = `
"openssl:x64-windows-static-md-release", "openssl:x64-windows-static-md-release",
"zlib:x64-windows-static-md-release" "zlib:x64-windows-static-md-release"
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe upgrade ` ${{ env.vcpkg_path }}/vcpkg.exe upgrade `
--no-dry-run ` --no-dry-run `
--overlay-triplets="${{ env.vpkg_triplet_path }}" --overlay-triplets="${{ env.vcpkg_path }}/triplets_overlay"
${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe install ` ${{ env.vcpkg_path }}/vcpkg.exe install `
--binarysource="clear;x-gha,readwrite" `
--clean-after-build ` --clean-after-build `
--overlay-triplets="${{ env.vpkg_triplet_path }}" ` --overlay-triplets="${{ env.vcpkg_path }}/triplets_overlay" `
$packages $packages
- name: Install boost - name: Install boost
@ -109,7 +110,7 @@ jobs:
-DCMAKE_BUILD_TYPE=RelWithDebInfo ` -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON ` -DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
-DCMAKE_INSTALL_PREFIX="${{ env.libtorrent_path }}/install" ` -DCMAKE_INSTALL_PREFIX="${{ env.libtorrent_path }}/install" `
-DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" ` -DCMAKE_TOOLCHAIN_FILE="${{ env.vcpkg_path }}/scripts/buildsystems/vcpkg.cmake" `
-DBOOST_ROOT="${{ env.boost_path }}" ` -DBOOST_ROOT="${{ env.boost_path }}" `
-DBUILD_SHARED_LIBS=OFF ` -DBUILD_SHARED_LIBS=OFF `
-Ddeprecated-functions=OFF ` -Ddeprecated-functions=OFF `
@ -126,7 +127,7 @@ jobs:
-G "Ninja" ` -G "Ninja" `
-DCMAKE_BUILD_TYPE=RelWithDebInfo ` -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON ` -DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
-DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" ` -DCMAKE_TOOLCHAIN_FILE="${{ env.vcpkg_path }}/scripts/buildsystems/vcpkg.cmake" `
-DBOOST_ROOT="${{ env.boost_path }}" ` -DBOOST_ROOT="${{ env.boost_path }}" `
-DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/install/lib/cmake/LibtorrentRasterbar" ` -DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/install/lib/cmake/LibtorrentRasterbar" `
-DMSVC_RUNTIME_DYNAMIC=ON ` -DMSVC_RUNTIME_DYNAMIC=ON `