Skip to content

ver 1.0.1

ver 1.0.1 #2

Workflow file for this run

name: build
on:
push:
paths:
- pushbuild.txt
pull_request:
paths:
- pushbuild.txt
jobs:
build:
name: build with sm${{ matrix.sm_version }} on ${{ matrix.os_short }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
sm_version:
- "1.11"
- "latest"
include:
- sm_version: latest
sm_branch: master
- sm_version: "1.11"
sm_branch: "1.11-dev"
- os: windows-latest
os_short: win
- os: ubuntu-latest
os_short: linux
steps:
- name: Prepare env
shell: bash
run: |
echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Install (Linux)
if: runner.os == 'Linux'
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: Getting SourceMod ${{ matrix.sm_version }}
uses: actions/checkout@v4
with:
repository: alliedmodders/sourcemod
ref: ${{ matrix.sm_branch }}
path: sourcemod-${{ matrix.sm_version }}
submodules: recursive
- name: Getting AMBuild
uses: actions/checkout@v4
with:
repository: alliedmodders/ambuild
path: ambuild
- name: Setting up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Getting ambuild
run: |
python -m pip install wheel
pip install git+https://github.com/alliedmodders/ambuild
- name: Getting own repository
uses: actions/checkout@v4
with:
path: extension
- name: Install v143 Toolset
if: runner.os == 'Windows'
shell: powershell
run: |
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
$InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
$WorkLoads = '--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64'
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache')
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0) {
Write-Host "components have been successfully added"
} else {
Write-Host "components were not installed"
}
- uses: microsoft/setup-msbuild@v2
if: runner.os == 'Windows'
with:
msbuild-architecture: x64
vs-version: '15'
- name: Compiling ${{ github.event.repository.name }} files
working-directory: extension
run: |
mkdir build
cd build
python ../configure.py --enable-optimize --symbol-files --sm-path="${{ github.workspace }}/sourcemod-${{ matrix.sm_version }}" --targets=x64,x86
ambuild
- name: Uploading package
uses: actions/upload-artifact@v4
with:
name: sm-ext-yyjson-sm${{ matrix.sm_version }}-${{ matrix.os_short }}-${{ env.GITHUB_SHA_SHORT }}
path: extension/build/package