From a01af1f30b1efb0a4bc74ac168f26100d6a37137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Fri, 12 Jul 2024 13:44:38 +0200 Subject: [PATCH] Add standalone preset to fix CI. --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++++++++++---- CMakePresets.json | 15 +++++++++------ vcpkg.json | 8 +++++++- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 435168b..d80c5f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build Installer OMOD Plugin +name: Build Installer OMOD Library on: push: @@ -6,11 +6,41 @@ on: pull_request: types: [opened, synchronize, reopened] +env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" + jobs: build: runs-on: windows-2022 steps: - - name: Build Installer OMOD Plugin - uses: ModOrganizer2/build-with-mob-action@master + # https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Install Qt + uses: jurplel/install-qt-action@v3 with: - mo2-dependencies: cmake_common uibase + version: 6.7.0 + modules: + cache: true + + - uses: actions/checkout@v4 + + - name: "Set environmental variables" + shell: bash + run: | + echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV + + - name: Configure Installer OMOD + shell: pwsh + run: | + cmake --preset vs2022-windows-standalone ` + "-DCMAKE_PREFIX_PATH=${env:QT_ROOT_DIR}\msvc2019_64" ` + "-DCMAKE_INSTALL_PREFIX=install" + + - name: Build Installer OMOD + run: cmake --build vsbuild --config RelWithDebInfo --target INSTALL diff --git a/CMakePresets.json b/CMakePresets.json index e25727f..a8c9df4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -36,13 +36,16 @@ "inherits": ["cmake-dev", "vcpkg"], "name": "vs2022-windows", "toolset": "v143" - } - ], - "buildPresets": [ + }, { - "name": "vs2022-windows", - "resolvePackageReferences": "on", - "configurePreset": "vs2022-windows" + "cacheVariables": { + "VCPKG_MANIFEST_FEATURES": { + "type": "STRING", + "value": "standalone" + } + }, + "inherits": "vs2022-windows", + "name": "vs2022-windows-standalone" } ], "version": 4 diff --git a/vcpkg.json b/vcpkg.json index 4c355c2..15e563d 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,10 +1,16 @@ { "dependencies": ["mo2-cmake"], + "features": { + "standalone": { + "description": "Build Standalone.", + "dependencies": ["mo2-uibase"] + } + }, "vcpkg-configuration": { "default-registry": { "kind": "git", "repository": "https://github.com/ModOrganizer2/vcpkg-registry", - "baseline": "c55e3ab33eb170aefb1904ded8809cb88df6bb48" + "baseline": "a7aee8c0085f42b5e42f026cd4a41bad48d490da" } } }