merge #1833
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |