github is really stupid for this. #53
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: Pull Request Build | |
| on: | |
| pull_request: | |
| jobs: | |
| build: | |
| name: Build DLLs | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up MSBuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Build release Win32 DLL | |
| run: msbuild uc_online2.vcxproj -p:Configuration=Release -p:Platform=Win32 -m | |
| - name: Build release x64 DLL | |
| run: msbuild uc_online2.vcxproj -p:Configuration=Release -p:Platform=x64 -m | |
| - name: Build debug Win32 DLL | |
| run: msbuild uc_online2.vcxproj -p:Configuration=Debug -p:Platform=Win32 -m | |
| - name: Build debug x64 DLL | |
| run: msbuild uc_online2.vcxproj -p:Configuration=Debug -p:Platform=x64 -m | |
| - name: Verify build outputs | |
| shell: pwsh | |
| run: | | |
| $files = @( | |
| "relbuild/x86/steam_api.dll", | |
| "relbuild/x64/steam_api64.dll" | |
| "debbuild/x86/steam_api.dll", | |
| "debbuild/x64/steam_api64.dll" | |
| ) | |
| foreach ($file in $files) { | |
| if (-not (Test-Path $file)) { | |
| throw "Missing expected build output: $file" | |
| } | |
| } | |
| - name: Package release zip | |
| shell: pwsh | |
| run: | | |
| $packageRoot = "dist/uc-online2-${{ github.ref_name }}.release" | |
| $archivePath = "$packageRoot.zip" | |
| New-Item -ItemType Directory -Path "$packageRoot/x86" -Force | Out-Null | |
| New-Item -ItemType Directory -Path "$packageRoot/x64" -Force | Out-Null | |
| Copy-Item "relbuild/x86/steam_api.dll" "$packageRoot/x86/steam_api.dll" | |
| Copy-Item "relbuild/x64/steam_api64.dll" "$packageRoot/x64/steam_api64.dll" | |
| if (Test-Path $archivePath) { | |
| Remove-Item $archivePath -Force | |
| } | |
| Compress-Archive -Path $packageRoot -DestinationPath $archivePath | |
| - name: Package debug zip | |
| shell: pwsh | |
| run: | | |
| $packageRootdeb = "dist/uc-online2-${{ github.ref_name }}.debug" | |
| $archivePathdeb = "$packageRoot.zip" | |
| New-Item -ItemType Directory -Path "$packageRootdeb/x86" -Force | Out-Null | |
| New-Item -ItemType Directory -Path "$packageRootdeb/x64" -Force | Out-Null | |
| Copy-Item "debbuild/x86/steam_api.dll" "$packageRootdeb/x86/steam_api.dll" | |
| Copy-Item "debbuild/x64/steam_api64.dll" "$packageRootdeb/x64/steam_api64.dll" | |
| if (Test-Path $archivePathdeb) { | |
| Remove-Item $archivePathdeb -Force | |
| } | |
| Compress-Archive -Path $packageRootdeb -DestinationPath $archivePathdeb | |
| - name: Upload workflow artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: | | |
| uc-online2-${{ github.ref_name }}.release | |
| uc-online2-${{ github.ref_name }}.debug | |
| path: | | |
| dist/uc-online2-${{ github.ref_name }}.release.zip | |
| dist/uc-online2-${{ github.ref_name }}.debug.zip | |
| if-no-files-found: error |