switch to github actions
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
name: Build on ${{ matrix.os_short }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-18.04
|
||||
- windows-latest
|
||||
include:
|
||||
- os: ubuntu-18.04
|
||||
os_short: linux
|
||||
- os: windows-latest
|
||||
os_short: windows
|
||||
|
||||
steps:
|
||||
|
||||
- name: Setup Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
- name: Install AMBuild
|
||||
run: |
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
pip install git+https://github.com/alliedmodders/ambuild
|
||||
|
||||
- name: Install dependencies (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-multilib g++-multilib llvm-10 clang-10
|
||||
|
||||
- name: Select clang compiler (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
echo "CC=clang" >> $GITHUB_ENV
|
||||
echo "CXX=clang++" >> $GITHUB_ENV
|
||||
clang --version
|
||||
clang++ --version
|
||||
|
||||
- name: Find Visual C++ compilers and make all environment variables global (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
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: Checkout MetaMod
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: alliedmodders/metamod-source
|
||||
path: metamod-source
|
||||
submodules: recursive
|
||||
|
||||
- name: Checkout SourceMod
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: alliedmodders/sourcemod
|
||||
ref: 1.11-dev
|
||||
path: sourcemod
|
||||
submodules: recursive
|
||||
|
||||
- name: Checkout hl2sdk-csgo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: alliedmodders/hl2sdk
|
||||
ref: csgo
|
||||
path: hl2sdk-csgo
|
||||
|
||||
- name: Checkout hl2sdk-insurgency
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: alliedmodders/hl2sdk
|
||||
ref: insurgency
|
||||
path: hl2sdk-insurgency
|
||||
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 99999
|
||||
path: extension
|
||||
|
||||
- name: Build
|
||||
working-directory: extension
|
||||
shell: bash
|
||||
run: |
|
||||
python -c "import os; print(os.environ['GITCOMMIT'])"
|
||||
mkdir build && cd build
|
||||
python ../configure.py --enable-optimize --sdks=csgo
|
||||
ambuild
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ runner.os }}
|
||||
path: extension/build/package
|
||||
Reference in New Issue
Block a user