Modernize build/CI, support SourceMod 1.13, deprecate ForceHeartbeat
Rework the build and CI: swap to SourceMod's safetyhook-based CDetour and drop the vendored CDetour/asm sources, the old Makefile, Travis config, and buildbot perl scripts. Add GitHub Actions building and releasing x86 and x86_64 against SM 1.12 and 1.13, plus dependabot. Split the Windows and Linux packages and tidy naming. Gate IPluginManager::FindPluginByContext on the extension API version so the extension builds against both SM 1.12 (API 8) and 1.13 (API 9), and shim DETOUR_CREATE_STATIC_FIXED over the address overload safetyhook exposes. Deprecate SteamWorks_ForceHeartbeat: newer Steamworks SDKs removed ISteamGameServer::ForceHeartbeat, so make the native a no-op and mark it deprecated in the include.
This commit is contained in:
@@ -0,0 +1,161 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: sm${{ matrix.sm.label }}-${{ matrix.target.os_name }}-${{ matrix.target.arch }}
|
||||
runs-on: ${{ matrix.target.os }}
|
||||
container: ${{ matrix.target.container }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sm:
|
||||
- label: "1.12"
|
||||
branch: "1.12-dev"
|
||||
- label: "1.13"
|
||||
branch: "master"
|
||||
target:
|
||||
- os: ubuntu-latest
|
||||
os_name: linux
|
||||
arch: x86
|
||||
container: ghcr.io/alliedmodders/build-containers/debian11-clang22:latest
|
||||
- os: ubuntu-latest
|
||||
os_name: linux
|
||||
arch: x86_64
|
||||
container: ghcr.io/alliedmodders/build-containers/debian11-clang22:latest
|
||||
- os: windows-latest
|
||||
os_name: windows
|
||||
arch: x86
|
||||
msvc_arch: x86
|
||||
- os: windows-latest
|
||||
os_name: windows
|
||||
arch: x86_64
|
||||
msvc_arch: amd64
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Setup Python (Windows)
|
||||
if: matrix.target.os_name == 'windows'
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Setup MSVC (Windows)
|
||||
if: matrix.target.os_name == 'windows'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: ${{ matrix.target.msvc_arch }}
|
||||
|
||||
- name: Install AMBuild
|
||||
if: matrix.target.os_name == 'windows'
|
||||
shell: bash
|
||||
run: python -m pip install --upgrade git+https://github.com/alliedmodders/ambuild.git
|
||||
|
||||
- name: Clone dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
git clone --depth 1 --recurse-submodules -j8 --shallow-submodules https://github.com/rlabrecque/SteamworksSDK.git SteamworksSDK
|
||||
git clone --depth 1 --recurse-submodules -j8 --shallow-submodules -b 1.12-dev https://github.com/alliedmodders/metamod-source.git mmsource
|
||||
git clone --depth 1 --recurse-submodules -j8 --shallow-submodules -b ${{ matrix.sm.branch }} https://github.com/alliedmodders/sourcemod.git sourcemod
|
||||
|
||||
- name: Build (Linux)
|
||||
if: matrix.target.os_name == 'linux'
|
||||
env:
|
||||
CC: clang-22
|
||||
CXX: clang++-22
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
python3 ../configure.py \
|
||||
--sm-path ../sourcemod \
|
||||
--mms-path ../mmsource \
|
||||
--steamworks-path ../SteamworksSDK \
|
||||
--target ${{ matrix.target.arch }} \
|
||||
--enable-optimize
|
||||
ambuild
|
||||
|
||||
- name: Build (Windows)
|
||||
if: matrix.target.os_name == 'windows'
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
python ../configure.py \
|
||||
--sm-path ../sourcemod \
|
||||
--mms-path ../mmsource \
|
||||
--steamworks-path ../SteamworksSDK \
|
||||
--target ${{ matrix.target.arch }} \
|
||||
--enable-optimize
|
||||
ambuild
|
||||
|
||||
- name: Upload package artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: pkg-sm${{ matrix.sm.label }}-${{ matrix.target.os_name }}-${{ matrix.target.arch }}
|
||||
path: build/package/addons
|
||||
if-no-files-found: error
|
||||
|
||||
release:
|
||||
name: Release
|
||||
needs: build
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- name: Assemble packages
|
||||
id: package
|
||||
run: |
|
||||
base_version=$(grep -oP 'SMEXT_CONF_VERSION\s+"\K[^"]+' Extension/sdk/smsdk_config.h)
|
||||
build_number=$(git rev-list --count HEAD)
|
||||
version="${base_version}-git${build_number}"
|
||||
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# One package per SourceMod version per OS: Windows as .zip, Linux as
|
||||
# .tar.gz. Each merges that combination's per-arch slices (the include
|
||||
# file rides along in every slice).
|
||||
assets=""
|
||||
for label in 1.12 1.13; do
|
||||
for os_name in windows linux; do
|
||||
dest="package-sm${label}-${os_name}/addons"
|
||||
mkdir -p "${dest}"
|
||||
for dir in artifacts/pkg-sm${label}-${os_name}-*/; do
|
||||
cp -a "${dir}." "${dest}/"
|
||||
done
|
||||
if [ "${os_name}" = "windows" ]; then
|
||||
asset="SteamWorks-${version}-sm${label}-windows.zip"
|
||||
(cd "package-sm${label}-${os_name}" && zip -r "../${asset}" addons)
|
||||
else
|
||||
asset="SteamWorks-${version}-sm${label}-linux.tar.gz"
|
||||
tar -czf "${asset}" -C "package-sm${label}-${os_name}" addons
|
||||
fi
|
||||
assets="${assets} ${asset}"
|
||||
done
|
||||
done
|
||||
echo "assets=${assets# }" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create release
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
gh release create "v${{ steps.package.outputs.version }}" \
|
||||
${{ steps.package.outputs.assets }} \
|
||||
--target "${GITHUB_SHA}" \
|
||||
--title "SteamWorks ${{ steps.package.outputs.version }}" \
|
||||
--notes "Automated release built from ${GITHUB_SHA}."
|
||||
Reference in New Issue
Block a user