First Commit

This commit is contained in:
mikx
2025-03-18 19:19:03 -04:00
commit 93073b0be2
10024 changed files with 9034050 additions and 0 deletions

8
apps/ci/ci-compile.sh Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -e
echo "compile core"
export AC_CCACHE=true
./acore.sh "compiler" "all"

View File

@@ -0,0 +1,69 @@
#!/bin/bash
set -e
cat >>conf/config.sh <<CONFIG_SH
MTHREADS=$(($(grep -c ^processor /proc/cpuinfo) + 2))
CWARNINGS=ON
CDEBUG=OFF
CTYPE=Release
CTOOLS_BUILD=none
CSCRIPTS=static
CMODULES=static
CBUILD_TESTING=ON
CSCRIPTPCH=ON
CCOREPCH=ON
CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
CONFIG_SH
case $COMPILER in
# this is in order to use the "default" gcc version of the OS, without forcing a specific version
"gcc" )
time sudo apt-get install -y gcc g++
echo "CCOMPILERC=\"gcc\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"g++\"" >> ./conf/config.sh
;;
"gcc8" )
time sudo apt-get install -y gcc-8 g++-8
echo "CCOMPILERC=\"gcc-8\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"g++-8\"" >> ./conf/config.sh
;;
"gcc10" )
time sudo apt-get install -y gcc-10 g++-10
echo "CCOMPILERC=\"gcc-10\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"g++-10\"" >> ./conf/config.sh
;;
# this is in order to use the "default" clang version of the OS, without forcing a specific version
"clang" )
time sudo apt-get install -y clang
echo "CCOMPILERC=\"clang\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++\"" >> ./conf/config.sh
;;
"clang10" )
time sudo apt-get install -y clang-10
echo "CCOMPILERC=\"clang-10\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-10\"" >> ./conf/config.sh
;;
"clang11" )
time sudo apt-get install -y clang-11
echo "CCOMPILERC=\"clang-11\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-11\"" >> ./conf/config.sh
;;
"clang12" )
time sudo apt-get install -y clang-12
echo "CCOMPILERC=\"clang-12\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-12\"" >> ./conf/config.sh
;;
* )
echo "Unknown compiler $COMPILER"
exit 1
;;
esac

69
apps/ci/ci-conf-core.sh Normal file
View File

@@ -0,0 +1,69 @@
#!/bin/bash
set -e
cat >>conf/config.sh <<CONFIG_SH
MTHREADS=$(($(grep -c ^processor /proc/cpuinfo) + 2))
CWARNINGS=ON
CDEBUG=OFF
CTYPE=Release
CTOOLS_BUILD=none
CSCRIPTS=static
CMODULES=static
CBUILD_TESTING=ON
CSCRIPTPCH=OFF
CCOREPCH=OFF
CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
CONFIG_SH
case $COMPILER in
# this is in order to use the "default" gcc version of the OS, without forcing a specific version
"gcc" )
time sudo apt-get install -y gcc g++
echo "CCOMPILERC=\"gcc\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"g++\"" >> ./conf/config.sh
;;
"gcc8" )
time sudo apt-get install -y gcc-8 g++-8
echo "CCOMPILERC=\"gcc-8\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"g++-8\"" >> ./conf/config.sh
;;
"gcc10" )
time sudo apt-get install -y gcc-10 g++-10
echo "CCOMPILERC=\"gcc-10\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"g++-10\"" >> ./conf/config.sh
;;
# this is in order to use the "default" clang version of the OS, without forcing a specific version
"clang" )
time sudo apt-get install -y clang
echo "CCOMPILERC=\"clang\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++\"" >> ./conf/config.sh
;;
"clang10" )
time sudo apt-get install -y clang-10
echo "CCOMPILERC=\"clang-10\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-10\"" >> ./conf/config.sh
;;
"clang11" )
time sudo apt-get install -y clang-11
echo "CCOMPILERC=\"clang-11\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-11\"" >> ./conf/config.sh
;;
"clang12" )
time sudo apt-get install -y clang-12
echo "CCOMPILERC=\"clang-12\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-12\"" >> ./conf/config.sh
;;
* )
echo "Unknown compiler $COMPILER"
exit 1
;;
esac

