1+ name : Build and Release DLLs
2+
3+ on :
4+ push :
5+ tags :
6+ - " v*.*.*"
7+ workflow_dispatch :
8+
9+ permissions :
10+ contents : write
11+
12+ jobs :
13+ build-release :
14+ name : Build and Release
15+ runs-on : windows-2022
16+
17+ steps :
18+ - name : Check out repo
19+ uses : actions/checkout@v4
20+
21+ - name : Set up MSBuild
22+ uses : microsoft/setup-msbuild@v2
23+
24+ - name : Build x86 version (steam_api.dll)
25+ run : msbuild uc_online2.vcxproj -p:Configuration=Release -p:Platform=Win32 -m
26+
27+ - name : Build x64 version (steam_api64.dll)
28+ run : msbuild uc_online2.vcxproj -p:Configuration=Release -p:Platform=x64 -m
29+
30+ - name : Verify build outputs
31+ shell : pwsh
32+ run : |
33+ $files = @(
34+ "build/x86/steam_api.dll",
35+ "build/x64/steam_api64.dll"
36+ )
37+
38+ foreach ($file in $files) {
39+ if (-not (Test-Path $file)) {
40+ throw "Missing expected build output: $file"
41+ }
42+ }
43+
44+ - name : Package release zip
45+ shell : pwsh
46+ run : |
47+ $packageRoot = "dist/uc-online2-${{ github.ref_name }}"
48+ $archivePath = "$packageRoot.zip"
49+
50+ New-Item -ItemType Directory -Path "$packageRoot/x86" -Force | Out-Null
51+ New-Item -ItemType Directory -Path "$packageRoot/x64" -Force | Out-Null
52+
53+ Copy-Item "build/x86/steam_api.dll" "$packageRoot/x86/steam_api.dll"
54+ Copy-Item "build/x64/steam_api64.dll" "$packageRoot/x64/steam_api64.dll"
55+
56+ if (Test-Path $archivePath) {
57+ Remove-Item $archivePath -Force
58+ }
59+
60+ Compress-Archive -Path $packageRoot -DestinationPath $archivePath
61+
62+ - name : Upload workflow artifact
63+ uses : actions/upload-artifact@v4
64+ with :
65+ name : uc-online2-${{ github.ref_name }}
66+ path : dist/uc-online2-${{ github.ref_name }}.zip
67+ if-no-files-found : error
68+
69+ - name : Publish release assets
70+ if : startsWith(github.ref, 'refs/tags/')
71+ uses : softprops/action-gh-release@v2
72+ with :
73+ tag_name : ${{ github.ref_name }}
74+ name : ${{ github.ref_name }}
75+ files : dist/uc-online2-${{ github.ref_name }}.zip
76+ generate_release_notes : true
77+ fail_on_unmatched_files : true
0 commit comments