Skip to content

build

build #1460

Workflow file for this run

name: build
on:
workflow_dispatch:
jobs:
ubuntu:
name: Ubuntu ${{ matrix.arch }} ${{ matrix.build_type }} (${{ matrix.portable }})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
arch: [x86]
build_type: [Release]
portable: [Non-Portable]
steps:
- uses: actions/checkout@v4
- name: Create Build Environment
run: |
if [ ${{ matrix.arch }} == "x86" ]; then
sudo dpkg --add-architecture i386
sudo apt-get -qq update
sudo apt-get -y install aptitude
sudo apt-get -y install gcc-multilib g++-multilib ninja-build
sudo apt-get -y install --allow-downgrades libpcre2-8-0=10.34-7 libjpeg-dev:i386 libpng-dev:i386 libcurl4-openssl-dev:i386
sudo aptitude -y install libglib2.0-dev:i386 libsdl2-dev:i386
else
sudo apt-get -qq update
sudo apt-get install libjpeg-dev libpng-dev zlib1g-dev libsdl2-dev
fi
cmake -E make_directory ${{ github.workspace }}/build
- name: Configure CMake
shell: bash
working-directory: ${{ github.workspace }}/build
run: |
OPTIONS="-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install"
if [ "${{ matrix.portable }}" == "Portable" ]; then
OPTIONS+=" -DUseInternalLibs=ON -DBuildPortableVersion=ON"
else
OPTIONS+=" -DUseInternalLibs=OFF -DBuildPortableVersion=OFF"
fi
if [ ${{ matrix.arch }} == "x86" ]; then
OPTIONS+=" -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchains/linux-i686.cmake"
fi
OPTIONS+=" -DBuildJK2SPEngine=OFF -DBuildJK2SPGame=OFF -DBuildJK2SPRdVanilla=OFF"
cmake $GITHUB_WORKSPACE $OPTIONS
- name: Build
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --build . -j $(nproc)
- name: Install
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --install .
- name: Create OpenJK binary archive
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/install/JediAcademy
shell: bash
run: tar -czvf OpenJK-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz *
- uses: actions/upload-artifact@v4
if: ${{ matrix.build_type == 'Release' }}
with:
name: OpenJK-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}
path: ${{github.workspace}}/install/JediAcademy/OpenJK-linux-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.portable }}.tar.gz
if-no-files-found: error