36
apps/ci/ci-conf-db.sh Normal file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
set -e
cat >>conf/config.sh <<CONFIG_SH
MTHREADS=$(($(grep -c ^processor /proc/cpuinfo) + 2))
CWARNINGS=ON
CDEBUG=OFF
CTYPE=Release
CAPPS_BUILD=none
CTOOLS_BUILD=db-only
CSCRIPTPCH=OFF
CCOREPCH=OFF
CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
CONFIG_SH
case $COMPILER in
# this is in order to use the "default" clang version of the OS, without forcing a specific version
"clang" )
time sudo apt-get install -y clang
echo "CCOMPILERC=\"clang\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++\"" >> ./conf/config.sh
;;
"clang12" )
time sudo apt-get install -y clang-12
echo "CCOMPILERC=\"clang-12\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-12\"" >> ./conf/config.sh
;;
* )
echo "Unknown compiler $COMPILER"
exit 1
;;
esac

67
apps/ci/ci-conf-tools.sh Normal file
View File

@@ -0,0 +1,67 @@
#!/bin/bash
set -e
cat >>conf/config.sh <<CONFIG_SH
MTHREADS=$(($(grep -c ^processor /proc/cpuinfo) + 2))
CWARNINGS=ON
CDEBUG=OFF
CTYPE=Release
CAPPS_BUILD=none
CTOOLS_BUILD=maps-only
CSCRIPTPCH=OFF
CCOREPCH=OFF
CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
CONFIG_SH
case $COMPILER in
# this is in order to use the "default" gcc version of the OS, without forcing a specific version
"gcc" )
time sudo apt-get install -y gcc g++
echo "CCOMPILERC=\"gcc\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"g++\"" >> ./conf/config.sh
;;
"gcc8" )
time sudo apt-get install -y gcc-8 g++-8
echo "CCOMPILERC=\"gcc-8\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"g++-8\"" >> ./conf/config.sh
;;
"gcc10" )
time sudo apt-get install -y gcc-10 g++-10
echo "CCOMPILERC=\"gcc-10\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"g++-10\"" >> ./conf/config.sh
;;
# this is in order to use the "default" clang version of the OS, without forcing a specific version
"clang" )
time sudo apt-get install -y clang
echo "CCOMPILERC=\"clang\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++\"" >> ./conf/config.sh
;;
"clang10" )
time sudo apt-get install -y clang-10
echo "CCOMPILERC=\"clang-10\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-10\"" >> ./conf/config.sh
;;
"clang11" )
time sudo apt-get install -y clang-11
echo "CCOMPILERC=\"clang-11\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-11\"" >> ./conf/config.sh
;;
"clang12" )
time sudo apt-get install -y clang-12
echo "CCOMPILERC=\"clang-12\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-12\"" >> ./conf/config.sh
;;
* )
echo "Unknown compiler $COMPILER"
exit 1
;;
esac

15
apps/ci/ci-dry-run.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
set -e
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Start mysql
sudo systemctl start mysql
source "$CURRENT_PATH/ci-gen-server-conf-files.sh" $1 "etc" "bin" "root"
(cd ./env/dist/bin/ && timeout 5m ./$APP_NAME -dry-run)
# Stop mysql
sudo systemctl stop mysql

18
apps/ci/ci-error-check.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
ERRORS_FILE="./env/dist/bin/Errors.log";
echo "Checking Startup Errors"
echo
if [[ -s ${ERRORS_FILE} ]]; then
printf "The Errors.log file contains startup errors:\n\n";
cat ${ERRORS_FILE};
printf "\nPlease solve the startup errors listed above!\n";
exit 1;
else
echo "> No startup errors found in Errors.log";
fi
echo
echo "Done"

View File

