-
Notifications
You must be signed in to change notification settings - Fork 5
115 lines (91 loc) · 3.83 KB
/
release.yml
File metadata and controls
115 lines (91 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Build and Release DLLs
on:
push:
branches:
- main
- refactor-uco2-v120
tags:
- "v*.*.*"
workflow_dispatch:
permissions:
contents: write
jobs:
build-release:
name: Build and Release
runs-on: windows-2022
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up MSBuild
uses: microsoft/setup-msbuild@v2
- name: Build x86 version (steam_api.dll)
run: msbuild uc_online2.vcxproj -p:Configuration=Release -p:Platform=Win32 -m
- name: Build x64 version (steam_api64.dll)
run: msbuild uc_online2.vcxproj -p:Configuration=Release -p:Platform=x64 -m
- name: Build x86 version debug (steam_api.dll)
run: msbuild uc_online2.vcxproj -p:Configuration=Debug -p:Platform=Win32 -m
- name: Build x64 version debug (steam_api64.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: |
$packageRootrel = "dist/uc-online2-${{ github.ref_name }}-release"
$archivePathrel = "$packageRootrel.zip"
New-Item -ItemType Directory -Path "$packageRootrel/x86" -Force | Out-Null
New-Item -ItemType Directory -Path "$packageRootrel/x64" -Force | Out-Null
Copy-Item "relbuild/x86/steam_api.dll" "$packageRootrel/x86/steam_api.dll"
Copy-Item "relbuild/x64/steam_api64.dll" "$packageRootrel/x64/steam_api64.dll"
if (Test-Path $archivePathrel) {
Remove-Item $archivePathrel -Force
}
Compress-Archive -Path $packageRootrel -DestinationPath $archivePathrel
- name: Package debug zip
shell: pwsh
run: |
$packageRootdeb = "dist/uc-online2-${{ github.ref_name }}-debug"
$archivePathdeb = "$packageRootdeb.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 release artifact
uses: actions/upload-artifact@v4
with:
name: uc-online2-${{ github.ref_name }}-release
path: dist/uc-online2-${{ github.ref_name }}-release.zip
if-no-files-found: error
- name: Upload debug artifact
uses: actions/upload-artifact@v4
with:
name: uc-online2-${{ github.ref_name }}-debug
path: dist/uc-online2-${{ github.ref_name }}-debug.zip
if-no-files-found: error
- name: Publish release assets
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
files: |
dist/uc-online2-${{ github.ref_name }}-release.zip
dist/uc-online2-${{ github.ref_name }}-debug.zip
generate_release_notes: true
fail_on_unmatched_files: true