update ci #2
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: 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 | |
cd .. | |
mkdir -p 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 | |
cd libs/udis86 | |
./autogen.sh | |
./configure | |
make | |
popd | |
- name: Build Lua | |
run: | | |
pushd | |
cd 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 | |
./autoconfig.sh | |
mkdir -p build/release | |
cd build/release | |
ambuild | |
echo "Project built." | |
- name: Execute multibuild for packaging | |
run: | | |
./multibuild.sh | |
echo "Packaging completed." | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: build/release/*.zip | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: true |