feat(CORE/bash): implemented acore dashboard for Windows (#13476)
+ implemented acore dashboard for windows + integrated acore dashboard for windows in our pipeline + implemented dry run for windows build + fixed permissions issue for all the operating systems + code clean
This commit is contained in:
parent
b35c907cde
commit
171df31196
37
.github/workflows/windows_build.yml
vendored
37
.github/workflows/windows_build.yml
vendored
@ -24,22 +24,41 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Configure OS
|
||||
shell: bash
|
||||
env:
|
||||
CONTINUOUS_INTEGRATION: true
|
||||
run: |
|
||||
choco install --no-progress openssl
|
||||
choco install --no-progress boost-msvc-14.3 --version=1.79.0
|
||||
./acore.sh install-deps
|
||||
- name: Process pending sql
|
||||
shell: bash
|
||||
run: bash bin/acore-db-pendings
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build && cd build
|
||||
cmake .. -DTOOLS_BUILD=all
|
||||
cmake --build . --config Release --parallel 4
|
||||
export CTOOLS_BUILD=all
|
||||
./acore.sh compiler build
|
||||
- name: Dry run authserver
|
||||
shell: bash
|
||||
run: |
|
||||
source ./apps/ci/ci-gen-server-conf-files.sh "authserver" "configs" "."
|
||||
cd env/dist
|
||||
./authserver -dry-run
|
||||
- name: Dry run worldserver
|
||||
shell: bash
|
||||
run: |
|
||||
source ./apps/ci/ci-gen-server-conf-files.sh "worldserver" "configs" "."
|
||||
cd env/dist
|
||||
./worldserver -dry-run
|
||||
- name: Stop MySQL
|
||||
run: net stop mysql
|
||||
- name: Copy dll files
|
||||
shell: bash
|
||||
run: |
|
||||
cp "/c/mysql/lib/libmysql.dll" "build/bin/Release/"
|
||||
cp "/c/Program Files/OpenSSL-Win64/bin/libcrypto-1_1-x64.dll" "build/bin/Release/"
|
||||
cp "/c/Program Files/OpenSSL-Win64/bin/libssl-1_1-x64.dll" "build/bin/Release/"
|
||||
rm -rf env/dist/data
|
||||
cp "/c/tools/mysql/current/lib/libmysql.dll" "env/dist"
|
||||
cp "/c/Program Files/OpenSSL-Win64/bin/libcrypto-1_1-x64.dll" "env/dist"
|
||||
cp "/c/Program Files/OpenSSL-Win64/bin/libssl-1_1-x64.dll" "env/dist"
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: windows-2022-MSVC17-release
|
||||
path: build/bin/Release
|
||||
path: env/dist
|
||||
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -113,7 +113,8 @@
|
||||
"xtr1common": "cpp",
|
||||
"xtree": "cpp",
|
||||
"xutility": "cpp",
|
||||
"*.ipp": "cpp"
|
||||
"*.ipp": "cpp",
|
||||
"resumable": "cpp"
|
||||
},
|
||||
"deno.enable": true,
|
||||
"deno.path": "deps/deno/bin/deno",
|
||||
|
||||
@ -2,25 +2,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# Start mysql
|
||||
sudo systemctl start mysql
|
||||
|
||||
APP_NAME=$1
|
||||
|
||||
echo "LoginDatabaseInfo = \"localhost;3306;root;root;acore_auth\"" >> ./env/dist/etc/$APP_NAME.conf
|
||||
|
||||
if [[ $APP_NAME != "authserver" ]]; then
|
||||
{
|
||||
echo "WorldDatabaseInfo = \"localhost;3306;root;root;acore_world\""
|
||||
echo "CharacterDatabaseInfo = \"localhost;3306;root;root;acore_characters\""
|
||||
} >> ./env/dist/etc/$APP_NAME.conf
|
||||
fi
|
||||
|
||||
if [[ $APP_NAME == "worldserver" ]]; then
|
||||
echo "DataDir = \"../data/\"" >> ./env/dist/etc/$APP_NAME.conf
|
||||
|
||||
git clone --depth=1 --branch=master --single-branch https://github.com/ac-data/ac-data.git ./env/dist/data
|
||||
fi
|
||||
source "$CURRENT_PATH/ci-gen-server-conf-files.sh" $1 "etc" "bin" "root"
|
||||
|
||||
(cd ./env/dist/bin/ && timeout 5m ./$APP_NAME -dry-run)
|
||||
|
||||
|
||||
21
apps/ci/ci-gen-server-conf-files.sh
Normal file
21
apps/ci/ci-gen-server-conf-files.sh
Normal file
@ -0,0 +1,21 @@
|
||||
APP_NAME=$1
|
||||
CONFIG_FOLDER=${2:-"etc"}
|
||||
BIN_FOLDER=${3-"bin"}
|
||||
MYSQL_ROOT_PASSWORD=${4:-""}
|
||||
|
||||
|
||||
echo "LoginDatabaseInfo = \"localhost;3306;root;$MYSQL_ROOT_PASSWORD;acore_auth\"" >> ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
|
||||
|
||||
# worldserver or dbimport
|
||||
if [[ $APP_NAME != "authserver" ]]; then
|
||||
{
|
||||
echo "WorldDatabaseInfo = \"localhost;3306;root;$MYSQL_ROOT_PASSWORD;acore_world\""
|
||||
echo "CharacterDatabaseInfo = \"localhost;3306;root;$MYSQL_ROOT_PASSWORD;acore_characters\""
|
||||
} >> ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf
|
||||
fi
|
||||
|
||||
if [[ $APP_NAME == "worldserver" ]]; then
|
||||
echo "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
|
||||
@ -21,7 +21,7 @@ CONFIG_SH
|
||||
|
||||
time sudo apt-get update -y
|
||||
# time sudo apt-get upgrade -y
|
||||
time sudo apt-get install -y git lsb-release sudo ccache
|
||||
time sudo apt-get install -y git lsb-release sudo
|
||||
time ./acore.sh install-deps
|
||||
|
||||
case $COMPILER in
|
||||
|
||||
@ -19,12 +19,7 @@ function comp_ccacheEnable() {
|
||||
export CCACHE_COMPRESSLEVEL=${CCACHE_COMPRESSLEVEL:-9}
|
||||
#export CCACHE_NODIRECT=true
|
||||
|
||||
unamestr=$(uname)
|
||||
if [[ "$unamestr" == 'Darwin' ]]; then
|
||||
export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMYSQL_ADD_INCLUDE_PATH=/usr/local/include -DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient.dylib -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@1.1/include -DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libssl.dylib -DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libcrypto.dylib"
|
||||
else
|
||||
export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
|
||||
fi
|
||||
}
|
||||
|
||||
function comp_ccacheClean() {
|
||||
@ -70,6 +65,19 @@ function comp_configure() {
|
||||
|
||||
comp_ccacheEnable
|
||||
|
||||
OSOPTIONS=""
|
||||
|
||||
|
||||
echo "Platform: $OSTYPE"
|
||||
case "$OSTYPE" in
|
||||
darwin*)
|
||||
OSOPTIONS=" -DMYSQL_ADD_INCLUDE_PATH=/usr/local/include -DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient.dylib -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@1.1/include -DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libssl.dylib -DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl@1.1/lib/libcrypto.dylib "
|
||||
;;
|
||||
msys*)
|
||||
OSOPTIONS=" -DMYSQL_INCLUDE_DIR=C:\tools\mysql\current\include -DMYSQL_LIBRARY=C:\tools\mysql\current\lib\mysqlclient.lib "
|
||||
;;
|
||||
esac
|
||||
|
||||
cmake $SRCPATH -DCMAKE_INSTALL_PREFIX=$BINPATH $DCONF \
|
||||
-DAPPS_BUILD=$CAPPS_BUILD \
|
||||
-DTOOLS_BUILD=$CTOOLS_BUILD \
|
||||
@ -82,7 +90,7 @@ function comp_configure() {
|
||||
-DWITH_WARNINGS=$CWARNINGS \
|
||||
-DCMAKE_C_COMPILER=$CCOMPILERC \
|
||||
-DCMAKE_CXX_COMPILER=$CCOMPILERCXX \
|
||||
$CBUILD_APPS_LIST $CBUILD_TOOLS_LIST $CCUSTOMOPTIONS
|
||||
$CBUILD_APPS_LIST $CBUILD_TOOLS_LIST $OSOPTIONS $CCUSTOMOPTIONS
|
||||
|
||||
cd $CWD
|
||||
|
||||
@ -100,25 +108,50 @@ function comp_compile() {
|
||||
|
||||
comp_ccacheResetStats
|
||||
|
||||
time make -j $MTHREADS
|
||||
make -j $MTHREADS install
|
||||
time cmake --build . --config $CTYPE -j $MTHREADS
|
||||
|
||||
comp_ccacheShowStats
|
||||
|
||||
echo "Platform: $OSTYPE"
|
||||
case "$OSTYPE" in
|
||||
msys*)
|
||||
cmake --install . --config $CTYPE
|
||||
|
||||
cd $CWD
|
||||
|
||||
echo "Done"
|
||||
;;
|
||||
linux*|darwin*)
|
||||
local confDir=${CONFDIR:-"$AC_BINPATH_FULL/../etc"}
|
||||
|
||||
# create the folders before installing to
|
||||
# set the current user and permissions
|
||||
echo "Creating $AC_BINPATH_FULL..."
|
||||
mkdir -p "$AC_BINPATH_FULL"
|
||||
echo "Creating $confDir..."
|
||||
mkdir -p "$confDir"
|
||||
|
||||
echo "Cmake install..."
|
||||
sudo cmake --install . --config $CTYPE
|
||||
|
||||
cd $CWD
|
||||
|
||||
if [[ $DOCKER = 1 ]]; then
|
||||
echo "Generating confs..."
|
||||
cp -n "env/dist/etc/worldserver.conf.dockerdist" "env/dist/etc/worldserver.conf"
|
||||
cp -n "env/dist/etc/authserver.conf.dockerdist" "env/dist/etc/authserver.conf"
|
||||
cp -n "env/dist/etc/dbimport.conf.dockerdist" "env/dist/etc/dbimport.conf"
|
||||
cp -n "env/dist/etc/worldserver.conf.dockerdist" "env/dist/${confDir}/worldserver.conf"
|
||||
cp -n "env/dist/etc/authserver.conf.dockerdist" "env/dist/${confDir}/authserver.conf"
|
||||
cp -n "env/dist/etc/dbimport.conf.dockerdist" "env/dist/${confDir}/dbimport.conf"
|
||||
fi
|
||||
# set all aplications SUID bit
|
||||
echo "Setting permissions on binary files"
|
||||
find "$AC_BINPATH_FULL" -type f -exec sudo chown root:root -- {} +
|
||||
find "$AC_BINPATH_FULL" -type f -exec sudo chmod u+s -- {} +
|
||||
|
||||
echo "Done"
|
||||
;;
|
||||
esac
|
||||
|
||||
runHooks "ON_AFTER_BUILD"
|
||||
|
||||
# set all aplications SUID bit
|
||||
sudo chown -R root:root "$AC_BINPATH_FULL"
|
||||
sudo chmod -R u+s "$AC_BINPATH_FULL"
|
||||
}
|
||||
|
||||
function comp_build() {
|
||||
|
||||
@ -1,6 +1,3 @@
|
||||
echo "WARNING: Installer Script for Windows is not fully supported yet. Work in progress.."
|
||||
echo "!!README!!: Please install openssl and mysql libraries manually following our wiki"
|
||||
|
||||
# install chocolatey before
|
||||
|
||||
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
|
||||
@ -9,9 +6,24 @@ echo "!!README!!: Please install openssl and mysql libraries manually following
|
||||
# cmake
|
||||
# git
|
||||
# microsoft-build-tools
|
||||
# mysql 5.6
|
||||
# mysql
|
||||
|
||||
choco install -y --skip-checksums cmake git git.install microsoft-build-tools ccache
|
||||
choco install -y --skip-checksums mysql --version 5.6.12
|
||||
INSTALL_ARGS=""
|
||||
|
||||
if [[ $CONTINUOUS_INTEGRATION ]]; then
|
||||
INSTALL_ARGS=" --no-progress "
|
||||
else
|
||||
{ # try
|
||||
choco uninstall -y -n cmake.install cmake # needed to make sure that following install set the env properly
|
||||
} || { # catch
|
||||
echo "nothing to do"
|
||||
}
|
||||
|
||||
choco install -y --skip-checksums $INSTALL_ARGS git visualstudio2022community
|
||||
fi
|
||||
|
||||
choco install -y --skip-checksums $INSTALL_ARGS cmake.install -y --installargs 'ADD_CMAKE_TO_PATH=System'
|
||||
choco install -y --skip-checksums $INSTALL_ARGS visualstudio2022-workload-nativedesktop openssl
|
||||
choco install -y --skip-checksums $INSTALL_ARGS boost-msvc-14.3 --version=1.79.0
|
||||
choco install -y --skip-checksums $INSTALL_ARGS mysql --version 8.0.31
|
||||
|
||||
echo "!!README!!: Please remember to install openssl and mysql libraries manually following our wiki"
|
||||
|
||||
@ -170,6 +170,7 @@ find_path(MYSQL_INCLUDE_DIR
|
||||
/usr/local/include
|
||||
/usr/local/include/mysql
|
||||
/usr/local/mysql/include
|
||||
"C:/tools/mysql/current/include" # chocolatey package
|
||||
"C:/Program Files/MySQL/MySQL Server 8.0/include"
|
||||
"C:/Program Files/MySQL/MySQL Server 5.7/include"
|
||||
"C:/Program Files/MySQL/include"
|
||||
@ -209,6 +210,7 @@ if( WIN32 )
|
||||
libmysql
|
||||
PATHS
|
||||
${MYSQL_ADD_LIBRARIES_PATH}
|
||||
"C:/tools/mysql/current/lib" # chocolatey package
|
||||
"C:/Program Files/MySQL/MySQL Server 8.0/lib"
|
||||
"C:/Program Files/MySQL/MySQL Server 8.0/lib/opt"
|
||||
"C:/Program Files/MySQL/MySQL Server 5.7/lib/opt"
|
||||
@ -261,6 +263,7 @@ endif( UNIX )
|
||||
if( WIN32 )
|
||||
find_program(MYSQL_EXECUTABLE mysql
|
||||
PATHS
|
||||
"C:/tools/mysql/current/bin" # chocolatey package
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 8.0/bin"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/bin"
|
||||
"${PROGRAM_FILES_64}/MySQL/MySQL Server 8.0/bin/opt"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user