chore: remove package #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
- master | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- main | |
- master | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
metamod-version: [703c36e7b7711ef441932025eebaabf4b7d5e548] | |
python-version: ['3.11'] | |
include: | |
- os: ubuntu-20.04 | |
target-arch: x86 | |
sdk: sdk2013 | |
sdk-version: 4c27c1305c5e042ae1f62f6dc6ba7e96fd06e05d | |
compiler_cc: clang | |
compiler_cxx: clang++ | |
steps: | |
- name: Install Linux packages | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update -q | |
sudo apt-get install -yq --no-install-recommends g++-multilib ${{ matrix.compiler_cc }} | |
- name: Select compiler | |
if: startsWith(runner.os, 'Linux') | |
run: | | |
echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV | |
echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV | |
${{ matrix.compiler_cc }} --version | |
${{ matrix.compiler_cxx }} --version | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: extension | |
- name: Checkout Metamod | |
uses: actions/checkout@v4 | |
with: | |
repository: alliedmodders/metamod-source | |
ref: ${{ matrix.metamod-version }} | |
path: metamod-source | |
submodules: recursive | |
- name: Checkout hl2sdks | |
uses: actions/checkout@v4 | |
with: | |
repository: alliedmodders/hl2sdk | |
ref: ${{ matrix.sdk-version }} | |
path: hl2sdk-${{ matrix.sdk }} | |
submodules: recursive | |
- name: Install AMBuild | |
run: | | |
python -m pip install wheel | |
python -m pip install git+https://github.com/alliedmodders/ambuild | |
- name: Build | |
working-directory: extension | |
shell: bash | |
env: | |
BREAKPAD_SYMBOL_SERVER: ${{ secrets.BREAKPAD_SYMBOL_SERVER }} | |
run: | | |
ls -all ../ | |
mkdir build && cd build | |
python ../configure.py --enable-optimize --symbol-files --targets=${{ matrix.target-arch }} --sdks=${{ matrix.sdk }} | |
ambuild | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: package-${{ runner.os }}-${{ matrix.sdk }}-${{ matrix.target-arch }} | |
path: extension/build/package | |
release: | |
name: Release | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
- name: Versioning | |
run: | | |
version="latest" | |
if [[ "${{ github.ref_type }}" == 'tag' ]]; then | |
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`; | |
fi | |
echo "RELEASE_VERSION=$version" >> $GITHUB_ENV | |
- name: Package | |
run: | | |
ls -Rall | |
for dir in package-*/; do | |
if [ -d "$dir" ]; then | |
cd "$dir" | |
pkg_name=${dir#package-} | |
pkg_name=${pkg_name%/} | |
pkg_name=$(echo "$pkg_name" | tr '[:upper:]' '[:lower:]') | |
tar -czf ../${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}-${pkg_name}.tar.gz -T <(\ls -1) | |
cd - | |
fi | |
done | |
- name: Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: '*.tar.gz' | |
tag: ${{ github.ref }} | |
file_glob: true |