@@ -0,0 +1,15 @@
APP_NAME=$1
CONFIG_FOLDER=${2:-"etc"}
BIN_FOLDER=${3-"bin"}
MYSQL_ROOT_PASSWORD=${4:-""}
# copy dist files to conf files
cp ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf.dist ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
# replace login info
sed -i "s/127.0.0.1;3306;acore;acore/localhost;3306;root;$MYSQL_ROOT_PASSWORD/" ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
if [[ $APP_NAME == "worldserver" ]]; then
sed -i 's/DataDir = \".\"/DataDir = \".\/data"/' ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
git clone --depth=1 --branch=master --single-branch https://github.com/ac-data/ac-data.git ./env/dist/$BIN_FOLDER/data
fi

View File

@@ -0,0 +1,107 @@
#!/bin/bash
set -e
echo "install modules"
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-1v1-arena modules/mod-1v1-arena
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-account-mounts modules/mod-account-mounts
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-ah-bot modules/mod-ah-bot
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-anticheat modules/mod-anticheat
# NOTE: disabled because it does not compile right now with latest AC
# git clone --depth=1 --branch=master https://github.com/azerothcore/mod-antifarming modules/mod-antifarming
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-arena-3v3-solo-queue modules/mod-arena-3v3-solo-queue
git clone --depth=1 --branch=main https://github.com/azerothcore/mod-arena-replay modules/mod-arena-replay
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-auto-revive modules/mod-auto-revive
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-autobalance modules/mod-autobalance
# NOTE: disabled because it causes DB error
# git clone --depth=1 --branch=master https://github.com/azerothcore/mod-azerothshard.git modules/mod-azerothshard
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-better-item-reloading modules/mod-better-item-reloading
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-bg-item-reward modules/mod-bg-item-reward
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-bg-reward modules/mod-bg-reward
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-boss-announcer modules/mod-boss-announcer
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-breaking-news-override modules/mod-breaking-news-override
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-buff-command modules/mod-buff-command
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-cfbg modules/mod-cfbg
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-character-tools modules/mod-character-tools
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-chat-login modules/mod-chat-login
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-chat-transmitter modules/mod-chat-transmitter
# NOTE: disabled because it causes DB startup error
# git clone --depth=1 --branch=master https://github.com/azerothcore/mod-chromie-xp modules/mod-chromie-xp
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-congrats-on-level modules/mod-congrats-on-level
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-costumes modules/mod-costumes
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-cta-switch modules/mod-cta-switch
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-custom-login modules/mod-custom-login
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-desertion-warnings modules/mod-desertion-warnings
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-detailed-logging modules/mod-detailed-logging
git clone --depth=1 --branch=main https://github.com/azerothcore/mod-dmf-switch modules/mod-dmf-switch
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-duel-reset modules/mod-duel-reset
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-dynamic-xp modules/mod-dynamic-xp
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-eluna modules/mod-eluna
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-emblem-transfer modules/mod-emblem-transfer
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-fireworks-on-level modules/mod-fireworks-on-level
git clone --depth=1 --branch=main https://github.com/azerothcore/mod-global-chat modules/mod-global-chat
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-guild-zone-system modules/mod-guild-zone-system
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-guildhouse modules/mod-guildhouse
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-individual-xp modules/mod-individual-xp
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-instance-reset modules/mod-instance-reset
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-instanced-worldbosses modules/mod-instanced-worldbosses
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-ip-tracker modules/mod-ip-tracker
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-item-level-up modules/mod-item-level-up
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-keep-out modules/mod-keep-out
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-learn-highest-talent modules/mod-learn-highest-talent
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-learn-spells modules/mod-learn-spells
git clone --depth=1 --branch=main https://github.com/azerothcore/mod-low-level-arena modules/mod-low-level-arena
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-low-level-rbg modules/mod-low-level-rbg
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-mall-teleport modules/mod-mall-teleport
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-morph-all-players modules/mod-morph-all-players
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-morphsummon modules/mod-morphsummon
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-multi-client-check modules/mod-multi-client-check
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-notify-muted modules/mod-notify-muted
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-npc-all-mounts modules/mod-npc-all-mounts
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-npc-beastmaster modules/mod-npc-beastmaster
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-npc-buffer modules/mod-npc-buffer
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-npc-codebox modules/mod-npc-codebox
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-npc-enchanter modules/mod-npc-enchanter
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-npc-free-professions modules/mod-npc-free-professions
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-npc-gambler modules/mod-npc-gambler
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-npc-morph modules/mod-npc-morph
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-npc-services modules/mod-npc-services
# not yet on azerothcore github
git clone --depth=1 --branch=master https://github.com/gozzim/mod-npc-spectator modules/mod-npc-spectator
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-npc-talent-template modules/mod-npc-talent-template
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-npc-titles-tokens modules/mod-npc-titles-tokens
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-phased-duels modules/mod-phased-duels
# outdated
# git clone --depth=1 --branch=master https://github.com/azerothcore/mod-playerbots modules/mod-playerbots
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-pocket-portal modules/mod-pocket-portal
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-premium modules/mod-premium
git clone --depth=1 --branch=main https://github.com/azerothcore/mod-progression-system.git modules/mod-progression-system
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-promotion-azerothcore modules/mod-promotion-azerothcore
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-pvp-quests modules/mod-pvp-quests
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-pvp-titles modules/mod-pvp-titles
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-pvp-zones modules/mod-pvp-zones
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-pvpscript modules/mod-pvpscript
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-pvpstats-announcer modules/mod-pvpstats-announcer
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-quest-status modules/mod-quest-status
git clone --depth=1 --branch=main https://github.com/azerothcore/mod-queue-list-cache modules/mod-queue-list-cache
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-quick-teleport modules/mod-quick-teleport
git clone --depth=1 --branch=main https://github.com/azerothcore/mod-racial-trait-swap modules/mod-racial-trait-swap
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-random-enchants modules/mod-random-enchants
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-rdf-expansion modules/mod-rdf-expansion
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-resurrection-scroll modules/mod-resurrection-scroll
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-reward-played-time modules/mod-reward-played-time
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-reward-shop modules/mod-reward-shop
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-server-auto-shutdown.git modules/mod-server-auto-shutdown
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-solocraft modules/mod-solocraft
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-skip-dk-starting-area modules/mod-skip-dk-starting-area
# has core patch file
# git clone --depth=1 --branch=master https://github.com/azerothcore/mod-spell-regulator modules/mod-spell-regulator
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-starter-guild modules/mod-starter-guild
git clone --depth=1 --branch=main https://github.com/azerothcore/mod-system-vip modules/mod-system-vip
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-tic-tac-toe modules/mod-tic-tac-toe
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-top-arena modules/mod-top-arena
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-transmog modules/mod-transmog
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-war-effort modules/mod-war-effort
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-weekend-xp modules/mod-weekend-xp
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-who-logged modules/mod-who-logged
git clone --depth=1 --branch=master https://github.com/azerothcore/mod-zone-difficulty modules/mod-zone-difficulty

