forked from jasongdove/LegionCore-7.3.5
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add windows x64 workflow (jasongdove#38)
* add windows workflow * not ready for warnings as errors * update output path on windows * try to fix windows output directory again * fix worldserver version command
- Loading branch information
1 parent
fffde3d
commit 2b1a16e
Showing
5 changed files
with
113 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Windows x64 | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
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@v4 | ||
|
||
- name: Set reusable strings | ||
id: strings | ||
shell: bash | ||
run: | | ||
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | ||
- 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@v4 | ||
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/[email protected] | ||
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: | ||
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | ||
run: > | ||
cmake -GNinja -S ${{ github.workspace }} -B ${{ steps.strings.outputs.build-output-dir }} | ||
-DTOOLS=ON | ||
- name: Build | ||
run: | | ||
cmake --build ${{ steps.strings.outputs.build-output-dir }} | ||
- name: Copy Dependencies | ||
run: | | ||
cd ${{ steps.strings.outputs.build-output-dir }}/bin/${{ env.CMAKE_BUILD_TYPE }} | ||
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/${{ env.CMAKE_BUILD_TYPE }} | ||
./bnetserver --version | ||
./worldserver --version | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: ${{ steps.strings.outputs.build-output-dir }}/bin/${{ env.CMAKE_BUILD_TYPE }} | ||
name: LegionCoreMainWin64VS2022 | ||
# Set a custom retention for artifacts | ||
#retention-days: 7 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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