2023-07-10 10:23:47 +02:00
|
|
|
name: Build with mob
|
|
|
|
|
description: Build ModOrganizer 2 plugins and executables using mob
|
|
|
|
|
|
|
|
|
|
inputs:
|
2024-06-02 14:02:15 +02:00
|
|
|
mo2-owner:
|
|
|
|
|
description: Owner to use to build.
|
|
|
|
|
required: false
|
2024-06-08 19:28:00 +02:00
|
|
|
default: ${{ github.event.pull_request.head.repo.owner.login || github.repository_owner }}
|
2023-07-10 10:23:47 +02:00
|
|
|
mo2-branch:
|
|
|
|
|
description: Branch to build.
|
|
|
|
|
required: false
|
|
|
|
|
default: ${{ github.head_ref || github.ref_name }}
|
|
|
|
|
mo2-dependencies:
|
|
|
|
|
description: List of MO2 dependencies to build.
|
|
|
|
|
required: false
|
|
|
|
|
default: ""
|
2025-05-28 13:53:53 +02:00
|
|
|
mo2-skip-checkout:
|
|
|
|
|
description: Whether to skip checkout of the repository.
|
|
|
|
|
required: false
|
|
|
|
|
default: "false"
|
2025-05-28 13:37:16 +02:00
|
|
|
mo2-skip-configure:
|
|
|
|
|
description: Whether to skip configure of the repository.
|
2023-07-10 10:23:47 +02:00
|
|
|
required: false
|
2025-05-28 13:37:16 +02:00
|
|
|
default: "false"
|
|
|
|
|
mo2-skip-build:
|
|
|
|
|
description: Whether to skip build of the repository (after configure).
|
|
|
|
|
required: false
|
|
|
|
|
default: "false"
|
2023-07-10 10:23:47 +02:00
|
|
|
qt-install:
|
|
|
|
|
description: Whether to install Qt or not.
|
|
|
|
|
required: false
|
|
|
|
|
default: "true"
|
|
|
|
|
qt-modules:
|
|
|
|
|
description: List of Qt modules to install.
|
|
|
|
|
required: false
|
|
|
|
|
default: ""
|
|
|
|
|
|
2023-07-10 19:55:09 +02:00
|
|
|
outputs:
|
2025-05-28 13:37:16 +02:00
|
|
|
cmake-prefix-path:
|
|
|
|
|
description: Value of the CMAKE_PREFIX_PATH variable used when configuring.
|
|
|
|
|
value: ${{ steps.set-cmake-paths.outputs.cmake-prefix-path }}
|
|
|
|
|
cmake-install-path:
|
|
|
|
|
description: Value of the CMAKE_INSTALL_PREFIX variable used when configuring.
|
|
|
|
|
value: ${{ steps.set-cmake-paths.outputs.cmake-install-path }}
|
2023-07-10 19:55:09 +02:00
|
|
|
working-directory:
|
|
|
|
|
description: Working directory containing the vsbuild folder.
|
2025-05-28 13:37:16 +02:00
|
|
|
value: ./build/${{ github.event.repository.name }}
|
2023-07-10 19:55:09 +02:00
|
|
|
|
2023-07-10 10:23:47 +02:00
|
|
|
runs:
|
|
|
|
|
using: "composite"
|
|
|
|
|
steps:
|
2025-05-28 13:37:16 +02:00
|
|
|
# Qt version
|
2023-09-06 18:13:51 +02:00
|
|
|
- name: Determine mob branch
|
|
|
|
|
id: determine-mob-branch
|
2023-09-18 10:39:42 +02:00
|
|
|
shell: bash
|
2023-09-06 18:13:51 +02:00
|
|
|
run: |
|
|
|
|
|
branch=master
|
2023-09-18 10:39:42 +02:00
|
|
|
if git ls-remote --exit-code https://github.com/ModOrganizer2/mob.git ${{ inputs.mo2-branch }} > /dev/null 2>&1; then
|
2023-09-06 18:13:51 +02:00
|
|
|
branch=${{ inputs.mo2-branch }}
|
|
|
|
|
fi
|
|
|
|
|
echo "branch=${branch}" >> "$GITHUB_OUTPUT"
|
2025-05-28 13:37:16 +02:00
|
|
|
- name: Checkout mob.ini
|
2023-07-10 10:23:47 +02:00
|
|
|
shell: pwsh
|
2025-05-28 13:37:16 +02:00
|
|
|
run: |
|
|
|
|
|
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/ModOrganizer2/mob/refs/heads/${{ steps.determine-mob-branch.outputs.branch }}/mob.ini" -OutFile ${{ github.workspace }}/mob.ini
|
2023-07-10 10:23:47 +02:00
|
|
|
|
|
|
|
|
# Qt
|
|
|
|
|
- name: Get Qt version
|
|
|
|
|
id: find-qt-version
|
|
|
|
|
shell: pwsh
|
|
|
|
|
run: |
|
|
|
|
|
$version = "${{ inputs.qt-version }}"
|
|
|
|
|
if (!$version) {
|
2025-05-28 13:37:16 +02:00
|
|
|
$version = (Get-Content "${{ github.workspace }}/mob.ini" | Select-String -Raw "^qt\s+=").Split("= ")[1]
|
2023-07-10 10:23:47 +02:00
|
|
|
}
|
|
|
|
|
Write-Output "Found Qt Version: $version"
|
|
|
|
|
Write-Output "QT_VERSION=$version" >> "$env:GITHUB_OUTPUT"
|
|
|
|
|
- if: inputs.qt-install == 'true'
|
|
|
|
|
name: Install Qt
|
2025-05-21 18:20:19 +02:00
|
|
|
uses: jurplel/install-qt-action@v4
|
2023-07-10 10:23:47 +02:00
|
|
|
with:
|
|
|
|
|
version: ${{ steps.find-qt-version.outputs.QT_VERSION }}
|
|
|
|
|
modules: ${{ inputs.qt-modules }}
|
2025-05-21 18:20:19 +02:00
|
|
|
arch: win64_msvc2022_64
|
2026-04-21 09:22:37 +02:00
|
|
|
aqtsource: git+https://github.com/miurahr/aqtinstall.git
|
2023-07-10 10:23:47 +02:00
|
|
|
cache: true
|
|
|
|
|
- name: Add Qt bins to PATH
|
|
|
|
|
shell: pwsh
|
2025-05-28 13:37:16 +02:00
|
|
|
run: echo "${QT_ROOT_DIR}/msvc2022_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
2023-07-10 10:23:47 +02:00
|
|
|
|
2025-05-28 13:37:16 +02:00
|
|
|
# set VCPKG Root
|
|
|
|
|
- name: "Set environmental variables"
|
|
|
|
|
shell: bash
|
2023-09-18 09:13:19 +02:00
|
|
|
run: |
|
2025-05-28 13:37:16 +02:00
|
|
|
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
|
|
# set CMake install and prefix
|
|
|
|
|
- name: "Set CMAKE_PREFIX_PATH and CMAKE_INSTALL_PATH"
|
|
|
|
|
id: set-cmake-paths
|
|
|
|
|
shell: bash
|
|
|
|
|
run: |
|
|
|
|
|
echo "cmake-prefix-path=${QT_ROOT_DIR}\msvc2022_64;${{ github.workspace }}\build\cmake_common;${{ github.workspace }}\install\lib\cmake" >> $GITHUB_OUTPUT
|
|
|
|
|
echo "cmake-install-path=${{ github.workspace }}\install" >> $GITHUB_OUTPUT
|
2023-07-10 10:23:47 +02:00
|
|
|
|
|
|
|
|
# MO2 dependencies
|
2025-05-23 09:55:57 +02:00
|
|
|
- name: Checkout MO2 modules
|
|
|
|
|
shell: pwsh
|
2025-05-28 13:37:16 +02:00
|
|
|
run: '& ${env:GITHUB_ACTION_PATH}/checkout-mo2-dependencies.ps1 -Owner ${{ inputs.mo2-owner }} -Branch ${{ inputs.mo2-branch }} "cmake_common ${{ inputs.mo2-dependencies }}"'
|
2025-05-23 09:55:57 +02:00
|
|
|
|
2025-05-28 13:37:16 +02:00
|
|
|
- name: Configure & Build MO2 dependencies
|
2023-07-10 10:23:47 +02:00
|
|
|
shell: pwsh
|
|
|
|
|
run: |
|
2025-05-28 13:37:16 +02:00
|
|
|
Get-ChildItem build -Directory -Exclude ".git", "cmake_common", "${{ github.event.repository.name }}" | ForEach-Object {
|
|
|
|
|
Write-Output "Building $_... "
|
|
|
|
|
Push-Location $_
|
|
|
|
|
if ($_.Name -eq "usvfs") {
|
|
|
|
|
cmake --preset vs2022-windows-x64 `
|
|
|
|
|
"-DCMAKE_PREFIX_PATH=${{ steps.set-cmake-paths.outputs.cmake-prefix-path }}" `
|
|
|
|
|
"-DCMAKE_INSTALL_PREFIX=${{ steps.set-cmake-paths.outputs.cmake-install-path }}" `
|
|
|
|
|
"-DBUILD_TESTING=OFF"
|
|
|
|
|
cmake --build --preset vs2022-windows-x64 --config RelWithDebInfo --target INSTALL --parallel 16
|
|
|
|
|
cmake --preset vs2022-windows-x86 `
|
|
|
|
|
"-DCMAKE_PREFIX_PATH=${{ steps.set-cmake-paths.outputs.cmake-prefix-path }}" `
|
|
|
|
|
"-DCMAKE_INSTALL_PREFIX=${{ steps.set-cmake-paths.outputs.cmake-install-path }}" `
|
|
|
|
|
"-DBUILD_TESTING=OFF"
|
|
|
|
|
cmake --build --preset vs2022-windows-x86 --config RelWithDebInfo --target INSTALL --parallel 16
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
cmake --preset vs2022-windows `
|
|
|
|
|
"-DCMAKE_PREFIX_PATH=${{ steps.set-cmake-paths.outputs.cmake-prefix-path }}" `
|
|
|
|
|
"-DCMAKE_INSTALL_PREFIX=${{ steps.set-cmake-paths.outputs.cmake-install-path }}" `
|
|
|
|
|
"-DBUILD_TESTING=OFF"
|
|
|
|
|
cmake --build --preset vs2022-windows --config RelWithDebInfo --target INSTALL --parallel 16
|
|
|
|
|
}
|
|
|
|
|
Pop-Location
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
2025-05-28 13:53:53 +02:00
|
|
|
if: inputs.mo2-skip-checkout != 'true'
|
2025-05-28 13:37:16 +02:00
|
|
|
with:
|
|
|
|
|
path: ./build/${{ github.event.repository.name }}
|
|
|
|
|
|
|
|
|
|
- name: Configure Repository
|
2025-05-28 13:53:53 +02:00
|
|
|
if: inputs.mo2-skip-checkout != 'true' && inputs.mo2-skip-configure != 'true'
|
2025-05-28 13:37:16 +02:00
|
|
|
shell: pwsh
|
|
|
|
|
run: |
|
|
|
|
|
Push-Location build/${{ github.event.repository.name }}
|
|
|
|
|
cmake --preset vs2022-windows `
|
|
|
|
|
"-DCMAKE_PREFIX_PATH=${{ steps.set-cmake-paths.outputs.cmake-prefix-path }}" `
|
|
|
|
|
"-DCMAKE_INSTALL_PREFIX=${{ steps.set-cmake-paths.outputs.cmake-install-path }}" `
|
|
|
|
|
"-DBUILD_TESTING=ON"
|
|
|
|
|
Pop-Location
|
|
|
|
|
|
|
|
|
|
# build repository
|
|
|
|
|
- name: Build Repository
|
2025-05-28 13:53:53 +02:00
|
|
|
if: inputs.mo2-skip-checkout != 'true' && inputs.mo2-skip-configure != 'true' && inputs.mo2-skip-build != 'true'
|
2025-05-28 13:37:16 +02:00
|
|
|
shell: pwsh
|
|
|
|
|
run: |
|
|
|
|
|
cmake --build --preset vs2022-windows --config RelWithDebInfo --parallel 16
|
|
|
|
|
working-directory: ./build/${{ github.event.repository.name }}
|