chore: always cd into llhl folder in each step #41
Workflow file for this run
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: LLHL - New version release | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: centos:centos7 | |
env: | |
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | |
steps: | |
- name: Setting up 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: Install git | |
run: | | |
yum install -y git | |
- name: Checkout LLHL AGMOD repository | |
run: | | |
git clone https://github.com/7mochi/llhl-agmod | |
- name: Checkout LLHL repository | |
run: | | |
git clone https://github.com/7mochi/llhl | |
cd llhl && git checkout 3.0-stable && cd $GITHUB_WORKSPACE | |
- name: Install Node.js (v12) | |
run: | | |
curl -sL https://rpm.nodesource.com/setup_12.x | bash - | |
yum install -y nodejs | |
- name: Build LLHL AGMOD serverfile .so | |
run: | | |
yum install -y make wget unzip tar gcc gcc-c++ glibc-devel.i686 libstdc++-devel.i686 | |
mkdir ag-llhl-linux && cd llhl-agmod | |
CPATH=$CPATH:/usr/include/c++/4.8.5/i686-redhat-linux CFG=$CONFIGURATION make -C dlls | |
cd $GITHUB_WORKSPACE | |
cp -i llhl-agmod/dlls/ag_i386.so ag-llhl-linux/ag.so | |
cp -i llhl-agmod/network/delta.lst ag-llhl-linux | |
- name: Install NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 12 | |
- name: Install dependencies for Linux | |
run: | | |
cd llhl | |
make init-linux | |
- name: Build LLHL proyect (Linux) with node-amxxpack | |
run: | | |
ls | |
cd llhl | |
make build-linux | |
- name: Rename dist folder | |
run: | | |
ls | |
cd llhl | |
mv dist dist-linux | |
- name: Install dependencies for Windows | |
run: | | |
cd llhl | |
make init-windows | |
- name: Build LLHL proyect (Windows) with node-amxxpack | |
run: | | |
cd llhl | |
make build-windows | |
- name: Generate hashfile.sha1 | |
run: | | |
cd llhl | |
# First linux | |
cd dist-linux | |
# 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 | |
# Go back to root folder | |
cd $GITHUB_WORKSPACE | |
# Move hashfile out of dist folder | |
mv llhl/dist-linux/hashfile.sha1 llhl/hashfile.sha1 | |
# Now windows | |
cd dist | |
# Find remaining files | |
find "$PWD" -type f -name "*.dll" -exec sha1sum {} \; > hashfile_2.sha1 | |
# Go back again | |
cd $GITHUB_WORKSPACE | |
# Move hashfile 2 out of dist folder | |
mv llhl/dist/hashfile_2.sha1 llhl/hashfile_2.sha1 | |
# Merge the contents of both files | |
cat llhl/hashfile_2.sha1 >> llhl/hashfile.sha1 && rm llhl/hashfile_2.sha1 | |
# Remove useless path from the hashfile | |
sed -e "s,${PWD}/llhl/dist-linux/ag/,,g; s,${PWD}/llhl/dist/ag/,,g; s,addons/amxmodx/plugins/,,g" -i hashfile.sha1 | |
- name: Replace llhl.amxx on windows with the one from linux | |
run: | | |
yes | cp -rf llhl/dist-linux/ag/addons/amxmodx/plugins/llhl.amxx llhl/dist/ag/addons/amxmodx/plugins/llhl.amxx | |
- 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 llhl/dist-linux/ag | |
unzip amxx-windows.zip -d llhl/dist/ag | |
- name: Create folder and move LLHL AGMOD .so | |
run: | | |
ls | |
mkdir llhl/dist-linux/ag/dlls | |
mv ag-llhl-linux/ag.so llhl/dist-linux/ag/ag.so | |
- name: Prepare releases in zip | |
run: | | |
cd llhl/dist-linux && zip -r ../llhl-${{github.ref_name}}-linux.zip * && cd $GITHUB_WORKSPACE | |
cd llhl/dist && zip -r ../llhl-${{github.ref_name}}-windows.zip * && cd $GITHUB_WORKSPACE |