git build

This commit is contained in:
luis
2026-08-06 06:29:55 -03:00
parent 39ec59f071
commit 376fac5597
2 changed files with 122 additions and 3 deletions
+119
View File
@@ -0,0 +1,119 @@
name: Build (Windows x64)
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: windows-2022
env:
CMAKE_BUILD_TYPE: RelWithDebInfo
MYSQL_ROOT_DIR: C:/Program Files/MySQL/MySQL Server 8.0
OPENSSL_ROOT_DIR: C:/libs/openssl
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Get current OpenSSL version
id: openssl-info
run: |
$VersionsUrl = "https://api.github.com/repos/slproweb/opensslhashes/contents/win32_openssl_hashes.json"
$Headers = @{
Accept="application/vnd.github.raw+json"
Authorization="Bearer ${{ secrets.GITHUB_TOKEN }}"
}
$openSSL = (Invoke-RestMethod $VersionsUrl -Headers $Headers).files.PSObject.Properties |
Select-Object -ExpandProperty Value |
Where-Object { $_.arch -eq 'INTEL' } |
Where-Object { $_.bits -eq '64' } |
Where-Object { $_.light -eq $false } |
Where-Object { $_.installer -eq 'exe' } |
Sort-Object -Descending @{ Expression = { [version]$_.basever } } |
Select-Object -First 1
[System.String]::Format("cache-key=openssl-{0}-win-{1}-{2}", $openSSL.basever, $openSSL.arch, $openSSL.bits) >> $env:GITHUB_OUTPUT
[System.String]::Format("url={0}", $openSSL.url) >> $env:GITHUB_OUTPUT
- name: Cache OpenSSL
id: cache-openssl
uses: actions/cache@v6
with:
path: ${{ env.OPENSSL_ROOT_DIR }}
key: ${{ steps.openssl-info.outputs.cache-key }}
- name: Download and install OpenSSL 3.x
if: ${{ steps.cache-openssl.outputs.cache-hit != 'true' }}
run: |
(New-Object System.Net.WebClient).DownloadFile("${{ steps.openssl-info.outputs.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
id: install-boost
with:
boost_version: 1.89.0
link: static
platform_version: 2022
toolset: msvc
- name: Configure CMake
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
OPENSSL_ROOT_DIR: C:/libs/openssl
run: >
cmake -S ${{ github.workspace }} -B build -G"Visual Studio 17 2022" -A x64
-DSCRIPTS=static
-DWITH_WARNINGS_AS_ERRORS=OFF
-DTOOLS=ON
- name: Build
run: >
cmake --build build --config RelWithDebInfo
- name: Copy Dependencies
shell: pwsh
run: |
cd build/bin/${{ env.CMAKE_BUILD_TYPE }}
Copy-Item "${{ env.MYSQL_ROOT_DIR }}/lib/libmysql.dll" .
# mysql may depend on a different version of openssl so copy its dlls first (override later with openssl's own if same version)
Copy-Item "${{ env.MYSQL_ROOT_DIR }}/bin/libcrypto-3-x64.dll" . -ErrorAction SilentlyContinue
Copy-Item "${{ env.MYSQL_ROOT_DIR }}/bin/libssl-3-x64.dll" . -ErrorAction SilentlyContinue
Copy-Item "${{ env.OPENSSL_ROOT_DIR }}/bin/libcrypto-3-x64.dll" . -ErrorAction SilentlyContinue
Copy-Item "${{ env.OPENSSL_ROOT_DIR }}/bin/libssl-3-x64.dll" . -ErrorAction SilentlyContinue
Copy-Item "${{ env.OPENSSL_ROOT_DIR }}/bin/legacy.dll" . -ErrorAction SilentlyContinue
- name: Check binaries
shell: pwsh
run: |
cd build/bin/${{ env.CMAKE_BUILD_TYPE }}
./bnetserver --version
./worldserver --version
- name: Create zip
shell: pwsh
run: |
cd build/bin
7z a TrinityCoreWin64VS2022.zip .\RelWithDebInfo\* | Out-Null
Remove-Item RelWithDebInfo\*.pdb
7z a TrinityCoreWin64VS2022NoSymbols.zip .\RelWithDebInfo\* | Out-Null
- name: Upload Artifacts
uses: actions/upload-artifact@v7
with:
name: TrinityCoreWin64VS2022
path: build/bin/TrinityCoreWin64VS2022.zip
if-no-files-found: error
- name: Upload Artifacts (NoSymbols)
uses: actions/upload-artifact@v7
with:
name: TrinityCoreWin64VS2022NoSymbols
path: build/bin/TrinityCoreWin64VS2022NoSymbols.zip
if-no-files-found: error
+3 -3
View File
@@ -5,14 +5,14 @@ WowCommunity Project is a World of Warcraft blizzlike design based on TrinityCor
# CI Status:
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/Thordekk/WowCommunityProject?branch=main&svg=true)](https://ci.appveyor.com/project/Thordekk/WowCommunityProject)
[![Build status](https://github.com/Thordekk/WowCommunityProject/actions/workflows/build.yml/badge.svg)](https://github.com/Thordekk/WowCommunityProject/actions/workflows/build.yml)
# Downloads:
- [TrinityCoreWin64VS2022 (x64, con símbolos)](https://ci.appveyor.com/api/projects/Thordekk/WowCommunityProject/artifacts/build/bin/TrinityCoreWin64VS2022.zip)
- [TrinityCoreWin64VS2022 (x64, con símbolos)](https://github.com/Thordekk/WowCommunityProject/actions/workflows/build.yml)
- [TrinityCoreWin64VS2022 (x64, sin símbolos)](https://ci.appveyor.com/api/projects/Thordekk/WowCommunityProject/artifacts/build/bin/TrinityCoreWin64VS2022NoSymbols.zip)
- [TrinityCoreWin64VS2022 (x64, sin símbolos)](https://github.com/Thordekk/WowCommunityProject/actions/workflows/build.yml)
# Developers: