chore: bump version to 2.1-stable #23
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: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies for Linux | |
run: | | |
make init-linux | |
- name: Build LLHL proyect (Linux) with node-amxxpack | |
run: | | |
make build-linux | |
- name: Rename dist folder | |
run: | | |
mv dist dist-linux | |
- name: Install dependencies for Windows | |
run: | | |
make init-windows | |
- name: Build LLHL proyect (Windows) with node-amxxpack | |
run: | | |
make build-windows | |
- name: Generate hashfile.sha1 | |
run: | | |
# 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 dist-linux/hashfile.sha1 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 dist/hashfile_2.sha1 hashfile_2.sha1 | |
# Merge the contents of both files | |
cat hashfile_2.sha1 >> hashfile.sha1 && rm hashfile_2.sha1 | |
# 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 | |
- 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: 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) | |
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 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |