This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
Meson Build (Linux, macOS) #465
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Meson Build (Linux, macOS) | |
on: | |
# Triggers the workflow when manually dispatched | |
workflow_dispatch: | |
inputs: | |
upload_artefacts: | |
description: "Upload build artefacts" | |
type: boolean | |
required: false | |
default: false | |
build_type: | |
description: "Build Configuration" | |
type: choice | |
required: false | |
default: "release" | |
options: | |
- "release" | |
- "debug" | |
debug_level: | |
description: "Debug Level" | |
type: choice | |
required: false | |
default: "release" | |
options: | |
- "release" | |
- "minimal" | |
- "full" | |
# Triggers the workflow when called by a top-level workflow | |
workflow_call: | |
inputs: | |
upload_artefacts: | |
type: boolean | |
required: false | |
default: false | |
build_type: # "release" | "debug" | |
type: string | |
required: false | |
default: "release" | |
debug_level: # "full" | "minimal" | "release" | |
type: string | |
required: false | |
default: "release" | |
env: | |
MESON_VERSION: "0.60.3" | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
name: Linux Build | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update -yq | |
sudo apt-get install --no-install-recommends wget liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev liblua5.2-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev libtbb-dev libsdl2-dev libopengl-dev libfuse2 ninja-build | |
sudo pip install meson==${{env.MESON_VERSION}} | |
- name: Setup Meson | |
env: | |
CC: "gcc" | |
CXX: "g++" | |
run: | | |
meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} -Db_lto=true build | |
- name: Configure for AppImage | |
if: ${{inputs.upload_artefacts}} | |
env: | |
CC: "gcc" | |
CXX: "g++" | |
run: meson configure -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=/usr/lib/ --prefix=/usr/ build | |
- name: Build | |
env: | |
CC: "gcc" | |
CXX: "g++" | |
run: | | |
meson compile -C build | |
- name: Create AppDir | |
if: ${{inputs.upload_artefacts}} | |
run: | | |
echo "Setting output prefix" | |
DESTDIR=${GITHUB_WORKSPACE}/build/AppDir meson install -C $GITHUB_WORKSPACE"/build" | |
- name: Download linuxdeploy | |
if: ${{inputs.upload_artefacts}} | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O lindeploy | |
chmod +x lindeploy | |
- name: Create AppImage | |
if: ${{inputs.upload_artefacts}} | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
env: | |
LD_LIBRARY_PATH: ./external/lib/linux/x86_64/ | |
OUTPUT: CortexCommand.AppImage | |
run: | | |
echo ${LD_LIBRARY_PATH} | |
./lindeploy --appdir=build/AppDir --output appimage | |
- name: Upload Appimage | |
if: ${{inputs.upload_artefacts}} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: CortexCommand (Linux) | |
path: CortexCommand.AppImage | |
if-no-files-found: error | |
build-macos: | |
runs-on: macos-11 | |
name: MacOS Build | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- name: Install Dependencies | |
run: | | |
brew install pkg-config tbb sdl2 minizip lz4 flac luajit [email protected] libpng gcc@12 ninja meson dylibbundler | |
- name: Setup Meson | |
env: | |
CC: "gcc-12" | |
CXX: "g++-12" | |
LDFLAGS: "-static-libgcc -static-libstdc++" | |
run: | | |
meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} -Db_lto=false build | |
- name: Configure for App Bundle | |
if: ${{inputs.upload_artefacts}} | |
env: | |
CC: "gcc-12" | |
CXX: "g++-12" | |
LDFLAGS: "-static-libgcc -static-libstdc++" | |
run: | | |
meson configure \ | |
-Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=Contents/Frameworks \ | |
--bindir=Contents/MacOS \ | |
--prefix="/tmp/Cortex Command.app" \ | |
build | |
- name: Build | |
env: | |
CC: "gcc-12" | |
CXX: "g++-12" | |
LDFLAGS: "-static-libgcc -static-libstdc++" | |
run: | | |
meson compile -C build | |
- name: Create App Bundle | |
if: ${{inputs.upload_artefacts}} | |
run: | | |
DESTDIR="/tmp/Cortex Command.app" meson install -C build | |
- name: Tar files | |
if: ${{inputs.upload_artefacts}} | |
run: | | |
cd /tmp/ | |
tar -cvf CortexCommand.tar "Cortex Command.app" | |
- name: Move artefact | |
if: ${{inputs.upload_artefacts}} | |
run: cp /tmp/CortexCommand.tar . | |
- name: Artifact Deploy | |
if: ${{inputs.upload_artefacts}} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: CortexCommand (macOS) | |
path: | | |
CortexCommand.tar | |
if-no-files-found: error | |
build-windows: | |
runs-on: windows-latest | |
name: Windows Build | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- name: Install Dependencies | |
run: | | |
pip install meson | |
- name: Setup | |
run: | | |
meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} --vsenv build | |
- name: Build | |
run: | | |
meson compile -Cbuild |