Build Linux #16
This file contains hidden or 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: Build Linux | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| build_type: | |
| description: 'Build type' | |
| required: true | |
| default: 'Release' | |
| type: choice | |
| options: | |
| - Release | |
| - Debug | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Build in Ubuntu 14.04 container | |
| run: | | |
| docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace ubuntu:14.04 bash -c ' | |
| set -e | |
| # Add PPA for newer GCC | |
| apt-get update | |
| apt-get install -y software-properties-common | |
| add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
| apt-get update | |
| # Install build dependencies with multilib support | |
| apt-get install -y \ | |
| gcc-9 g++-9 gcc-9-multilib g++-9-multilib \ | |
| make git wget \ | |
| libc6-dev libc6-dev-i386 \ | |
| lib32stdc++-9-dev | |
| # Install CMake 3.10+ | |
| wget -q https://cmake.org/files/v3.16/cmake-3.16.9-Linux-x86_64.tar.gz | |
| tar -xzf cmake-3.16.9-Linux-x86_64.tar.gz | |
| export PATH=$(pwd)/cmake-3.16.9-Linux-x86_64/bin:$PATH | |
| # Set GCC 9 as default | |
| update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 | |
| update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 90 | |
| # Build | |
| mkdir -p build | |
| cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} | |
| cmake --build . --target nextclientapi_amxx -j$(nproc) | |
| ' | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nextclientapi_amxx-linux-${{ inputs.build_type }} | |
| path: build/nextclientapi_amxx_i386.so | |
| if-no-files-found: error |