Skip to content

Merge branch 'beta' of github.com:RGLgg/server-resources-updater into… #130

Merge branch 'beta' of github.com:RGLgg/server-resources-updater into…

Merge branch 'beta' of github.com:RGLgg/server-resources-updater into… #130

Workflow file for this run

name: Beta Build
on:
push:
branches: [ beta ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
SM_VERSION: ["1.11"]
steps:
- uses: actions/checkout@v4
- name: Set environment variables
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
git fetch --unshallow
VERSION=$(git rev-list --count HEAD)
SHORT=$(git describe --always --long --dirty)
SOURCEMOD_PATH=$GITHUB_WORKSPACE/addons/sourcemod
CONFIG_PATH=$GITHUB_WORKSPACE/cfg
echo ::set-env name=GIT_COMMIT::$VERSION
echo ::set-env name=PLUGIN_VERSION::${{ matrix.SM_VERSION }}.$VERSION.$SHORT
echo ::set-env name=WORKSPACE::$GITHUB_WORKSPACE
echo ::set-env name=CONFIG_PATH::$CONFIG_PATH
echo ::set-env name=SOURCEMOD_PATH::$SOURCEMOD_PATH
echo ::set-env name=SCRIPTS_PATH::$SOURCEMOD_PATH/scripting
echo ::set-env name=PLUGINS_PATH::$SOURCEMOD_PATH/plugins
- name: Get latest version of SteamWorks Windows+Linux
run: |
wget -q -O tmp.zip http://users.alliedmods.net/~kyles/builds/SteamWorks/SteamWorks-git132-windows.zip && unzip -o tmp.zip 'addons/*' -x 'addons/sourcemod/scripting/include/SteamWorks.inc' 'addons/sourcemod/scripting/swag.sp' -d ../../ && rm tmp.zip
wget -q -O tmp.tar.gz http://users.alliedmods.net/~kyles/builds/SteamWorks/SteamWorks-git132-linux.tar.gz && tar -xvzf tmp.tar.gz --strip-components=2 --exclude='addons/sourcemod/scripting/include/SteamWorks.inc' --exclude='addons/sourcemod/scripting/swag.sp' && rm tmp.tar.gz
working-directory: ${{ env.SOURCEMOD_PATH }}/
# TF2 Comp Fixes: https://github.com/ldesgoui/tf2-comp-fixes
# Dhooks2 wget link needs to be updated every time DHooks2 receives an update as their download URL(detour*-sm110) changes on each release
# Removed updating to latest tf2-comp-fixes due to issues with windows servers
# wget -q -O tmp.zip https://github.com/ldesgoui/tf2-comp-fixes/releases/latest/download/tf2-comp-fixes.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
- name: Get latest version of TF2 Comp Fixes and its DHooks dependency
run: |
wget -q -O tmp.zip https://github.com/ldesgoui/tf2-comp-fixes/releases/download/v1.16.16/tf2-comp-fixes.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
# wget -q -O tmp.zip https://github.com/peace-maker/DHooks2/releases/download/v2.2.0-detours17/dhooks-2.2.0-detours17-sm110.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
# Dhooks was bundled with Sourcemod starting SM 1.11 Release
working-directory: ${{ env.SOURCEMOD_PATH }}/
# SrcTV+: https://github.com/dalegaard/srctvplus
- name: Get latest version of SrcTV+
run: |
wget -q -O addons/srctvplus.dll https://github.com/dalegaard/srctvplus/releases/latest/download/srctvplus.dll
wget -q -O addons/srctvplus.so https://github.com/dalegaard/srctvplus/releases/latest/download/srctvplus.so
wget -q -O addons/srctvplus.vdf https://github.com/dalegaard/srctvplus/releases/latest/download/srctvplus.vdf
working-directory: ${{ env.WORKSPACE }}/
# TF2 Halftime: https://github.com/stephanieLGBT/tf2-halftime
- name: Get latest version of TF2 Halftime
run: |
wget -q -O scripting/include/morecolors.inc https://raw.githubusercontent.com/stephanieLGBT/tf2-halftime/master/scripting/include/morecolors.inc
wget -q -O scripting/tf2Halftime.sp https://raw.githubusercontent.com/stephanieLGBT/tf2-halftime/master/scripting/tf2Halftime.sp
working-directory: ${{ env.SOURCEMOD_PATH }}/
# Color Literals: https://github.com/JoinedSenses/SourceMod-IncludeLibrary/blob/master/include/color_literals.inc
- name: Get latest version of Color Literals
run: |
wget -q -O scripting/include/color_literals.inc https://raw.githubusercontent.com/JoinedSenses/SourceMod-IncludeLibrary/master/include/color_literals.inc
working-directory: ${{ env.SOURCEMOD_PATH }}/
- name: Get latest whitelists for each format
run: |
wget -q -O rgl_whitelist_6s.txt https://whitelist.tf/rgl_6v6.txt
wget -q -O rgl_whitelist_HL.txt https://whitelist.tf/rgl_9v9.txt
wget -q -O rgl_whitelist_mm.txt https://whitelist.tf/rgl_nr6s.txt
wget -q -O rgl_whitelist_7s.txt https://whitelist.tf/rgl_7v7.txt
wget -q -O rgl_whitelist_pt.txt https://whitelist.tf/rgl_passtime.txt
wget -q -O rgl_whitelist_ud.txt https://whitelist.tf/rgl_ultiduo.txt
wget -q -O rgl_whitelist_6s_cups.txt https://whitelist.tf/custom_whitelist_14183.txt
working-directory: ${{ env.CONFIG_PATH }}/
- name: Validate whitelists for each format
run: |
sixes_lines=$(wc -l < rgl_whitelist_6s.txt)
hl_lines=$(wc -l < rgl_whitelist_HL.txt)
mm_lines=$(wc -l < rgl_whitelist_mm.txt)
pl_lines=$(wc -l < rgl_whitelist_7s.txt)
sixes_lines=$(wc -l < rgl_whitelist_6s.txt)
passtime_lines=$(wc -l < rgl_whitelist_pt.txt)
ultiduo_lines=$(wc -l < rgl_whitelist_ud.txt)
if [[ $sixes_lines -le 50 ]];
then
echo "Sixes: Number of lines is less than 50."
exit 1
elif [[ $hl_lines -le 50 ]]
then
echo "HL: Number of lines is less than 50."
exit 1
elif [[ $mm_lines -le 50 ]]
then
echo "MM: Number of lines is less than 50."
exit 1
elif [[ $pl_lines -le 50 ]]
then
echo "PL: Number of lines is less than 50."
exit 1
elif [[ $passtime_lines -le 50 ]]
then
echo "PT: Number of lines is less than 50."
exit 1
elif [[ $ultiduo_lines -le 50 ]]
then
echo "PT: Number of lines is less than 50."
exit 1
fi
echo "Whitelist Checks Complete"
working-directory: ${{ env.CONFIG_PATH }}/
- name: Setup SourcePawn Compiler ${{ matrix.SM_VERSION }}
id: setup-sp
uses: rumblefrog/setup-sp@master
with:
version: ${{ matrix.SM_VERSION }}
- name: Compile RGL Suite Plugins against SM ${{ steps.setup-sp.outputs.version }}
run: |
for plugin in "rglqol" "rglupdater" "updater" "config_checker" "tf2Halftime" "improved_match_timer" "disabled/roundtimer_override"
do
echo -e "\nCompiling $plugin.sp..."
spcomp -E -w234 -O2 -v2 -i $SCRIPTS_PATH/include $plugin.sp
done
working-directory: ${{ env.SCRIPTS_PATH }}/
# Updated Pause Plugin: https://github.com/l-Aad-l/updated-pause-plugin
- name: Get latest version of Updated Pause Plugin
run: |
wget -q -O tmp.zip https://github.com/l-Aad-l/updated-pause-plugin/releases/latest/download/updated-pause-plugin.zip && unzip -o tmp.zip 'addons/*' -d ../../ && rm tmp.zip
working-directory: ${{ env.SOURCEMOD_PATH }}/
# Updated Updater: https://git.empiresmod.com/sourcemod/Updater
# - name: Get latest version of Updater
# run: |
# wget -q -O tmp.zip https://git.empiresmod.com/sourcemod/Updater/-/jobs/artifacts/master/download?job=build && unzip -o tmp.zip 'addons/*' -d ../../ && rm tmp.zip
# working-directory: ${{ env.SOURCEMOD_PATH }}/
# PASS Time plugins
- name: Get latest version of PASS Time Plugin
run: |
mkdir -p addons/sourcemod/plugins
wget -q -O ../../addons/sourcemod/plugins/p4sstime.smx https://github.com/p4sstime/p4sstime-plugin/releases/latest/download/p4sstime.smx
working-directory: ${{ env.SOURCEMOD_PATH }}/
- name: Move compiled plugins
run: |
rm -rf $PLUGINS_PATH/disabled/
mkdir -p $PLUGINS_PATH/disabled/
rsync -av --include='*/' --include="*.smx" --exclude="*" --prune-empty-dirs --remove-source-files $SCRIPTS_PATH/ $PLUGINS_PATH/
- name: Disable optional plugins
run: |
mv tf2Halftime.smx disabled/
mv roundtimer_override.smx disabled/
mv p4sstime.smx disabled/
working-directory: ${{ env.PLUGINS_PATH }}/
- name: Rebuild updatefile.txt
run: |
FILES=$(find ./cfg ./addons -type f \
| sed "s|^\.||" \
| sed 's/ / \\ /' \
| sed 's/^/"/;s/$/"/' \
| sed '/regex/G' \
) \
;
find . -name "updatefile-template.txt" -type f -exec cp {} ./updatefile.txt \;
for FILE in $FILES
do
if [[ "$FILE" != *"_custom.cfg"* ]];
then
if [[ $FILE == *"scripting"* ]];
then
echo $' "Source" ' $FILE
else
echo $' "Plugin" ' $FILE
fi
fi
done >> updatefile.txt
echo $' }' >> updatefile.txt
echo $'}' >> updatefile.txt
working-directory: ${{ env.WORKSPACE }}/
- name: Move folders (addons, cfg) to build
run: |
mkdir build
mv ./{addons,cfg} build/
- name: Add updatefile.txt, README.md to build package
run: |
mv $GITHUB_WORKSPACE/{updatefile.txt,README.md} .
working-directory: ./build
- name: Upload plugin artifact
uses: actions/upload-artifact@master
with:
name: Plugin.${{ env.PLUGIN_VERSION }}
path: build/
- name: Update updater branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: updater-beta
publish_dir: build/