forked from TrinityCore/TrinityCore
-
Notifications
You must be signed in to change notification settings - Fork 141
264 lines (246 loc) · 9.54 KB
/
merge.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
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
name: merge
on:
push:
schedule:
- cron: '0 0 * * *'
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, ' ' ) }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
fetch-depth: 0
token: ${{ secrets.WORKFLOW_TOKEN }}
- name: Configure user
run: |
git config user.email "[email protected]" && git config user.name "Rochet2"
- name: Merge TC
run: |
git status
git remote add Trinity https://github.com/TrinityCore/TrinityCore.git
git fetch Trinity master
git merge -m "Merge TrinityCore master to ${BRANCH} [skip ci]" Trinity/master
git submodule update --init --recursive
git status
- name: Dependencies
run: |
sudo apt-get update && sudo apt-get install -yq libboost-all-dev clang-15
- name: Setup
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 -DCMAKE_C_COMPILER=clang-15 -DCMAKE_CXX_COMPILER=clang++-15
cd ..
- name: Build
run: |
cd bin
make -j 4 -k && make install
- name: Check executables
run: |
cd bin/check_install/bin
./bnetserver --version
./worldserver --version
- name: Find latest DB release tag
id: find_matching_tags
uses: Rochet2/[email protected]
with:
regex: ^TDB\d{4,}\.\d+$
sort: desc
owner: TrinityCore
repo: TrinityCore
per_page: 100
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download latest DB
uses: i3h/download-release-asset@a987f9dc3559bd1024d7ed353b59c9d0bbb8ab61
with:
owner: TrinityCore
repo: TrinityCore
tag: ${{ fromJson(steps.find_matching_tags.outputs.tags)[0] }}
file: /TDB_full.*\.7z/
path: bin/check_install/bin
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set configs
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
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: 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: 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, ' ' ) }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
fetch-depth: 0
token: ${{ secrets.WORKFLOW_TOKEN }}
- name: Configure user
run: |
git config user.email "[email protected]" && git config user.name "Rochet2"
- name: Merge TC
run: |
git status
git remote add Trinity https://github.com/TrinityCore/TrinityCore.git
git fetch Trinity 3.3.5
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
run: |
sudo apt-get update && sudo apt-get install -yq libboost-all-dev g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11
- name: Setup
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
cd ..
- name: Build
run: |
cd bin
make -j 4 -k && make install
- name: Unit tests
run: |
cd bin
make test
- name: Check executables
run: |
cd bin/check_install/bin
./authserver --version
./worldserver --version
- name: Find latest DB release tag
id: find_matching_tags
uses: Rochet2/[email protected]
with:
regex: ^TDB335\.\d+$
sort: desc
owner: TrinityCore
repo: TrinityCore
per_page: 70
token: ${{ secrets.GITHUB_TOKEN }}
- name: Print matched tags
run: |
echo ${{ steps.find_matching_tags.outputs.tags }}
- name: Download latest DB
uses: i3h/download-release-asset@a987f9dc3559bd1024d7ed353b59c9d0bbb8ab61
with:
owner: TrinityCore
repo: TrinityCore
tag: ${{ fromJson(steps.find_matching_tags.outputs.tags)[0] }}
file: /TDB_full.*\.7z/
path: bin/check_install/bin
token: ${{ secrets.GITHUB_TOKEN }}
- name: Print downloaded files
run: |
ls -lah bin/check_install/bin
- name: Set configs
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
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: 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: matrix.pch == 'ON' && matrix.branch == '3.3.5'
run: |
echo 'Trinity_Jukebox' ; curl -sSf http://rochet2.github.io/downloads/Trinity_Jukebox.sql | mysql -uroot world
echo 'Trinity_Portal_Master' ; curl -sSf http://rochet2.github.io/downloads/Trinity_Portal_Master.sql | mysql -uroot world
echo 'Trinity_Portal_Master_Option' ; curl -sSf http://rochet2.github.io/downloads/Trinity_Portal_Master_Option.sql | mysql -uroot world
- name: Push changes
if: matrix.pch == 'ON'
run: |
git push