Skip to content

update ci

update ci #7

Workflow file for this run

name: Build and Release
on:
push:
branches:
- testbuild
jobs:
build-and-package:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install system dependencies
run: |
sudo dpkg --add-architecture i386
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y autoconf libtool nasm libiberty-dev:i386 libelf-dev:i386 libboost-dev:i386 libbsd-dev:i386 libunwind-dev:i386 lib32z1-dev libc6-dev-i386 linux-libc-dev:i386 g++-13-multilib
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13
echo "Dependencies installed successfully."
- name: Clone and install AMBuild
run: |
git clone https://github.com/alliedmodders/ambuild --depth 1
cd ambuild
python -m pip install .
echo 'export PATH=~/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
- name: Print Python packages and PATH
run: |
echo "Python packages:"
pip list
echo "PATH: $PATH"
echo "Python location: $(which python)"
echo "Python version: $(python --version)"
python -m site
- name: Clone sourcemod and hl2sdk
run: |
pushd ..
mkdir -p alliedmodders
cd alliedmodders
git clone --recursive https://github.com/alliedmodders/sourcemod --depth 1 -b 1.11-dev
git clone https://github.com/alliedmodders/hl2sdk --depth 1 -b sdk2013 hl2sdk-sdk2013
git clone https://github.com/TF2-DMB/hl2sdk-tf2.git --depth 1 hl2sdk-tf2
git clone https://github.com/alliedmodders/hl2sdk --depth 1 -b css hl2sdk-css
git clone https://github.com/alliedmodders/metamod-source --depth 1 -b 1.11-dev
popd
- name: Build submodules
run: |
echo "export PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
git submodule update --init --recursive
pushd libs/udis86
./autogen.sh
./configure
make
popd
- name: Build Lua
run: |
pushd libs
wget https://www.lua.org/ftp/lua-5.4.4.tar.gz
tar -xf lua-*.tar.gz
rm lua-*.tar.gz
mv lua-* lua
cd lua
make MYCFLAGS='-m32' MYLDFLAGS='-m32'
popd
- name: Configure and build with AMBuild
run: |
echo "export PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
export PATH=$HOME/.local/bin:$PATH
PATH=$HOME/.local/bin:$PATH
pip list
echo $PATH
PROJECT_DIR=$(pwd)
CONFIGURE=$(realpath configure.py)
PATHS="--hl2sdk-root=$PROJECT_DIR/../alliedmodders --mms-path=$PROJECT_DIR/../alliedmodders/metamod-source --sm-path=$PROJECT_DIR/../alliedmodders/sourcemod"
mkdir -p build/release
pushd build/release
CC=gcc CXX=g++ $CONFIGURE $PATHS --sdks=tf2 --enable-optimize --exclude-mods-debug --exclude-mods-visualize --exclude-vgui
popd
pushd build/release/optimize-only
CC=gcc CXX=g++ $CONFIGURE $PATHS --enable-optimize --exclude-mods-debug --exclude-mods-visualize --exclude-vgui --optimize-mods-only
popd
pushd build/release/no-mvm
CC=gcc CXX=g++ $CONFIGURE $PATHS --sdks=tf2 --enable-optimize --exclude-mods-debug --exclude-mods-visualize --exclude-vgui --exclude-mods-mvm
popd
./multibuild.sh
echo "Project built."
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: build/release/*.zip
token: ${{ secrets.GITHUB_TOKEN }}
draft: true