Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

[AMBuilder,AMBuildScript,*.py]
indent_style = space
indent_size = 2
103 changes: 103 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: CI

on: [push]

jobs:
build:
name: ${{ matrix.os_short }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- windows-2019

include:
- os: ubuntu-22.04
os_short: linux
- os: windows-2019
os_short: windows

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: Setting up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install git+https://github.com/alliedmodders/ambuild

- name: Checking out hl2sdks
shell: bash
run: |
sdks=(hl2dm dods css tf2)
for sdk in "${sdks[@]}"
do
git clone --depth 1 -b $sdk https://github.com/alliedmodders/hl2sdk hl2sdk-$sdk
done

- name: Checking out MM:Source
uses: actions/checkout@v3
with:
repository: alliedmodders/metamod-source
ref: 1.12-dev
path: metamod-source

- name: Checking out own repository
uses: actions/checkout@v3
with:
path: stripper-source

- name: Compiling
working-directory: stripper-source
run: |
python3 configure.py --enable-optimize --symbol-files --sdks=hl2dm,dods,css,tf2 --targets=x86,x86_64
ambuild objdir

- name: Uploading package
uses: actions/upload-artifact@v4
with:
name: stripper-source-${{ matrix.os_short }}-${{ env.GITHUB_SHA_SHORT }}
path: stripper-source/objdir/package

release:
name: Release
if: github.ref_type == 'tag'
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4

- name: Arhive Assets
shell: bash
run: find * -maxdepth 0 -type d -exec zip -r {}.zip {} \;

- name: Create Release
shell: bash
run: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --latest -R ${{ github.repository }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload assets
shell: bash
run: gh release upload ${{ github.ref_name }} *.zip -R ${{ github.repository }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading