Skip to content

Commit

Permalink
chore: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
7mochi committed Sep 13, 2024
1 parent 5404cb3 commit e3fc061
Showing 1 changed file with 40 additions and 17 deletions.
57 changes: 40 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
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
Expand All @@ -24,11 +24,11 @@ jobs:
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
Expand All @@ -41,7 +41,7 @@ jobs:
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
Expand All @@ -50,23 +50,23 @@ jobs:
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

Expand All @@ -75,27 +75,27 @@ jobs:
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
Expand All @@ -104,19 +104,42 @@ jobs:
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
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 }}

0 comments on commit e3fc061

Please sign in to comment.