This commit is contained in:
Luke Street 2021-03-26 18:21:53 -04:00
parent 193297d481
commit 5b26f65249
3 changed files with 281 additions and 27 deletions

150
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,150 @@
name: Build
on:
push:
branches:
- ci
paths-ignore:
- '*.md'
- 'CMakeSettings.json'
- 'LICENSE'
# pull_request:
jobs:
build-linux-gcc:
name: Build Linux (GCC x86_64)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install cmake ninja-build qt5-default
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=Release
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
# - name: Generate AppImage
# env:
# VERSION: ${{github.run_number}}
# run: ci/build-appimage.sh
#
# - name: Upload artifacts
# uses: actions/upload-artifact@v2
# with:
# name: pwe-${{github.run_number}}-linux-gcc-x86_64
# path: PrimeWorldEditor-*.AppImage
build-macos:
name: Build macOS (AppleClang x86_64)
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
brew install ninja qt@5 graphicsmagick imagemagick
brew link qt@5
yarn global add create-dmg
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
export PATH="/usr/local/opt/qt@5/bin:$PATH" # FIXME remove
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=Release
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
# - name: Import signing certificate
# uses: devbotsxyz/xcode-import-certificate@master
# with:
# certificate-data: ${{ secrets.MACOS_CERTIFICATE_DATA }}
# certificate-passphrase: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
# keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
#
# - name: Deploy & codesign application
# working-directory: build/Binaries
# run: |
# macdeployqt PrimeWorldEditor.app -sign-for-notarization="${{secrets.MACOS_CODESIGN_IDENT}}" -no-strip
# create-dmg PrimeWorldEditor.app --identity="${{secrets.MACOS_CODESIGN_IDENT}}"
# xcrun altool -t osx -f *.dmg --primary-bundle-id com.axiodl.PrimeWorldEditor --notarize-app \
# -u "${{secrets.MACOS_ASC_USERNAME}}" -p "${{secrets.MACOS_ASC_PASSWORD}}" \
# --team-id "${{secrets.MACOS_ASC_TEAM_ID}}"
#
# - name: Upload artifacts
# uses: actions/upload-artifact@v2
# with:
# name: urde-${{github.run_number}}-macos-appleclang-x86_64
# path: build/Binaries/*.dmg
build-windows-msvc:
name: Build Windows (MSVC x86_64)
runs-on: windows-2019
env:
Qt_VERSION: 5.15.2
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install vcpkg Qt
run: |
$TempDir = "$env:RUNNER_WORKSPACE\temp"
$Filename = "vcpkg-qt-$env:Qt_VERSION.7z"
New-Item -Path "$TempDir" -ItemType Directory -ea 0
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
7z x "-o$env:RUNNER_WORKSPACE" -aos "$TempDir\$Filename"
- name: Install dependencies
run: choco install ninja
- name: Enable Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: |
$workspace = $env:RUNNER_WORKSPACE -replace '\\', '/'
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=Release `
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
# - name: Upload artifacts
# uses: actions/upload-artifact@v2
# with:
# name: urde-${{github.run_number}}-win32-msvc-x86_64
# path: |
# build/Binaries/urde.exe
# build/Binaries/hecl.exe
# build/Binaries/hecl-gui.exe
# build/Binaries/visigen.exe

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.12) cmake_minimum_required(VERSION 3.12)
set(MACOSX_DEPLOYMENT_TARGET 10.10) set(MACOSX_DEPLOYMENT_TARGET 10.14)
# Use release build type as default (assimp complains if this is unset) # Use release build type as default (assimp complains if this is unset)
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)

View File

@ -1,28 +1,132 @@
{ {
"configurations": [ "configurations": [
{ {
"name": "x64-Debug", "name": "x64-Clang-Debug",
"generator": "Ninja", "generator": "Ninja",
"configurationType": "Debug", "configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ], "inheritEnvironments": [ "clang_cl_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}", "buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}", "installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/5.14.1/msvc2017_64/lib/cmake/Qt5", "cmakeCommandArgs": "",
"buildCommandArgs": "", "buildCommandArgs": "-v",
"ctestCommandArgs": "", "ctestCommandArgs": "",
"variables": [] "variables": [
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreadedDebugDLL",
"type": "STRING"
}
]
}, },
{ {
"name": "x64-Release", "name": "x64-Clang-Release",
"generator": "Ninja", "generator": "Ninja",
"configurationType": "RelWithDebInfo", "configurationType": "RelWithDebInfo",
"inheritEnvironments": [ "msvc_x64_x64" ], "inheritEnvironments": [ "clang_cl_x64" ],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}", "buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}", "installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DCMAKE_PREFIX_PATH=C:/Qt/5.14.1/msvc2017_64/lib/cmake/Qt5", "cmakeCommandArgs": "",
"buildCommandArgs": "", "buildCommandArgs": "-v",
"ctestCommandArgs": "", "ctestCommandArgs": "",
"variables": [] "variables": [
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreadedDLL",
"type": "STRING"
}
]
},
{
"name": "x64-Clang-Release-vcpkg",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [ "clang_cl_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"variables": [
{
"name": "CMAKE_TOOLCHAIN_FILE",
"value": "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake",
"type": "FILEPATH"
},
{
"name": "VCPKG_TARGET_TRIPLET",
"value": "x64-windows-static",
"type": "STRING"
},
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreaded",
"type": "STRING"
}
]
},
{
"name": "x64-MSVC-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreadedDebugDLL",
"type": "STRING"
}
]
},
{
"name": "x64-MSVC-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreadedDLL",
"type": "STRING"
}
]
},
{
"name": "x64-MSVC-Release-vcpkg",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
"name": "CMAKE_TOOLCHAIN_FILE",
"value": "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake",
"type": "FILEPATH"
},
{
"name": "VCPKG_TARGET_TRIPLET",
"value": "x64-windows-static",
"type": "STRING"
},
{
"name": "CMAKE_MSVC_RUNTIME_LIBRARY",
"value": "MultiThreaded",
"type": "STRING"
}
]
} }
] ]
} }