aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian König <Fabi@users.noreply.github.com>2024-05-31 22:08:40 +0200
committerOvahlord <dreadkiller@gmx.de>2024-06-20 01:14:05 +0200
commit2d083cd895bb276b1dbae955d483cd4e46cf6ad8 (patch)
treeba27879eb3a69b0143025e99382cb8197bdd5981
parent50eb64d331fbaec01c1ae5b8035901b4f1971b5c (diff)
CI/GitHub: Add Windows x86_64 CI (github actions) support. (#29773)
Co-authored-by: Shauren <shauren.trinity@gmail.com> (cherry picked from commit 19232ed2b662e8404dd0fdb672ab940e711ac4bc)
-rw-r--r--.github/workflows/win-x64-build.yml79
-rw-r--r--src/server/bnetserver/CMakeLists.txt4
-rw-r--r--src/server/worldserver/CMakeLists.txt2
3 files changed, 82 insertions, 3 deletions
diff --git a/.github/workflows/win-x64-build.yml b/.github/workflows/win-x64-build.yml
new file mode 100644
index 00000000000..3c849e31f93
--- /dev/null
+++ b/.github/workflows/win-x64-build.yml
@@ -0,0 +1,79 @@
+name: Windows x64
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ build:
+ runs-on: windows-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set reusable strings
+ id: strings
+ shell: bash
+ run: |
+ echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
+
+ - name: Set Environment Variables
+ run: |
+ echo "OPENSSL_ROOT_DIR=C:/libs/openssl" >> $env:GITHUB_ENV
+ echo "MYSQL_ROOT_DIR=C:/Program Files/MySQL/MySQL Server 8.0" >> $env:GITHUB_ENV
+
+ - name: Download and install Openssl 3.x
+ run: |
+ $Url = "https://slproweb.com/download/Win64OpenSSL-3_2_1.exe"
+ (New-Object System.Net.WebClient).DownloadFile($Url, "${{ env.TEMP }}\openssl.exe")
+ Start-Process -Wait -FilePath "${{ env.TEMP }}\openssl.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES",/DIR=${{ env.OPENSSL_ROOT_DIR }}
+
+ # Quick Openssl install test
+ & ${{ env.OPENSSL_ROOT_DIR }}/bin/openssl.exe version
+
+ - name: Download and install Boost
+ uses: MarkusJx/install-boost@v2.4.5
+ id: install-boost
+ with:
+ boost_version: 1.84.0
+ link: static
+ platform_version: 2022
+ toolset: msvc
+
+ - name: Initialize Visual Studio Environment
+ uses: egor-tensin/vs-shell@v2
+ with:
+ arch: x64
+
+ - name: Configure CMake
+ env:
+ CXXFLAGS: /WX
+ BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
+ run: >
+ cmake -GNinja -S ${{ github.workspace }} -B ${{ steps.strings.outputs.build-output-dir }}
+ -DTOOLS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
+
+ - name: Build
+ run: |
+ cmake --build ${{ steps.strings.outputs.build-output-dir }}
+
+ - name: Copy Dependencies
+ run: |
+ cd ${{ steps.strings.outputs.build-output-dir }}/bin
+ copy "${{ env.MYSQL_ROOT_DIR }}/lib/libmysql.dll" libmysql.dll
+ copy "${{ env.OPENSSL_ROOT_DIR }}/bin/libssl-3-x64.dll" libssl-3-x64.dll
+ copy "${{ env.OPENSSL_ROOT_DIR }}/bin/libcrypto-3-x64.dll" libcrypto-3-x64.dll
+ copy "${{ env.OPENSSL_ROOT_DIR }}/bin/legacy.dll" legacy.dll
+
+ - name: Check binaries
+ run: |
+ cd ${{ steps.strings.outputs.build-output-dir }}/bin
+ ./bnetserver --version
+ ./worldserver --version
+
+ - name: Upload Artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ path: ${{ steps.strings.outputs.build-output-dir }}/bin
+ name: TrinityCoreMasterWin64VS2022
+ # Set a custom retention for artifacts
+ #retention-days: 7
diff --git a/src/server/bnetserver/CMakeLists.txt b/src/server/bnetserver/CMakeLists.txt
index 929fe52d3d3..97f8f5f7989 100644
--- a/src/server/bnetserver/CMakeLists.txt
+++ b/src/server/bnetserver/CMakeLists.txt
@@ -70,7 +70,7 @@ if (COPY_CONF AND WIN32)
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bnetserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
)
- elseif (MINGW)
+ else ()
add_custom_command(TARGET bnetserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bnetserver.conf.dist ${CMAKE_BINARY_DIR}/bin/
@@ -85,7 +85,7 @@ if (WIN32)
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bnetserver.cert.pem ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bnetserver.key.pem ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
)
- elseif (MINGW)
+ else ()
add_custom_command(TARGET bnetserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/bnetserver.cert.pem ${CMAKE_BINARY_DIR}/bin/
diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt
index f6df3e524de..528cd24db26 100644
--- a/src/server/worldserver/CMakeLists.txt
+++ b/src/server/worldserver/CMakeLists.txt
@@ -82,7 +82,7 @@ if(COPY_CONF AND WIN32)
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
)
- elseif(MINGW)
+ else()
add_custom_command(TARGET worldserver
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_BINARY_DIR}/bin/