mirror of https://github.com/AxioDL/metaforce.git
259 lines
9.1 KiB
YAML
259 lines
9.1 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- '*.json'
|
|
- '*.md'
|
|
- '*LICENSE'
|
|
# pull_request:
|
|
|
|
jobs:
|
|
build-linux:
|
|
name: Build Linux (${{matrix.name}} x86_64)
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- name: GCC
|
|
cc: gcc
|
|
cxx: g++
|
|
- name: Clang
|
|
cc: clang
|
|
cxx: clang++
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get -y install build-essential curl git cmake ninja-build llvm-dev libclang-dev clang lld \
|
|
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
|
|
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev python3 python-is-python3 qt5-default
|
|
# free up disk space
|
|
# https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173
|
|
echo Before
|
|
df -h .
|
|
sudo apt-get clean
|
|
sudo rm -rf /usr/share/dotnet
|
|
sudo rm -rf /opt/ghc
|
|
sudo rm -rf /usr/local/share/boost
|
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
echo After
|
|
df -h .
|
|
|
|
- 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=RelWithDebInfo \
|
|
-DCMAKE_C_COMPILER=${{matrix.cc}} -DCMAKE_CXX_COMPILER=${{matrix.cxx}}
|
|
|
|
- name: Build
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE
|
|
|
|
- name: Generate AppImage
|
|
run: ci/build-appimage.sh
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: urde-${{env.URDE_VERSION}}-linux-${{matrix.cc}}-x86_64
|
|
path: URDE-*.AppImage
|
|
|
|
build-macos:
|
|
name: Build macOS (AppleClang x86_64)
|
|
runs-on: macos-10.15
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
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=RelWithDebInfo
|
|
|
|
- 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: |
|
|
mv hecl-gui.app URDE.app
|
|
for i in visigen hecl urde; do
|
|
codesign --timestamp --options runtime -s "${{secrets.MACOS_CODESIGN_IDENT}}" URDE.app/Contents/MacOS/$i
|
|
done
|
|
macdeployqt URDE.app -sign-for-notarization="${{secrets.MACOS_CODESIGN_IDENT}}" -no-strip
|
|
create-dmg URDE.app --identity="${{secrets.MACOS_CODESIGN_IDENT}}"
|
|
xcrun altool -t osx -f *.dmg --primary-bundle-id com.axiodl.URDE --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-${{env.URDE_VERSION}}-macos-appleclang-x86_64
|
|
path: build/Binaries/*.dmg
|
|
|
|
build-windows-msvc:
|
|
name: Build Windows (MSVC x86_64)
|
|
runs-on: [ self-hosted, windows, x64 ]
|
|
env:
|
|
LLVM_VERSION: 10.0.1
|
|
Qt_VERSION: 5.15.2
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Install LLVM
|
|
run: |
|
|
$TempDir = "$env:RUNNER_WORKSPACE\temp"
|
|
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
|
|
New-Item -Path "$TempDir" -ItemType Directory -ea 0
|
|
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
|
|
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
|
|
|
|
- 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 vulkan-sdk
|
|
|
|
- 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=RelWithDebInfo `
|
|
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
|
|
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
|
|
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_CXX_FLAGS= -DCMAKE_C_FLAGS= `
|
|
-DLLVM_ROOT_DIR="$workspace/LLVM"
|
|
|
|
- name: Build
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: urde-${{env.URDE_VERSION}}-win32-msvc-x86_64
|
|
path: |
|
|
build/Binaries/urde.exe
|
|
build/Binaries/urde.pdb
|
|
build/Binaries/hecl.exe
|
|
build/Binaries/hecl.pdb
|
|
build/Binaries/hecl-gui.exe
|
|
build/Binaries/hecl-gui.pdb
|
|
build/Binaries/visigen.exe
|
|
build/Binaries/visigen.pdb
|
|
|
|
build-windows-clang:
|
|
name: Build Windows (Clang x86_64)
|
|
runs-on: windows-2019
|
|
env:
|
|
LLVM_VERSION: 10.0.1
|
|
Qt_VERSION: 5.15.2
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Install LLVM
|
|
run: |
|
|
$TempDir = "$env:RUNNER_WORKSPACE\temp"
|
|
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
|
|
New-Item -Path "$TempDir" -ItemType Directory -ea 0
|
|
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
|
|
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
|
|
|
|
- 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 vulkan-sdk
|
|
|
|
- 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=RelWithDebInfo `
|
|
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
|
|
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
|
|
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
|
|
-DCMAKE_C_COMPILER="$workspace/LLVM/bin/clang-cl.exe" `
|
|
-DCMAKE_CXX_COMPILER="$workspace/LLVM/bin/clang-cl.exe" `
|
|
-DCMAKE_LINKER="$workspace/LLVM/bin/lld-link.exe" `
|
|
-DLLVM_ROOT_DIR="$workspace/LLVM"
|
|
|
|
- name: Build
|
|
working-directory: ${{github.workspace}}/build
|
|
run: cmake --build . --config $BUILD_TYPE
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: urde-${{env.URDE_VERSION}}-win32-clang-x86_64
|
|
path: |
|
|
build/Binaries/urde.exe
|
|
build/Binaries/urde.pdb
|
|
build/Binaries/hecl.exe
|
|
build/Binaries/hecl.pdb
|
|
build/Binaries/hecl-gui.exe
|
|
build/Binaries/hecl-gui.pdb
|
|
build/Binaries/visigen.exe
|
|
build/Binaries/visigen.pdb
|