Skip to content

chore: add release workflow #58

chore: add release workflow

chore: add release workflow #58

Workflow file for this run

name: LLHL - New version release
on:
push:
jobs:
build-linux:
runs-on: ubuntu-latest
container: centos:centos7
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Setting up CentOS 7 mirrorlist
run: |
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
- name: Installing required packages
run: |
yum install -y git make wget tar zip gcc gcc-c++ glibc-devel.i686 libstdc++-devel.i686
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 12
- name: Clone LLHL AGMOD repository
run: |
git clone https://github.com/7mochi/llhl-agmod
- name: Clone LLHL repository
run: |
git clone https://github.com/7mochi/llhl
cd llhl && git checkout 3.0-stable && cd $GITHUB_WORKSPACE
- name: Build LLHL AGMOD serverfile .so
run: |
cd llhl-agmod
CPATH=$CPATH:/usr/include/c++/4.8.5/i686-redhat-linux CFG=$CONFIGURATION make -C dlls
cd $GITHUB_WORKSPACE
- name: Build LLHL proyect (Linux) with node-amxxpack
run: |
cd llhl && make init-linux && make build-linux
- name: Download latest AMX Mod X 1.9
run: |
wget "https://www.amxmodx.org/latest.php?version=1.9&os=linux&package=base" -O amxx.tar.gz
tar -xzf amxx.tar.gz -C llhl/dist/ag
- name: Create folder and move LLHL AGMOD .so
run: |
mkdir -p llhl/dist/ag/dlls
mv llhl-agmod/dlls/ag_i386.so llhl/dist/ag/dlls/ag.so
mv llhl-agmod/network/delta.lst llhl/dist/ag/delta.lst
- name: Prepare releases in zip
run: |
cd llhl/dist && zip -r ../llhl-${{github.ref_name}}-linux.zip *
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: llhl-${{github.ref_name}}-linux
path: llhl/dist
build-windows:
runs-on: windows-2019
steps:
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
- name: Clone LLHL AGMOD repository
run: |
git clone https://github.com/7mochi/llhl-agmod
- name: Clone LLHL repository
run: |
git clone https://github.com/7mochi/llhl
cd llhl && git checkout 3.0-stable && cd $GITHUB_WORKSPACE
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.1
- name: Build LLHL AGMOD serverfile .dll
run: |
cd llhl-agmod
msbuild multiplayer.sln -target:ag /p:Configuration=Release
cd $GITHUB_WORKSPACE
- name: Build LLHL proyect (Windows) with node-amxxpack
run: |
cd llhl && make init-windows && make build-windows
- name: Download latest AMX Mod X 1.9
run: |
Invoke-WebRequest -Uri "https://www.amxmodx.org/latest.php?version=1.9&os=windows&package=base" -OutFile amxx.zip
Expand-Archive -Path amxx.zip -DestinationPath llhl/dist/ag
- name: Create folder and move LLHL AGMOD .dll
run: |
mkdir -p llhl/dist/ag/dlls
move llhl-agmod/dlls/msvc/Release/ag.dll llhl/dist/ag/dlls/ag.dll
move llhl-agmod/network/delta.lst llhl/dist/ag/delta.lst
- name: Prepare releases in zip
run: |
cd llhl/dist && Compress-Archive -Path * -DestinationPath ../llhl-${{github.ref_name}}-windows.zip
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: llhl-${{github.ref_name}}-windows
path: llhl/dist
release:
runs-on: ubuntu-latest
needs: [build-linux, build-windows]
steps:
- name: Download Linux artifact
uses: actions/download-artifact@v3
with:
name: llhl-${{github.ref_name}}-linux
- name: Download Windows artifact
uses: actions/download-artifact@v3
with:
name: llhl-${{github.ref_name}}-windows
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
llhl-${{github.ref_name}}-linux.zip
llhl-${{github.ref_name}}-windows.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}