74
apps/ci/ci-install.sh Normal file
View File

@@ -0,0 +1,74 @@
#!/bin/bash
set -e
cat >>conf/config.sh <<CONFIG_SH
MTHREADS=$(($(grep -c ^processor /proc/cpuinfo) + 2))
CWARNINGS=ON
CDEBUG=OFF
CTYPE=Release
CSCRIPTS=static
CBUILD_TESTING=ON
CSERVERS=ON
CTOOLS=ON
CSCRIPTPCH=OFF
CCOREPCH=OFF
CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
CONFIG_SH
time sudo apt-get update -y
# time sudo apt-get upgrade -y
time sudo apt-get install -y git lsb-release sudo
time ./acore.sh install-deps
case $COMPILER in
# this is in order to use the "default" gcc version of the OS, without forcing a specific version
"gcc" )
time sudo apt-get install -y gcc g++
echo "CCOMPILERC=\"gcc\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"g++\"" >> ./conf/config.sh
;;
"gcc8" )
time sudo apt-get install -y gcc-8 g++-8
echo "CCOMPILERC=\"gcc-8\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"g++-8\"" >> ./conf/config.sh
;;
"gcc10" )
time sudo apt-get install -y gcc-10 g++-10
echo "CCOMPILERC=\"gcc-10\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"g++-10\"" >> ./conf/config.sh
;;
# this is in order to use the "default" clang version of the OS, without forcing a specific version
"clang" )
time sudo apt-get install -y clang
echo "CCOMPILERC=\"clang\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++\"" >> ./conf/config.sh
;;
"clang10" )
time sudo apt-get install -y clang-10
echo "CCOMPILERC=\"clang-10\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-10\"" >> ./conf/config.sh
;;
"clang11" )
time sudo apt-get install -y clang-11
echo "CCOMPILERC=\"clang-11\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-11\"" >> ./conf/config.sh
;;
"clang12" )
time sudo apt-get install -y clang-12
echo "CCOMPILERC=\"clang-12\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-12\"" >> ./conf/config.sh
;;
* )
echo "Unknown compiler $COMPILER"
exit 1
;;
esac

