ci(macos): use vcpkg (#3977)

This commit is contained in:
timoreo
2025-07-30 06:54:08 +02:00
committed by GitHub
21 changed files with 957 additions and 2 deletions

View File

@@ -42,6 +42,8 @@ runs:
- name: Setup macOS dependencies
if: ${{ runner.os == 'macOS' }}
uses: ./.github/actions/setup-dependencies/macos
with:
build-type: ${{ inputs.build-type }}
- name: Setup Windows dependencies
if: ${{ runner.os == 'Windows' }}

View File

@@ -1,5 +1,11 @@
name: Setup macOS dependencies
inputs:
build-type:
description: Type for the build
required: true
default: Debug
runs:
using: composite
@@ -14,3 +20,29 @@ runs:
shell: bash
run: |
echo "JAVA_HOME=$(/usr/libexec/java_home -v 17)" >> "$GITHUB_ENV"
- name: Setup vcpkg cache
if: ${{ inputs.build-type == 'Debug' }}
shell: bash
env:
USERNAME: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ github.token }}
FEED_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
run: |
mono `vcpkg fetch nuget | tail -n 1` \
sources add \
-Source "$FEED_URL" \
-StorePasswordInClearText \
-Name GitHubPackages \
-UserName "$USERNAME" \
-Password "$GITHUB_TOKEN"
mono `vcpkg fetch nuget | tail -n 1` \
setapikey "$GITHUB_TOKEN" \
-Source "$FEED_URL"
echo "VCPKG_BINARY_SOURCES=clear;nuget,$FEED_URL,readwrite" >> "$GITHUB_ENV"
- name: Setup vcpkg environment
if: ${{ inputs.build-type == 'Debug' }}
shell: bash
run: |
echo "CMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" >> "$GITHUB_ENV"

View File

@@ -30,6 +30,7 @@ runs:
shell: pwsh
env:
USERNAME: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ github.token }}
FEED_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
run: |
.$(vcpkg fetch nuget) `
@@ -42,7 +43,7 @@ runs:
.$(vcpkg fetch nuget) `
setapikey "$env:GITHUB_TOKEN" `
-Source "$env:FEED_URL"
Write-Output "VCPKG_BINARY_SOURCES=clear;nuget,$env:FEED_URL,readwrite" >> "$GITHUB_ENV"
"VCPKG_BINARY_SOURCES=clear;nuget,$env:FEED_URL,readwrite" | Out-File -Append $env:GITHUB_ENV
- name: Setup vcpkg environment (MSVC)
if: ${{ inputs.msystem == '' }}