forked from RGLgg/server-resources-updater
-
Notifications
You must be signed in to change notification settings - Fork 0
221 lines (192 loc) · 9.76 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
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@v2
- 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/prplnorangesoda/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@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: updater-beta
publish_dir: build/