accelerator/.github/workflows/build-extension.yml
sappho 1d60f3746a
overhaul -> overhaul (#21)
* overhaul the repository

add protobuf

change repo url

try to restore github python syntax highlighter

move breakpad into third_party, update packagescript

* AMBuildifying

remove unnecessary files

Move the git patching into ambuild

move lss to a patch

Add windows compilation support

remove breakpad.bat

move postlink libs

* Overhaul CI (#4)

* Dockerbuild (#5)

* make cwd_cmd spew stdout and stderr

* add proper docker build support

* Overhaul ci (#6)

* Setup CI

* fix checkout

* fix yaml syntax

* no fail fast

* setup CI cache

* Fix pip install

* remove pip git

* update actions, ditch node 16

* small syntax cleanups

* more CI changes

* github doc lied

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>

* final push for perfect dockerbuilds in every scenario that i have been able to find

* rename cicd->dockerbuild

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>

* Add readme, remode duplicate -fPIC

update names of dockerbuild folder in sh files

* cleanup dockerfile (#7)

* Update 0002-Write-FUNC-records-instead-of-PUBLIC-for-ELF-symbols.patch

* Statically link libz, libgcc & libstdc++

* fix submodule path

* Review change + comment patch

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
Co-authored-by: Benoist <14257866+Kenzzer@users.noreply.github.com>
2024-10-10 21:59:28 -04:00

102 lines
2.6 KiB
YAML

name: Build extension
on:
workflow_call:
inputs:
os:
type: string
required: true
cc:
type: string
required: true
cxx:
type: string
upload:
type: boolean
required: false
default: false
upload-artifact-name:
type: string
required: false
default: package
debug:
type: boolean
required: false
default: false
cache-key:
type: string
required: true
cache-dir:
type: string
required: true
jobs:
build:
name: Accelerator Extension ${{ inputs.os }}-${{ inputs.cc }}
runs-on: ${{ inputs.os }}
env:
SOURCEMOD: ${{ github.workspace }}/${{ inputs.cache-dir }}/sourcemod
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Retrieve the cache
id: cache
uses: actions/cache@v4
with:
path: ${{ inputs.cache-dir }}
key: ${{ inputs.cache-key }}
fail-on-cache-miss: true
enableCrossOsArchive: true
- name: Linux dependencies
if: startsWith(runner.os, 'Linux')
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gcc-multilib g++-multilib libstdc++6 lib32stdc++6 \
libc6-dev libc6-dev-i386 linux-libc-dev \
linux-libc-dev:i386 lib32z1-dev \
zlib1g-dev:i386 zlib1g-dev ${{ inputs.cc }}
- name: Select clang compiler
if: startsWith(runner.os, 'Linux')
run: |
echo "CC=${{ inputs.cc }}" >> $GITHUB_ENV
echo "CXX=${{ inputs.cxx }}" >> $GITHUB_ENV
${{ inputs.cc }} --version
${{ inputs.cxx }} --version
- uses: actions/setup-python@v5
name: Setup Python 3.10
with:
python-version: '3.10'
- name: Install AMBuild
run: |
python -m pip install --upgrade pip setuptools wheel
pip install ./${{ inputs.cache-dir }}/ambuild
- name: Build (Debug)
if: ${{ inputs.debug }}
run: |
mkdir -p build && cd build
python ../configure.py --enable-debug
ambuild
- name: Build (Release)
if: not ${{ inputs.debug }}
run: |
mkdir -p build && cd build
python ../configure.py --enable-optimize
ambuild
- name: Upload package
if: ${{ inputs.upload }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.upload-artifact-name }}
path: build/package