-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from 7mochi/3.0-stable
feat: update LLHL to 3.0-stable
- Loading branch information
Showing
17 changed files
with
4,838 additions
and
595 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,101 +6,198 @@ on: | |
- '*' | ||
|
||
jobs: | ||
build: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
container: centos:centos7 | ||
env: | ||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- 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: 18 | ||
- name: Install dependencies for Linux | ||
node-version: 12 | ||
|
||
- name: Clone LLHL AGMOD repository | ||
run: | | ||
make init-linux | ||
git clone https://github.com/7mochi/llhl-agmod | ||
- name: Clone LLHL repository | ||
run: | | ||
git clone https://github.com/7mochi/llhl | ||
- name: Clone LLHL Resources repository | ||
run: | | ||
git clone https://github.com/7mochi/llhl-resources | ||
- 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 | ||
- name: Build LLHL proyect (Linux) with node-amxxpack | ||
run: | | ||
make build-linux | ||
- name: Rename dist folder | ||
cd llhl && make init-linux && make build-linux | ||
- name: Download latest AMX Mod X 1.9 | ||
run: | | ||
mv dist dist-linux | ||
- name: Install dependencies for Windows | ||
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: Replace hamdata.ini with our custom one | ||
run: | | ||
make init-windows | ||
cp -f llhl/assets/addons/amxmodx/configs/hamdata.ini llhl/dist/ag/addons/amxmodx/configs/hamdata.ini | ||
- name: Create folder and copy LLHL AGMOD .so | ||
run: | | ||
mkdir -p llhl/dist/ag/dlls | ||
cp llhl-agmod/dlls/ag_i386.so llhl/dist/ag/dlls/ag.so | ||
cp llhl-agmod/network/delta.lst llhl/dist/ag/delta.lst | ||
- name: Build LLHL proyect (Windows) with node-amxxpack | ||
- name: Create folder for full release | ||
run: | | ||
make build-windows | ||
mkdir -p llhl/dist-full | ||
cp -r llhl/dist/* llhl/dist-full | ||
- name: Generate hashfile.sha1 | ||
- name: Copy LLHL resources to LLHL folder | ||
run: | | ||
cp -r llhl-resources/maps-ag-official/* llhl/dist-full/ag | ||
cp -r llhl-resources/maps-ehll-unofficial/* llhl/dist-full/ag | ||
cp -r llhl-resources/maps-valve-official/* llhl/dist-full/ag | ||
- name: Prepare releases in zip | ||
run: | | ||
# First linux | ||
cd dist-linux | ||
cd llhl/dist && zip -r ../llhl-${{github.ref_name}}-linux.zip * | ||
- name: Upload artifact (Lite version) | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: llhl-${{github.ref_name}}-linux-lite | ||
path: llhl/dist | ||
|
||
# Find all files in the dist folder except for a few | ||
find "$PWD" -type f -not -name "llhl.cfg" \ | ||
-and -not -name "plugins.ini" \ | ||
-and -not -name "*.inc" \ | ||
-and -not -name "*.sma" \ | ||
-and -not -name "*.gam" \ | ||
-and -not -name "motd_llhl*" \ | ||
-and -not -name "startup_server.cfg" \ | ||
-and -not -name "*.sha1" \ | ||
-exec sha1sum {} \; > hashfile.sha1 | ||
- name: Upload artifact (Full version) | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: llhl-${{github.ref_name}}-linux-full | ||
path: llhl/dist-full | ||
|
||
# Go back to root folder | ||
cd $GITHUB_WORKSPACE | ||
# Move hashfile out of dist folder | ||
mv dist-linux/hashfile.sha1 hashfile.sha1 | ||
build-windows: | ||
runs-on: windows-2019 | ||
|
||
# Now windows | ||
cd dist | ||
steps: | ||
- name: Install NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
# Find remaining files | ||
find "$PWD" -type f -name "*.dll" -exec sha1sum {} \; > hashfile_2.sha1 | ||
- name: Clone LLHL AGMOD repository | ||
run: | | ||
git clone https://github.com/7mochi/llhl-agmod | ||
# Go back again | ||
cd $GITHUB_WORKSPACE | ||
- name: Clone LLHL repository | ||
run: | | ||
git clone https://github.com/7mochi/llhl | ||
- name: Clone LLHL Resources repository | ||
run: | | ||
git clone https://github.com/7mochi/llhl-resources | ||
# Move hashfile 2 out of dist folder | ||
mv dist/hashfile_2.sha1 hashfile_2.sha1 | ||
- name: Setup MSBuild.exe | ||
uses: microsoft/[email protected] | ||
|
||
# Merge the contents of both files | ||
cat hashfile_2.sha1 >> hashfile.sha1 && rm hashfile_2.sha1 | ||
- name: Build LLHL AGMOD serverfile .dll | ||
run: | | ||
cd llhl-agmod | ||
# Remove useless path from the hashfile | ||
sed -e "s,${PWD}/dist-linux/ag/,,g; s,${PWD}/dist/ag/,,g; s,addons/amxmodx/plugins/,,g" -i hashfile.sha1 | ||
msbuild multiplayer.sln -target:ag /p:Configuration=Release | ||
- name: Replace llhl.amxx on windows with the one from linux | ||
run: | | ||
yes | cp -rf dist-linux/ag/addons/amxmodx/plugins/llhl.amxx dist/ag/addons/amxmodx/plugins/llhl.amxx | ||
- 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: | | ||
wget "https://www.amxmodx.org/latest.php?version=1.9&os=linux&package=base" -O amxx-linux.tar.gz | ||
wget "https://www.amxmodx.org/latest.php?version=1.9&os=windows&package=base" -O amxx-windows.zip | ||
tar -xzf amxx-linux.tar.gz -C dist-linux/ag | ||
unzip amxx-windows.zip -d dist/ag | ||
- name: Prepare releases in zip | ||
run: | | ||
cd dist-linux && zip -r ../llhl-${{github.ref_name}}-linux.zip * && cd $GITHUB_WORKSPACE | ||
cd dist && zip -r ../llhl-${{github.ref_name}}-windows.zip * && cd $GITHUB_WORKSPACE | ||
- name: Upload all assets (Release) | ||
- 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 -Force -Path amxx.zip -DestinationPath llhl/dist/ag | ||
- name: Replace hamdata.ini with our custom one | ||
run: | | ||
Copy-Item llhl/assets/addons/amxmodx/configs/hamdata.ini llhl/dist/ag/addons/amxmodx/configs/hamdata.ini -Force | ||
- name: Create folder and copy LLHL AGMOD .dll | ||
run: | | ||
mkdir -p llhl/dist/ag/dlls | ||
Copy-Item llhl-agmod/dlls/msvc/Release/ag.dll llhl/dist/ag/dlls/ag.dll | ||
Copy-Item llhl-agmod/network/delta.lst llhl/dist/ag/delta.lst | ||
- name: Create folder for full release | ||
run: | | ||
mkdir -p llhl/dist-full | ||
Copy-Item -Path llhl/dist/* -Destination llhl/dist-full -Recurse | ||
- name: Copy LLHL resources to LLHL folder | ||
run: | | ||
xcopy llhl-resources\maps-ag-official\* llhl\dist-full\ag /E /Y /I | ||
xcopy llhl-resources\maps-ehll-unofficial\* llhl\dist-full\ag /E /Y /I | ||
xcopy llhl-resources\maps-valve-official\* llhl\dist-full\ag /E /Y /I | ||
- name: Prepare releases in zip | ||
run: | | ||
cd llhl/dist && Compress-Archive -Path * -DestinationPath ../llhl-${{github.ref_name}}-windows.zip | ||
- name: Upload artifact (Lite version) | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: llhl-${{github.ref_name}}-windows-lite | ||
path: llhl/dist | ||
|
||
- name: Upload artifact (Full version) | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: llhl-${{github.ref_name}}-windows-full | ||
path: llhl/dist-full | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: [build-linux, build-windows] | ||
steps: | ||
- name: Download Linux artifact (Lite version) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: llhl-${{github.ref_name}}-linux-lite | ||
|
||
- name: Download Linux artifact (Full version) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: llhl-${{github.ref_name}}-linux-full | ||
|
||
- name: Download Windows artifact (Lite version) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: llhl-${{github.ref_name}}-windows-lite | ||
|
||
- name: Download Windows artifact (Full version) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: llhl-${{github.ref_name}}-windows-full | ||
|
||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
./llhl-${{github.ref_name}}-linux.zip | ||
./llhl-${{github.ref_name}}-windows.zip | ||
./dist-linux/ag/addons/amxmodx/plugins/llhl.amxx | ||
./hashfile.sha1 | ||
llhl-${{github.ref_name}}-linux-lite.zip | ||
llhl-${{github.ref_name}}-linux-full.zip | ||
llhl-${{github.ref_name}}-windows-lite.zip | ||
llhl-${{github.ref_name}}-windows-full.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Oops, something went wrong.