mirror of
https://github.com/nillerusr/source-engine.git
synced 2025-02-04 19:24:13 +00:00
113 lines
3.4 KiB
YAML
113 lines
3.4 KiB
YAML
name: Build
|
|
|
|
on: [push, pull_request]
|
|
env:
|
|
WAF_FLAGS: -T release --no-warns --prefix=build_hl2
|
|
|
|
jobs:
|
|
build-linux:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
bits: ['', '--64bits']
|
|
android: ['']
|
|
flags: ['', '-dl', '-u']
|
|
include:
|
|
- os: ubuntu-20.04
|
|
bits: ''
|
|
android: '--android=armeabi-v7a-hard,4.9,21 --use-togles'
|
|
flags: ''
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
DEPS: libopenal-dev libpng-dev libjpeg-dev libfreetype6-dev libfontconfig1-dev libcurl4-gnutls-dev libsdl2-dev zlib1g-dev libbz2-dev libedit-dev
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install common dependencies
|
|
run: sudo apt-get update && sudo apt-get install -y g++-multilib gcc-multilib
|
|
- name: Install 32bit dependencies
|
|
if: ${{ matrix.bits == '' && !matrix.android }}
|
|
run: |
|
|
sudo dpkg --add-architecture i386
|
|
sudo apt-get update
|
|
sudo apt-get install -y aptitude
|
|
sudo aptitude install -y $(echo $DEPS | sed -r 's/[a-z0-9_\-]+/&:i386/g')
|
|
- name: Install Android dependencies
|
|
if: ${{ matrix.android != '' }}
|
|
run: |
|
|
wget https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip -o /dev/null
|
|
unzip android-ndk-r10e-linux-x86_64.zip
|
|
export NDK_HOME=$PWD/android-ndk-r10e/
|
|
echo "NDK_HOME=$NDK_HOME" >> $GITHUB_ENV
|
|
echo "ANDROID_NDK_HOME=$NDK_HOME" >> $GITHUB_ENV
|
|
- name: Install 64bit dependencies
|
|
if: ${{ matrix.bits != '' }}
|
|
run: |
|
|
sudo apt-get install -y $DEPS
|
|
|
|
- if: ${{ matrix.bits == '' && !matrix.android }}
|
|
name: Set PKG_CONFIG_PATH
|
|
run: echo "PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig" >> $GITHUB_ENV
|
|
|
|
- name: Configure
|
|
run: ./waf configure ${{ matrix.bits }} ${{ matrix.android }} ${{ matrix.flags }} $WAF_FLAGS
|
|
- name: Build ${{ matrix.os }}
|
|
run: ./waf install
|
|
- name: Tar binaries
|
|
run: tar cvf build.tar build_hl2
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: Linux${{matrix.bits}}${{matrix.flags}}${{matrix.android}}.tar
|
|
path: build.tar
|
|
|
|
build-macos:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
flags: ['', '-dl', '-u']
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install dependencies
|
|
run: brew install sdl2
|
|
|
|
- name: Configure
|
|
run: ./waf configure --64bits ${{ matrix.flags }} $WAF_FLAGS
|
|
- name: Build macos-amd64
|
|
run: ./waf install
|
|
- name: Tar binaries
|
|
run: tar cvf build.tar build_hl2
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: macOS--64bits${{matrix.flags}}.tar
|
|
path: build.tar
|
|
|
|
build-windows:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [windows-2019]
|
|
bits: ['', '--64bits']
|
|
flags: ['', '-dl', '-u']
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Configure
|
|
run: ./waf configure ${{ matrix.bits }} ${{ matrix.flags }} ${{ env.WAF_FLAGS }}
|
|
- name: Build ${{ matrix.os }}
|
|
run: ./waf install
|
|
|