2021-06-30 15:17:42 +08:00
|
|
|
name: l4d2-build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths-ignore:
|
|
|
|
- LICENSE
|
|
|
|
- README.md
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- LICENSE
|
|
|
|
- README.md
|
|
|
|
schedule:
|
|
|
|
- cron: '30 03 01 */3 *' # Artifacts expire every 3 months
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: build with mms${{ matrix.mm_version }} on ${{ matrix.os_short }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- windows-latest
|
|
|
|
|
|
|
|
mm_version:
|
2022-07-06 12:12:12 +08:00
|
|
|
- "master"
|
2021-06-30 15:17:42 +08:00
|
|
|
|
|
|
|
include:
|
2022-07-06 12:12:12 +08:00
|
|
|
- mm_version: "master"
|
|
|
|
mm_branch: "master"
|
2021-06-30 15:17:42 +08:00
|
|
|
|
|
|
|
- os: ubuntu-latest
|
|
|
|
os_short: linux
|
|
|
|
|
|
|
|
- os: windows-latest
|
|
|
|
os_short: win
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Prepare env
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Install (Linux)
|
2023-01-19 18:05:48 +08:00
|
|
|
if: startsWith(runner.os, 'Linux')
|
2021-06-30 15:17:42 +08:00
|
|
|
run: |
|
|
|
|
sudo dpkg --add-architecture i386
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y clang g++-multilib
|
|
|
|
echo "CC=clang" >> $GITHUB_ENV
|
|
|
|
echo "CXX=clang++" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Add msbuild to PATH (Windows)
|
2023-01-19 18:05:48 +08:00
|
|
|
if: startsWith(runner.os, 'Windows')
|
|
|
|
uses: microsoft/setup-msbuild@v1.1
|
2021-06-30 15:17:42 +08:00
|
|
|
|
|
|
|
- name: Install (Windows)
|
2023-01-19 18:05:48 +08:00
|
|
|
if: startsWith(runner.os, 'Windows')
|
2021-06-30 15:17:42 +08:00
|
|
|
shell: cmd
|
|
|
|
run: |
|
|
|
|
:: See https://github.com/microsoft/vswhere/wiki/Find-VC
|
|
|
|
for /f "usebackq delims=*" %%i in (`vswhere -latest -property installationPath`) do (
|
|
|
|
call "%%i"\Common7\Tools\vsdevcmd.bat -arch=x86 -host_arch=x64
|
|
|
|
)
|
|
|
|
:: Loop over all environment variables and make them global.
|
|
|
|
for /f "delims== tokens=1,2" %%a in ('set') do (
|
|
|
|
echo>>"%GITHUB_ENV%" %%a=%%b
|
|
|
|
)
|
|
|
|
|
|
|
|
- name: Checking out MM:Source
|
2023-01-19 18:05:48 +08:00
|
|
|
uses: actions/checkout@v3
|
2021-06-30 15:17:42 +08:00
|
|
|
with:
|
|
|
|
repository: alliedmodders/metamod-source
|
|
|
|
ref: ${{ matrix.mm_branch }}
|
|
|
|
path: metamod-${{ matrix.mm_version }}
|
|
|
|
|
|
|
|
- name: Setting up Python
|
2023-01-19 18:05:48 +08:00
|
|
|
uses: actions/setup-python@v4
|
2021-06-30 15:17:42 +08:00
|
|
|
with:
|
|
|
|
python-version: '3.x'
|
|
|
|
|
|
|
|
- name: Setting up ambuild
|
2023-01-19 18:05:48 +08:00
|
|
|
run: |
|
|
|
|
python -m pip install wheel
|
|
|
|
pip install git+https://github.com/accelerator74/ambuild
|
2021-06-30 15:17:42 +08:00
|
|
|
|
2021-07-02 16:21:03 +08:00
|
|
|
- name: Checking out hl2sdk-l4d2
|
2023-01-19 18:05:48 +08:00
|
|
|
uses: actions/checkout@v3
|
2021-06-30 15:17:42 +08:00
|
|
|
with:
|
|
|
|
repository: alliedmodders/hl2sdk
|
|
|
|
ref: l4d2
|
|
|
|
path: hl2sdk-l4d2
|
|
|
|
|
|
|
|
- name: Checking out own repository
|
2023-01-19 18:05:48 +08:00
|
|
|
uses: actions/checkout@v3
|
2021-06-30 15:17:42 +08:00
|
|
|
with:
|
2023-01-19 18:05:48 +08:00
|
|
|
path: src
|
2021-06-30 15:17:42 +08:00
|
|
|
|
2023-01-19 18:05:48 +08:00
|
|
|
- name: Compiling ${{ github.event.repository.name }} files
|
|
|
|
working-directory: src
|
2021-06-30 15:17:42 +08:00
|
|
|
run: |
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
python ../configure.py --enable-optimize --sdks="l4d2" --mms-path="${{ github.workspace }}/metamod-${{ matrix.mm_version }}"
|
|
|
|
ambuild
|
|
|
|
|
|
|
|
- name: Uploading package
|
2023-01-19 18:05:48 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-06-30 15:17:42 +08:00
|
|
|
with:
|
|
|
|
name: L4DToolZ-l4d2-${{ env.GITHUB_SHA_SHORT }}
|
2023-01-19 18:05:48 +08:00
|
|
|
path: src/build/package
|