From 2e261605cf74141c1fcf55cf6838cc1b620fee63 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 | 34 ++++++++++++++++++++++++++++++---- CMakePresets.json | 15 +++++++++------ vcpkg.json | 6 ++++++ 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 435168b..b3a4605 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,37 @@ 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 + - uses: lukka/run-vcpkg@v11 + + - 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..09a9343 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,5 +1,11 @@ { "dependencies": ["mo2-cmake"], + "features": { + "standalone": { + "description": "Build Standalone.", + "dependencies": ["mo2-uibase"] + } + }, "vcpkg-configuration": { "default-registry": { "kind": "git",