forked from TrinityCore/TrinityCore
-
Notifications
You must be signed in to change notification settings - Fork 135
419 lines (382 loc) · 16 KB
/
Copy pathmerge.yml
File metadata and controls
419 lines (382 loc) · 16 KB
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
name: merge
on:
push:
schedule:
- cron: '0 0 * * *'
permissions:
contents: write
actions: write
jobs:
_master:
strategy:
fail-fast: false
matrix:
branch: [master, dressnpcs_master, gomove_master, multivendor_master, objscale_master, playeritemgossip_master]
pch: [ON, OFF]
include:
- branch: objscale_master
world:
- src/server/scripts/Custom/objscale/sql/2016_11_10_00_world_objscale.sql
- branch: multivendor_master
world:
- src/server/scripts/Custom/Multivendor/MultivendorExample.sql
- branch: dressnpcs_master
world:
- src/server/scripts/Custom/DressNPCs/sql/world.sql
- src/server/scripts/Custom/DressNPCs/Example.sql
# - src/server/scripts/Custom/DressNPCs/CopyPlayer.sql
hotfix:
- src/server/scripts/Custom/DressNPCs/sql/hotfixes.sql
env:
BRANCH: ${{ matrix.branch }}
PCH: ${{ matrix.pch }}
SQL_WORLD: ${{ join( matrix.world, ' ' ) }}
SQL_CHAR: ${{ join( matrix.char, ' ' ) }}
SQL_AUTH: ${{ join( matrix.auth, ' ' ) }}
SQL_HOTFIX: ${{ join( matrix.hotfix, ' ' ) }}
CCACHE_MAXSIZE: 200M
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_SLOPPINESS: time_macros,pch_defs,include_file_mtime,include_file_ctime
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_BASEDIR: ${{ github.workspace }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
ref: ${{ matrix.branch }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check upstream
id: upstream
run: |
git remote add Trinity https://github.com/TrinityCore/TrinityCore.git || git remote set-url Trinity https://github.com/TrinityCore/TrinityCore.git
git fetch Trinity master
if git merge-base --is-ancestor Trinity/master HEAD; then
echo "merge_needed=false" >> "$GITHUB_OUTPUT"
echo "Already up to date with TrinityCore master, skipping merge and build"
else
echo "merge_needed=true" >> "$GITHUB_OUTPUT"
fi
- name: Configure user
if: steps.upstream.outputs.merge_needed == 'true'
run: |
git config user.email "rochet2@post.com" && git config user.name "Rochet2"
- name: Merge TC
if: steps.upstream.outputs.merge_needed == 'true'
run: |
git merge -m "Merge TrinityCore master to ${BRANCH} [skip ci]" Trinity/master
git submodule update --init --recursive
git status
- name: Dependencies
if: steps.upstream.outputs.merge_needed == 'true'
run: |
sudo apt-get update && sudo apt-get install -yq ccache clang-17 \
libboost-dev libboost-filesystem-dev libboost-locale-dev \
libboost-program-options-dev libboost-regex-dev libboost-thread-dev \
libssl-dev libreadline-dev zlib1g-dev libbz2-dev
- name: Restore ccache
if: steps.upstream.outputs.merge_needed == 'true'
uses: actions/cache/restore@v5
with:
path: .ccache
key: ccache-master-${{ matrix.branch }}-${{ matrix.pch }}
restore-keys: |
ccache-master-master-${{ matrix.pch }}
- name: Init ccache directory
if: steps.upstream.outputs.merge_needed == 'true'
run: mkdir -p .ccache
- name: Setup
if: steps.upstream.outputs.merge_needed == 'true'
env:
CC: /usr/bin/clang-17
CXX: /usr/bin/clang++-17
run: |
mkdir bin
cd bin
cmake ../ -DWITH_WARNINGS=1 -DWITH_WARNINGS_AS_ERRORS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=$PCH -DUSE_SCRIPTPCH=$PCH -DTOOLS=1 -DSCRIPTS=dynamic -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_INSTALL_PREFIX=check_install -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cd ..
- name: Build
if: steps.upstream.outputs.merge_needed == 'true'
run: |
ccache -z
cd bin
make -j 4 -k && make install
- name: ccache stats
if: always() && steps.upstream.outputs.merge_needed == 'true'
run: ccache -s
- name: Check ccache has data
id: ccache_has_data
if: success() && steps.upstream.outputs.merge_needed == 'true'
run: |
if find .ccache -type f -print -quit 2>/dev/null | grep -q .; then
echo "has_data=true" >> "$GITHUB_OUTPUT"
else
echo "has_data=false" >> "$GITHUB_OUTPUT"
echo "No ccache objects produced, skipping cache save"
fi
- name: Delete previous ccache entry
if: success() && steps.upstream.outputs.merge_needed == 'true' && steps.ccache_has_data.outputs.has_data == 'true'
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh cache delete "ccache-master-${{ matrix.branch }}-${{ matrix.pch }}" --repo "${{ github.repository }}" || true
- name: Save ccache
if: success() && steps.upstream.outputs.merge_needed == 'true' && steps.ccache_has_data.outputs.has_data == 'true'
uses: actions/cache/save@v5
with:
path: .ccache
key: ccache-master-${{ matrix.branch }}-${{ matrix.pch }}
- name: Check executables
if: steps.upstream.outputs.merge_needed == 'true'
run: |
cd bin/check_install/bin
./bnetserver --version
./worldserver --version
- name: Find latest DB release tag
if: steps.upstream.outputs.merge_needed == 'true'
id: find_matching_tags
uses: Rochet2/find-matching-tags-ghapi@v2
with:
regex: ^TDB\d{4,}\.\d+$
sort: desc
owner: TrinityCore
repo: TrinityCore
per_page: 100
- name: Download latest DB
if: steps.upstream.outputs.merge_needed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MATCHED_COUNT: ${{ steps.find_matching_tags.outputs.count }}
run: |
if [ "${MATCHED_COUNT}" -eq 0 ]; then
echo "::error::No TDB release tag matched the regex"
exit 1
fi
TAG='${{ fromJson(steps.find_matching_tags.outputs.tags)[0] }}'
gh release download "$TAG" --repo TrinityCore/TrinityCore --pattern 'TDB_full*.7z' --dir bin/check_install/bin
- name: Set configs
if: steps.upstream.outputs.merge_needed == 'true'
run: |
cd bin/check_install/etc
sed "s/127.0.0.1;3306;trinity;trinity;/localhost;3306;root;;/g" worldserver.conf.dist > worldserver.conf
- name: Build DB
if: steps.upstream.outputs.merge_needed == 'true'
run: |
echo "start mysql"
sudo systemctl start mysql.service
echo "remove user password"
mysql -uroot -proot -e 'SET PASSWORD FOR root@localhost="";'
echo "create databases"
mysql -uroot -e 'create database test_mysql;'
cd bin/check_install/bin
7z x ./*.7z
yes | ./worldserver --update-databases-only
- name: Run SQLs
if: steps.upstream.outputs.merge_needed == 'true' && matrix.pch == 'ON'
run: |
for f in $SQL_WORLD; do echo "$f"; cat "$f" | mysql -uroot world; done
for f in $SQL_CHAR; do echo "$f"; cat "$f" | mysql -uroot characters; done
for f in $SQL_AUTH; do echo "$f"; cat "$f" | mysql -uroot auth; done
for f in $SQL_HOTFIX; do echo "$f"; cat "$f" | mysql -uroot hotfixes; done
- name: Push changes
if: steps.upstream.outputs.merge_needed == 'true' && matrix.pch == 'ON'
run: |
git push
_3-3-5:
strategy:
fail-fast: false
matrix:
branch: [3.3.5, transmog_3.3.5, transmog_legion_3.3.5, transmogvendor_3.3.5, reforging_3.3.5, multivendor_3.3.5, multitrainer_3.3.5, playeritemgossip_3.3.5, dressnpcs_3.3.5, objscale_3.3.5, gomove_3.3.5]
pch: [ON, OFF]
include:
- branch: transmog_3.3.5
world:
- src/server/scripts/Custom/Transmog/sql/world_NPC.sql
- branch: transmogvendor_3.3.5
world:
- src/server/scripts/Custom/TransmogDisplayVendor/sql/world_NPC.sql
- branch: transmog_legion_3.3.5
world:
- src/server/scripts/Custom/Transmog/sql/world_NPC.sql
# - src/server/scripts/Custom/Transmog/sql/completed_quest_items_to_transmog_collection.sql
- branch: reforging_3.3.5
world:
- src/server/scripts/Custom/Reforging/sql/world_npc.sql
- branch: multivendor_3.3.5
world:
- src/server/scripts/Custom/Multivendor/MultivendorExample.sql
- branch: multitrainer_3.3.5
world:
- src/server/scripts/Custom/multitrainer/MultitrainerExample.sql
- branch: dressnpcs_3.3.5
world:
- src/server/scripts/Custom/DressNPCs/Example.sql
env:
BRANCH: ${{ matrix.branch }}
PCH: ${{ matrix.pch }}
SQL_WORLD: ${{ join( matrix.world, ' ' ) }}
SQL_CHAR: ${{ join( matrix.char, ' ' ) }}
SQL_AUTH: ${{ join( matrix.auth, ' ' ) }}
CCACHE_MAXSIZE: 200M
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_SLOPPINESS: time_macros,pch_defs,include_file_mtime,include_file_ctime
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_BASEDIR: ${{ github.workspace }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
with:
ref: ${{ matrix.branch }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check upstream
id: upstream
run: |
git remote add Trinity https://github.com/TrinityCore/TrinityCore.git || git remote set-url Trinity https://github.com/TrinityCore/TrinityCore.git
git fetch Trinity 3.3.5
if git merge-base --is-ancestor Trinity/3.3.5 HEAD; then
echo "merge_needed=false" >> "$GITHUB_OUTPUT"
echo "Already up to date with TrinityCore 3.3.5, skipping merge and build"
else
echo "merge_needed=true" >> "$GITHUB_OUTPUT"
fi
- name: Configure user
if: steps.upstream.outputs.merge_needed == 'true'
run: |
git config user.email "rochet2@post.com" && git config user.name "Rochet2"
- name: Merge TC
if: steps.upstream.outputs.merge_needed == 'true'
run: |
git merge -m "Merge TrinityCore 3.3.5 to ${BRANCH} [skip ci]" Trinity/3.3.5
git submodule update --init --recursive
git status
- name: Dependencies
if: steps.upstream.outputs.merge_needed == 'true'
run: |
sudo apt-get update && sudo apt-get install -yq libboost-all-dev g++-11 ccache
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11
- name: Restore ccache
if: steps.upstream.outputs.merge_needed == 'true'
uses: actions/cache/restore@v5
with:
path: .ccache
key: ccache-335-${{ matrix.branch }}-${{ matrix.pch }}
restore-keys: |
ccache-335-3.3.5-${{ matrix.pch }}
- name: Init ccache directory
if: steps.upstream.outputs.merge_needed == 'true'
run: mkdir -p .ccache
- name: Setup
if: steps.upstream.outputs.merge_needed == 'true'
run: |
mkdir bin
cd bin
cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=$PCH -DUSE_SCRIPTPCH=$PCH -DTOOLS=1 -DSCRIPTS=dynamic -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_INSTALL_PREFIX=check_install -DBUILD_TESTING=1 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cd ..
- name: Build
if: steps.upstream.outputs.merge_needed == 'true'
run: |
ccache -z
cd bin
make -j 4 -k && make install
- name: ccache stats
if: always() && steps.upstream.outputs.merge_needed == 'true'
run: ccache -s
- name: Check ccache has data
id: ccache_has_data
if: success() && steps.upstream.outputs.merge_needed == 'true'
run: |
if find .ccache -type f -print -quit 2>/dev/null | grep -q .; then
echo "has_data=true" >> "$GITHUB_OUTPUT"
else
echo "has_data=false" >> "$GITHUB_OUTPUT"
echo "No ccache objects produced, skipping cache save"
fi
- name: Delete previous ccache entry
if: success() && steps.upstream.outputs.merge_needed == 'true' && steps.ccache_has_data.outputs.has_data == 'true'
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh cache delete "ccache-335-${{ matrix.branch }}-${{ matrix.pch }}" --repo "${{ github.repository }}" || true
- name: Save ccache
if: success() && steps.upstream.outputs.merge_needed == 'true' && steps.ccache_has_data.outputs.has_data == 'true'
uses: actions/cache/save@v5
with:
path: .ccache
key: ccache-335-${{ matrix.branch }}-${{ matrix.pch }}
- name: Unit tests
if: steps.upstream.outputs.merge_needed == 'true'
run: |
cd bin
make test
- name: Check executables
if: steps.upstream.outputs.merge_needed == 'true'
run: |
cd bin/check_install/bin
./authserver --version
./worldserver --version
- name: Find latest DB release tag
if: steps.upstream.outputs.merge_needed == 'true'
id: find_matching_tags
uses: Rochet2/find-matching-tags-ghapi@v2
with:
regex: ^TDB335\.\d{5,}$
sort: desc
owner: TrinityCore
repo: TrinityCore
per_page: 100
- name: Download latest DB
if: steps.upstream.outputs.merge_needed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MATCHED_COUNT: ${{ steps.find_matching_tags.outputs.count }}
MATCHED_TAGS: ${{ steps.find_matching_tags.outputs.tags }}
run: |
echo "Matched ${MATCHED_COUNT} tag(s): ${MATCHED_TAGS}"
if [ "${MATCHED_COUNT}" -eq 0 ]; then
echo "::error::No TDB release tag matched the regex"
exit 1
fi
TAG='${{ fromJson(steps.find_matching_tags.outputs.tags)[0] }}'
gh release download "$TAG" --repo TrinityCore/TrinityCore --pattern 'TDB_full*.7z' --dir bin/check_install/bin
- name: Print downloaded files
if: steps.upstream.outputs.merge_needed == 'true'
run: |
ls -lah bin/check_install/bin
- name: Set configs
if: steps.upstream.outputs.merge_needed == 'true'
run: |
cd bin/check_install/etc
sed "s/127.0.0.1;3306;trinity;trinity;/localhost;3306;root;;/g" worldserver.conf.dist > worldserver.conf
- name: Build DB
if: steps.upstream.outputs.merge_needed == 'true'
run: |
echo "start mysql"
sudo systemctl start mysql.service
echo "remove user password"
mysql -uroot -proot -e 'SET PASSWORD FOR root@localhost="";'
echo "create databases"
mysql -uroot -e 'create database test_mysql;'
cd bin/check_install/bin
7z x ./*.7z
yes | ./worldserver --update-databases-only
- name: Run SQLs
if: steps.upstream.outputs.merge_needed == 'true' && matrix.pch == 'ON'
run: |
for f in $SQL_WORLD; do echo "$f"; cat "$f" | mysql -uroot world; done
for f in $SQL_CHAR; do echo "$f"; cat "$f" | mysql -uroot characters; done
for f in $SQL_AUTH; do echo "$f"; cat "$f" | mysql -uroot auth; done
- name: Run External SQLs
if: steps.upstream.outputs.merge_needed == 'true' && matrix.pch == 'ON' && matrix.branch == '3.3.5'
run: |
echo 'Trinity_Jukebox' ; curl -sSf https://rochet2.github.io/downloads/Trinity_Jukebox.sql | mysql -uroot world
echo 'Trinity_Portal_Master' ; curl -sSf https://rochet2.github.io/downloads/Trinity_Portal_Master.sql | mysql -uroot world
echo 'Trinity_Portal_Master_Option' ; curl -sSf https://rochet2.github.io/downloads/Trinity_Portal_Master_Option.sql | mysql -uroot world
- name: Push changes
if: steps.upstream.outputs.merge_needed == 'true' && matrix.pch == 'ON'
run: |
git push