Initial commit.

This commit is contained in:
Mikael CAPELLE
2023-07-10 10:47:14 +02:00
commit 1ff3e9b23a
3 changed files with 147 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2023 ModOrganizer 2 Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
View File
+125
View File
@@ -0,0 +1,125 @@
name: Build with mob
description: Build ModOrganizer 2 plugins and executables using mob
inputs:
mo2-branch:
description: Branch to build.
required: false
default: ${{ github.head_ref || github.ref_name }}
mo2-third-parties:
description: List of third-party dependencies to build (including USVFS).
required: false
default: ""
mo2-dependencies:
description: List of MO2 dependencies to build.
required: false
default: ""
mo2-cmake-command:
description: MO2 CMake command to run.
required: false
default: ".."
qt-install:
description: Whether to install Qt or not.
required: false
default: "true"
# TODO: extract this from mob
qt-version:
description: Override Qt version to install.
required: false
default: ""
qt-modules:
description: List of Qt modules to install.
required: false
default: ""
runs:
using: "composite"
steps:
# mob
- name: Checkout mob
uses: actions/checkout@v3
with:
repository: modorganizer2/mob
ref: master
path: ./mob
- name: Cache mob
id: cache-mob
uses: actions/cache@v3
with:
path: |
./mob/mob.exe
key: ${{ runner.OS }}-mob-cache-${{ hashFiles('mob/.git/refs/heads/master') }}
restore-keys: |
${{ runner.OS }}-mob-cache-
- if: steps.cache-mob.outputs.cache-hit != 'true'
name: Build mob
shell: pwsh
run: .\mob\bootstrap.ps1
- name: Add mob to PATH
shell: pwsh
run: echo "${{ github.workspace }}/mob" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# Qt
- name: Get Qt version
id: find-qt-version
shell: pwsh
run: |
$version = "${{ inputs.qt-version }}"
if (!$version) {
$version = (Get-Content "${{ github.workspace }}\mob\mob.ini" | Select-String -Raw "^qt\s+=").Split("= ")[1]
}
Write-Output "Found Qt Version: $version"
Write-Output "QT_VERSION=$version" >> "$env:GITHUB_OUTPUT"
- if: inputs.qt-install == 'true'
name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{ steps.find-qt-version.outputs.QT_VERSION }}
modules: ${{ inputs.qt-modules }}
cache: true
- name: Add Qt bins to PATH
shell: pwsh
run: echo "${QT_ROOT_DIR }/msvc2019_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# Third-Party dependencies
- name: Cache third-party dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
path: |
./build
!./build/modorganizer_super
key: ${{ runner.OS }}-mo2-dependencies-${{ hashFiles('mob/.git/refs/heads/master') }}
restore-keys: |
${{ runner.OS }}-mo2-dependencies-
- if: steps.cache-dependencies.outputs.cache-hit != 'true'
shell: pwsh
name: Build dependencies with mob
run: mob.exe -l 4 -d . build ${{ inputs.mo2-third-parties }}
- name: Build dependencies log
uses: actions/upload-artifact@v3
with:
name: build-dependencies-log
path: |
mob.log
# MO2 dependencies
- name: Build MO2 modules
shell: pwsh
run: mob -l 4 -d .
-s task/mo_fallback=master -s task/mo_branch=${{ inputs.mo2-branch }}
build
--ignore-uncommitted-changes
--redownload --reextract --reconfigure --rebuild
${{ inputs.mo2-dependencies }}
# Build repository
- uses: actions/checkout@v3
with:
path: ./build/modorganizer_super/${{ github.event.repository.name }}
- name: Build Plugin Python
shell: pwsh
run: |
mob -l 5 cmake -c "${{ inputs.mo2-cmake-command }}" vsbuild
cmake --build vsbuild --config RelWithDebInfo -j4
working-directory: ./build/modorganizer_super/${{ github.event.repository.name }}