View File

@@ -0,0 +1,54 @@
import * as semver from "https://deno.land/x/semver/mod.ts";
// specify the needed paths here
const CHANGELOG_PATH = "doc/changelog";
const CHANGELOG_PENDING_PATH = `${CHANGELOG_PATH}/pendings`;
const CHANGELOG_MASTER_FILE = `${CHANGELOG_PATH}/master.md`;
const ACORE_JSON = "./acore.json";
// read the acore.json file to work with the versioning
const decoder = new TextDecoder("utf-8");
const data = await Deno.readFile(ACORE_JSON);
const acoreInfo = JSON.parse(decoder.decode(data));
let changelogText = await Deno.readTextFile(CHANGELOG_MASTER_FILE);
const currentVersion = acoreInfo.version;
const res=Deno.run({ cmd: [ "git", "rev-parse",
"HEAD"],
stdout: 'piped',
stderr: 'piped',
stdin: 'null' });
await res.status();
const gitVersion = new TextDecoder().decode(await res.output());
for await (const dirEntry of Deno.readDir(CHANGELOG_PENDING_PATH)) {
if (!dirEntry.isFile || !dirEntry.name.endsWith(".md")) {
continue;
}
// Upgrade the prerelease version number (e.g. 1.0.0-dev.1 -> 1.0.0-dev.2)
acoreInfo.version = semver.inc(acoreInfo.version, "prerelease", {
includePrerelease: true,
});
// read the pending file found and add it at the beginning of the changelog text
const data = await Deno.readTextFile(
`${CHANGELOG_PENDING_PATH}/${dirEntry.name}`,
);
changelogText = `## ${acoreInfo.version} | Commit: [${gitVersion}](https://github.com/azerothcore/azerothcore-wotlk/commit/${gitVersion}\n\n${data}\n${changelogText}`;
// remove the pending file
await Deno.remove(`${CHANGELOG_PENDING_PATH}/${dirEntry.name}`);
}
// write to acore.json and master.md only if new version is available
if (currentVersion != acoreInfo.version) {
console.log(`Changelog version upgraded from ${currentVersion} to ${acoreInfo.version}`)
Deno.writeTextFile(CHANGELOG_MASTER_FILE, changelogText);
Deno.writeTextFile(ACORE_JSON, JSON.stringify(acoreInfo, null, 2)+"\n");
} else {
console.log("No changelogs to add")
}

74
apps/ci/ci-pending-sql.sh Normal file
View File

