Create 700main.yml #5
This file contains hidden or 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
| name: π 400Build OTX Server | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: π₯ Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: ποΈ Cache Boost | |
| uses: actions/cache@v4 | |
| id: cache-boost | |
| with: | |
| path: | | |
| C:\ProgramData\chocolatey\lib\boost-msvc-14.3 | |
| C:\local\boost_1_84_0 | |
| key: boost-1.84.0-msvc-14.3-${{ runner.os }} | |
| - name: π¦ Install Boost | |
| if: steps.cache-boost.outputs.cache-hit != 'true' | |
| run: | | |
| echo "[INSTALL] Installing Boost libraries..." | |
| choco install boost-msvc-14.3 --version=1.84.0 -y | |
| if (!(Test-Path "C:\local")) { New-Item -ItemType Directory -Path "C:\local" } | |
| if (!(Test-Path "C:\local\boost_1_84_0")) { | |
| New-Item -ItemType SymbolicLink -Path "C:\local\boost_1_84_0" -Target "C:\ProgramData\chocolatey\lib\boost-msvc-14.3\tools" | |
| } | |
| echo "[OK] Boost installation completed!" | |
| shell: powershell | |
| - name: π Create Boost Symlink | |
| if: steps.cache-boost.outputs.cache-hit == 'true' | |
| run: | | |
| echo "[CACHE] Using cached Boost libraries..." | |
| if (!(Test-Path "C:\local")) { New-Item -ItemType Directory -Path "C:\local" } | |
| if (!(Test-Path "C:\local\boost_1_84_0")) { | |
| New-Item -ItemType SymbolicLink -Path "C:\local\boost_1_84_0" -Target "C:\ProgramData\chocolatey\lib\boost-msvc-14.3\tools" | |
| } | |
| echo "[OK] Boost symlink created!" | |
| shell: powershell | |
| - name: πΎ Cache MSBuild Objects | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| sources/msvc/x64 | |
| sources/msvc/*.tlog | |
| key: msbuild-cache-${{ runner.os }}-${{ hashFiles('sources/**/*.cpp', 'sources/**/*.h') }} | |
| restore-keys: | | |
| msbuild-cache-${{ runner.os }}- | |
| - name: π§ Setup MSBuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: ποΈ Build OTX Server | |
| run: | | |
| echo "[BUILD] Starting OTX Server compilation..." | |
| msbuild sources/msvc/TheOTXServer.vcxproj /p:Configuration=Release /p:Platform=x64 /m | |
| echo "[OK] Build completed successfully!" | |
| shell: powershell | |
| - name: π Prepare Artifacts | |
| run: | | |
| echo [PREPARE] Preparing build artifacts... | |
| mkdir artifact-staging | |
| copy sources\msvc\x64\Release\*.exe artifact-staging\ | |
| echo [OK] Artifacts prepared! | |
| shell: cmd | |
| - name: β¬οΈ Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: π― otx-server-build | |
| path: artifact-staging/ | |
| - name: π Build Success Notification | |
| if: success() | |
| run: | | |
| echo "[SUCCESS] OTX Server build completed successfully!" | |
| echo "[INFO] Compiled on: $(Get-Date -Format 'dd MMM yyyy, HH:mm:ss')" | |
| echo "[INFO] Artifact: otx-server-build" | |
| echo "[INFO] Download your build from the Actions tab" | |
| shell: powershell | |
| - name: β Build Failure Notification | |
| if: failure() | |
| run: | | |
| echo "[FAILED] BUILD FAILED! Please check the logs above for errors." | |
| echo "[HELP] Common issues: Missing dependencies, compilation errors" | |
| shell: powershell |