Skip to content

Fix Linux Build

Fix Linux Build #399

Workflow file for this run

name: Builds
on:
push:
branches:
- main
- pass_rework
jobs:
build:
name: "${{matrix.title}} (${{matrix.cc}}, ${{matrix.arch}}, ${{matrix.build_type}})"
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
include:
# We can build Windows/Mac
- { title: "Linux", os: "ubuntu-latest", cc: "clang-14", cx: "clang++-14", arch: "x64", build_type: "Release" }
- { title: "Linux", os: "ubuntu-latest", cc: "clang-14", cx: "clang++-14", arch: "x64", build_type: "Debug" }
# - { title: "Linux", os: "ubuntu-latest", cc: "gcc-11", cx: "g++-11", arch: "x64", build_type: "Release" }
# - { title: "Linux", os: "ubuntu-latest", cc: "gcc-11", cx: "g++-11", arch: "x64", build_type: "Debug" }
- { title: "Windows", os: "windows-latest", cc: "vs2022", arch: "x64", build_type: "Release", package_type: "x64-windows-static-md", script: "bat" }
- { title: "Windows", os: "windows-latest", cc: "vs2022", arch: "x64", build_type: "Debug", package_type: "x64-windows-static-md", script: "bat" }
- { title: "Mac", os: "macos-latest", cc: "clang-15", cx: "clang++-15", arch: "x64", build_type: "Release" }
- { title: "Mac", os: "macos-latest", cc: "clang-15", cx: "clang++-15", arch: "x64", build_type: "Debug" }
steps:
- uses: actions/checkout@v2
- name: Install Vulkan SDK
uses: humbletim/setup-vulkan-sdk@v1.2.0
with:
vulkan-query-version: 1.3.261.1
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
# TODO: Do we really need all this junk on linux?
- name: Install Libraries
run: |
wget https://apt.llvm.org/llvm.sh
sudo bash ./llvm.sh 14
sudo apt update
sudo apt-get install build-essential clang-14 gcc-11 g++-11 xserver-xorg-dev x11proto-xf86vidmode-dev libxxf86vm-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libxext-dev
if: matrix.os == 'ubuntu-latest'
- name: Prebuild
working-directory: ${{github.workspace}}
shell: bash
run: |
git submodule update --init --recursive
./prebuild.bat
if: matrix.os == 'windows-latest'
- name: Prebuild Linux_Mac
working-directory: ${{github.workspace}}
run: |
git submodule update --init --recursive
./prebuild.sh
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
- name: GCC11
run: echo "CXX=g++-11" >> $GITHUB_ENV
if: matrix.cc == 'gcc-11'
- name: Clang14
run: |
echo "CXX=clang++-14" >> $GITHUB_ENV
echo "CC=clang-14" >> $GITHUB_ENV
if: matrix.os == 'ubuntu-latest' && matrix.cc == 'clang-14'
- name: Clang15_Mac
run: |
echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV
echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV
if: matrix.os == 'macos-latest'
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DLIBCXX_ENABLE_INCOMPLETE_FEATURES=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cmake --build . --config ${{ matrix.build_type }}
cmake --install . --config ${{ matrix.build_type }} --prefix ../artifacts
- name: Zip Folder (Win/Linux)
uses: papeloto/action-zip@v1
with:
files: artifacts/bin/
dest: ${{matrix.title}}.zip
recursive: false
if: (matrix.build_type == 'Release') && (matrix.cc != 'gcc') && (matrix.os != 'macos-latest')
- name: Zip Folder (Mac)
uses: papeloto/action-zip@v1
with:
files: artifacts/Rezonality.app
dest: ${{matrix.title}}.zip
recursive: true
if: (matrix.build_type == 'Release') && (matrix.os == 'macos-latest')
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{github.workspace}}/${{matrix.title}}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/') && (matrix.build_type == 'Release') && (matrix.title != 'Linux')
- name: Build Artifact Upload
uses: actions/upload-artifact@v1
with:
name: build-artifacts
path: ${{github.workspace}}/${{matrix.title}}.zip
if: (matrix.build_type == 'Release') && (matrix.title != 'Linux')