1
+ name : Branch Build
2
+
3
+ on :
4
+ push :
5
+ branches-ignore :
6
+ - master
7
+ - beta
8
+
9
+ jobs :
10
+ build :
11
+ runs-on : ubuntu-latest
12
+ strategy :
13
+ fail-fast : false
14
+ matrix :
15
+ SM_VERSION : ["1.10"]
16
+
17
+ steps :
18
+ - uses : actions/checkout@v2
19
+
20
+ - name : Set environment variables
21
+ env :
22
+ ACTIONS_ALLOW_UNSECURE_COMMANDS : true
23
+ run : |
24
+ git fetch --unshallow
25
+ VERSION=$(git rev-list --count HEAD)
26
+ SHORT=$(git describe --always --long --dirty)
27
+ SOURCEMOD_PATH=$GITHUB_WORKSPACE/addons/sourcemod
28
+ CONFIG_PATH=$GITHUB_WORKSPACE/cfg
29
+ echo ::set-env name=GIT_COMMIT::$VERSION
30
+ echo ::set-env name=PLUGIN_VERSION::${{ matrix.SM_VERSION }}.$VERSION.$SHORT
31
+ echo ::set-env name=WORKSPACE::$GITHUB_WORKSPACE
32
+ echo ::set-env name=CONFIG_PATH::$CONFIG_PATH
33
+ echo ::set-env name=SOURCEMOD_PATH::$SOURCEMOD_PATH
34
+ echo ::set-env name=SCRIPTS_PATH::$SOURCEMOD_PATH/scripting
35
+ echo ::set-env name=PLUGINS_PATH::$SOURCEMOD_PATH/plugins
36
+
37
+ - name : Get latest version of SteamWorks Windows+Linux
38
+ run : |
39
+ wget -q -O tmp.zip http://users.alliedmods.net/~kyles/builds/SteamWorks/SteamWorks-git132-windows.zip && unzip -o tmp.zip 'addons/*' -d ../../ && rm tmp.zip
40
+ 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 && rm tmp.tar.gz
41
+ working-directory : ${{ env.SOURCEMOD_PATH }}/
42
+
43
+ # TF2 Comp Fixes: https://github.com/ldesgoui/tf2-comp-fixes
44
+ # Dhooks2 wget link needs to be updated every time DHooks2 receives an update as their download URL(detour*-sm110) changes on each release
45
+ # Removed updating to latest tf2-comp-fixes due to issues with windows servers
46
+ # 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
47
+ - name : Get latest version of TF2 Comp Fixes and its DHooks dependency
48
+ run : |
49
+ wget -q -O tmp.zip https://github.com/ldesgoui/tf2-comp-fixes/releases/download/v1.16.12/tf2-comp-fixes.zip && unzip -o tmp.zip -d ../../ && rm tmp.zip
50
+ 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
51
+
52
+ working-directory : ${{ env.SOURCEMOD_PATH }}/
53
+
54
+ # SrcTV+: https://github.com/dalegaard/srctvplus
55
+ - name : Get latest version of SrcTV+
56
+ run : |
57
+ wget -q -O addons/srctvplus.dll https://github.com/dalegaard/srctvplus/releases/latest/download/srctvplus.dll
58
+ wget -q -O addons/srctvplus.so https://github.com/dalegaard/srctvplus/releases/latest/download/srctvplus.so
59
+ wget -q -O addons/srctvplus.vdf https://github.com/dalegaard/srctvplus/releases/latest/download/srctvplus.vdf
60
+ working-directory : ${{ env.WORKSPACE }}/
61
+
62
+ # TF2 Halftime: https://github.com/stephanieLGBT/tf2-halftime
63
+ - name : Get latest version of TF2 Halftime
64
+ run : |
65
+ wget -q -O scripting/include/morecolors.inc https://raw.githubusercontent.com/stephanieLGBT/tf2-halftime/master/scripting/include/morecolors.inc
66
+ wget -q -O scripting/tf2Halftime.sp https://raw.githubusercontent.com/stephanieLGBT/tf2-halftime/master/scripting/tf2Halftime.sp
67
+ working-directory : ${{ env.SOURCEMOD_PATH }}/
68
+
69
+ # Color Literals: https://github.com/JoinedSenses/SourceMod-IncludeLibrary/blob/master/include/color_literals.inc
70
+ - name : Get latest version of Color Literals
71
+ run : |
72
+ wget -q -O scripting/include/color_literals.inc https://raw.githubusercontent.com/JoinedSenses/SourceMod-IncludeLibrary/master/include/color_literals.inc
73
+ working-directory : ${{ env.SOURCEMOD_PATH }}/
74
+
75
+ - name : Get latest whitelists for each format
76
+ run : |
77
+ wget -q -O rgl_whitelist_6s.txt https://whitelist.tf/rgl_6v6.txt
78
+ wget -q -O rgl_whitelist_HL.txt https://whitelist.tf/rgl_9v9.txt
79
+ wget -q -O rgl_whitelist_mm.txt https://whitelist.tf/rgl_nr6s.txt
80
+ wget -q -O rgl_whitelist_7s.txt https://whitelist.tf/rgl_7v7.txt
81
+ wget -q -O rgl_whitelist_pt.txt https://whitelist.tf/rgl_passtime.txt
82
+ wget -q -O rgl_whitelist_ud.txt https://whitelist.tf/rgl_ultiduo.txt
83
+ wget -q -O rgl_whitelist_6s_cups.txt https://whitelist.tf/custom_whitelist_14183.txt
84
+ working-directory : ${{ env.CONFIG_PATH }}/
85
+
86
+ - name : Validate whitelists for each format
87
+ run : |
88
+ sixes_lines=$(wc -l < rgl_whitelist_6s.txt)
89
+ hl_lines=$(wc -l < rgl_whitelist_HL.txt)
90
+ mm_lines=$(wc -l < rgl_whitelist_mm.txt)
91
+ pl_lines=$(wc -l < rgl_whitelist_7s.txt)
92
+ sixes_lines=$(wc -l < rgl_whitelist_6s.txt)
93
+ passtime_lines=$(wc -l < rgl_whitelist_pt.txt)
94
+ ultiduo_lines=$(wc -l < rgl_whitelist_ud.txt)
95
+ if [[ $sixes_lines -le 50 ]];
96
+ then
97
+ echo "Sixes: Number of lines is less than 50."
98
+ exit 1
99
+ elif [[ $hl_lines -le 50 ]]
100
+ then
101
+ echo "HL: Number of lines is less than 50."
102
+ exit 1
103
+ elif [[ $mm_lines -le 50 ]]
104
+ then
105
+ echo "MM: Number of lines is less than 50."
106
+ exit 1
107
+ elif [[ $pl_lines -le 50 ]]
108
+ then
109
+ echo "PL: Number of lines is less than 50."
110
+ exit 1
111
+ elif [[ $passtime_lines -le 50 ]]
112
+ then
113
+ echo "PT: Number of lines is less than 50."
114
+ exit 1
115
+ elif [[ $ultiduo_lines -le 50 ]]
116
+ then
117
+ echo "PT: Number of lines is less than 50."
118
+ exit 1
119
+ fi
120
+
121
+ echo "Whitelist Checks Complete"
122
+ working-directory : ${{ env.CONFIG_PATH }}/
123
+
124
+ - name : Setup SourcePawn Compiler ${{ matrix.SM_VERSION }}
125
+ id : setup-sp
126
+ uses : rumblefrog/setup-sp@master
127
+ with :
128
+ version : ${{ matrix.SM_VERSION }}
129
+
130
+ - name : Compile RGL Suite Plugins against SM ${{ steps.setup-sp.outputs.version }}
131
+ run : |
132
+ for plugin in "rglqol" "rglupdater" "config_checker" "tf2Halftime" "improved_match_timer" "disabled/roundtimer_override"
133
+ do
134
+ echo -e "\nCompiling $plugin.sp..."
135
+ spcomp -E -w234 -O2 -v2 -i $SCRIPTS_PATH/include $plugin.sp
136
+ done
137
+ working-directory : ${{ env.SCRIPTS_PATH }}/
138
+
139
+ # Updated Pause Plugin: https://github.com/l-Aad-l/updated-pause-plugin
140
+ - name : Get latest version of Updated Pause Plugin
141
+ run : |
142
+ 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
143
+ working-directory : ${{ env.SOURCEMOD_PATH }}/
144
+
145
+ # Updated Updater: https://git.empiresmod.com/sourcemod/Updater
146
+ - name : Get latest version of Updater
147
+ run : |
148
+ 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
149
+ working-directory : ${{ env.SOURCEMOD_PATH }}/
150
+
151
+ # PASS Time plugins
152
+ - name : Get latest version of PASS Time Plugin
153
+ run : |
154
+ mkdir -p addons/sourcemod/plugins
155
+ wget -q -O $PLUGINS_PATH/p4sstime.smx https://github.com/blakeplusplus/p4sstime/releases/latest/download/p4sstime.smx
156
+ wget -q -O tmp.zip https://github.com/blakeplusplus/p4sstime/archive/refs/heads/main.zip && first_folder=$(unzip -Z1 tmp.zip | awk -F/ '{print $1}' | head -n 1) && unzip -q tmp.zip "$first_folder/*" -d "passtime" && cd passtime/$first_folder && cp -r addons/sourcemod/gamedata ../../addons/sourcemod/ && cd ../../ && rm -rf passtime && rm tmp.zip
157
+ working-directory : ${{ env.SOURCEMOD_PATH }}/
158
+
159
+ - name : Move compiled plugins
160
+ run : |
161
+ rm -rf $PLUGINS_PATH/disabled/
162
+ mkdir -p $PLUGINS_PATH/disabled/
163
+ rsync -av --include='*/' --include="*.smx" --exclude="*" --prune-empty-dirs --remove-source-files $SCRIPTS_PATH/ $PLUGINS_PATH/
164
+ ls
165
+
166
+ - name : Disable optional plugins
167
+ run : |
168
+ mv tf2Halftime.smx disabled/
169
+ mv roundtimer_override.smx disabled/
170
+ mv p4sstime.smx disabled/
171
+ working-directory : ${{ env.PLUGINS_PATH }}/
172
+
173
+ - name : Rebuild updatefile.txt
174
+ run : |
175
+ FILES=$(find ./cfg ./addons -type f \
176
+ | sed "s|^\.||" \
177
+ | sed 's/ / \\ /' \
178
+ | sed 's/^/"/;s/$/"/' \
179
+ | sed '/regex/G' \
180
+ ) \
181
+ ;
182
+
183
+ find . -name "updatefile-template.txt" -type f -exec cp {} ./updatefile.txt \;
184
+
185
+ for FILE in $FILES
186
+ do
187
+ if [[ "$FILE" != *"_custom.cfg"* ]];
188
+ then
189
+ if [[ $FILE == *"scripting"* ]];
190
+ then
191
+ echo $' "Source" ' $FILE
192
+ else
193
+ echo $' "Plugin" ' $FILE
194
+ fi
195
+ fi
196
+
197
+ done >> updatefile.txt
198
+
199
+ echo $' }' >> updatefile.txt
200
+ echo $'}' >> updatefile.txt
201
+ working-directory : ${{ env.WORKSPACE }}/
202
+
203
+ - name : Move folders (addons, cfg) to build
204
+ run : |
205
+ mkdir build
206
+ mv ./{addons,cfg} build/
207
+
208
+ - name : Add updatefile.txt, README.md to build package
209
+ run : |
210
+ mv $GITHUB_WORKSPACE/{updatefile.txt,README.md} .
211
+ working-directory : ./build
212
+
213
+ - name : Upload plugin artifact
214
+ uses : actions/upload-artifact@master
215
+ if : ${{ always() }}
216
+ with :
217
+ name : Plugin.${{ env.PLUGIN_VERSION }}
218
+ path : build/
0 commit comments