@@ -0,0 +1,74 @@
#!/usr/bin/env bash
set -euo pipefail
CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$CURRENT_PATH/../bash_shared/includes.sh"
UPDATES_PATH="$AC_PATH_ROOT/data/sql/updates"
# get_next_index "data/sql/updates/db_world/2024_10_14_22.sql"
# => 23
# get_next_index ""
# => 00
function get_next_index() {
if [[ -n "$1" ]]; then
# PREV_COUNT should be a non-zero padded number
PREV_COUNT="$(
# grabs the filename of the first argument, removes ".sql" suffix.
basename "$1" .sql |
# get the last number
cut -f4 -d_ |
# retrieve the last number, without zero padding
grep -oE "[1-9][0-9]*$"
)"
printf '%02d' "$((PREV_COUNT + 1))"
else
echo "00"
fi
}
# lists all SQL files in the appropriate data/sql/updates/db_$1, and then moves them to a standard format, ordered by date and how many imports have happened that day. The name should be in this format:
#
# /path/to/data/sql/updates/db_NAME/YYYY_MM_DD_INDEX.sql
#
# Where INDEX is a number with a minimum with a minimum width (0-padded) of 2
#
# for example, "data/sql/updates/db_world/2024_10_01_03.sql" translates to "the third update in the world database from October 01, 2024"
TODAY="$(date +%Y_%m_%d)"
function import() {
PENDING_PATH="$AC_PATH_ROOT/data/sql/updates/pending_db_$1"
UPDATES_DIR="$UPDATES_PATH/db_$1"
# Get the most recent SQL file applied to this database. Used for the header comment
LATEST_UPDATE="$(find "$UPDATES_DIR" -iname "*.sql" | sort -h | tail -n 1)"
# Get latest SQL file applied to this database, today. This could be empty.
LATEST_UPDATE_TODAY="$(find "$UPDATES_DIR" -iname "$TODAY*.sql" | sort -h | tail -n 1)"
for entry in "$PENDING_PATH"/*.sql; do
if [[ -f "$entry" ]]; then
INDEX="$(get_next_index "$LATEST_UPDATE_TODAY")"
OUTPUT_FILE="${UPDATES_DIR}/${TODAY}_${INDEX}.sql"
# ensure a note is added as a header comment
echo "-- DB update $(basename "$LATEST_UPDATE" .sql) -> $(basename "$OUTPUT_FILE" .sql)" >"$OUTPUT_FILE"
# fill in the SQL contents under that
cat "$entry" >>"$OUTPUT_FILE"
# remove the unneeded file
rm -f "$entry"
# set the newest file to the file we just moved
LATEST_UPDATE_TODAY="$OUTPUT_FILE"
LATEST_UPDATE="$OUTPUT_FILE"
fi
done
}
import "world"
import "characters"
import "auth"
echo "Done."

View File

@@ -0,0 +1,3 @@
#!/bin/bash
time var/build/obj/src/test/unit_tests

43
apps/ci/mac/ci-compile.sh Normal file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/env bash
export OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)
export CCACHE_CPP2=true
export CCACHE_MAXSIZE='500M'
export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=9
ccache -s
cd var/build/obj
mysql_include_path=$(brew --prefix mysql)/include/mysql
mysql_lib_path=$(brew --prefix mysql)/lib/libmysqlclient.dylib
if [ ! -d "$mysql_include_path" ]; then
echo "Original mysql include directory doesn't exist. Lets try to use the first available folder in mysql dir."
base_dir=$(brew --cellar mysql)/$(basename $(ls -d $(brew --cellar mysql)/*/ | head -n 1))
echo "Trying the next mysql base dir: $base_dir"
mysql_include_path=$base_dir/include/mysql
mysql_lib_path=$base_dir/lib/libmysqlclient.dylib
fi
time cmake ../../../ \
-DTOOLS_BUILD=all \
-DSCRIPTS=static \
-DCMAKE_BUILD_TYPE=Release \
-DMYSQL_ADD_INCLUDE_PATH=$mysql_include_path \
-DMYSQL_LIBRARY=$mysql_lib_path \
-DREADLINE_INCLUDE_DIR=$(brew --prefix readline)/include \
-DREADLINE_LIBRARY=$(brew --prefix readline)/lib/libreadline.dylib \
-DOPENSSL_INCLUDE_DIR="$OPENSSL_ROOT_DIR/include" \
-DOPENSSL_SSL_LIBRARIES="$OPENSSL_ROOT_DIR/lib/libssl.dylib" \
-DOPENSSL_CRYPTO_LIBRARIES="$OPENSSL_ROOT_DIR/lib/libcrypto.dylib" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DUSE_SCRIPTPCH=0 \
-DUSE_COREPCH=0 \
;
time make -j $(($(sysctl -n hw.ncpu ) + 2))
ccache -s