Repository navigation
157 lines (130 loc) · 6.77 KB
/
Copy pathjust_build_no_signature.yml
File metadata and controls
157 lines (130 loc) · 6.77 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Build Aurora (No Signing) / 构建 Aurora(未签名)
on:
workflow_dispatch:
push:
branches: [ "aurora", "Compatibility-fixes" ]
# pull_request:
# branches: [ "master" ]
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
# Configuration type to build.
BUILD_CONFIGURATION: Release
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
environment: Build
steps:
- name: Checkout / 检出源码
uses: actions/checkout@v6
with:
submodules: 'true'
- name: Extract version / 读取版本号
id: get_version
working-directory: ${{ github.workspace }}
shell: powershell
run: |
$resourceFile = ".\OptiScaler\resource.h"
if (-Not (Test-Path $resourceFile)) {
Write-Error "File not found: $resourceFile"
exit 1
}
$resourceLines = Get-Content $resourceFile
$auroraLine = $resourceLines | Select-String -Pattern '^\s*#define\s+VER_AURORA_VERSION\s+"([^"]+)"' | Select-Object -First 1
if (-Not $auroraLine) {
Write-Error "VER_AURORA_VERSION not found in $resourceFile"
exit 1
}
$auroraVersion = $auroraLine.Matches[0].Groups[1].Value
$version = "v$auroraVersion"
$date = Get-Date -Format "yyyyMMdd"
$outputFileName = "OptiScaler_Aurora_${version}_${date}"
if ($env:GITHUB_REF_NAME -eq 'Compatibility-fixes') {
$outputFileName += "_compat_" + $env:GITHUB_SHA.Substring(0,8)
}
Write-Output "Generated Filename: $outputFileName"
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
"filename=$outputFileName" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
continue-on-error: false
- name: Debug outputs / 检查版本信息
run: |
echo "Version: ${{ steps.get_version.outputs.version }}"
echo "Filename: ${{ steps.get_version.outputs.filename }}"
- name: Add MSBuild to PATH / 配置 MSBuild
uses: microsoft/setup-msbuild@v2
- name: Build / 构建
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} /verbosity:minimal
- name: Add README / 添加说明文档
run: Copy-Item ${{ github.workspace }}\README.md ${{ github.workspace }}\x64\Release\a\README.md
# Streamline 2.14 is included in every Aurora package.
- name: Add Streamline 2.14 / 添加 Streamline 2.14
shell: powershell
run: |
$target = "${{ github.workspace }}\x64\Release\a\OptiScaler\streamline"
New-Item -ItemType Directory -Force -Path $target | Out-Null
Copy-Item ${{ github.workspace }}\dist\streamline\* $target
# DLSS 310.9 snippets already tracked in dist/nvngx are included in every Aurora package.
- name: Add DLSS 310.9 snippets / 添加 DLSS 310.9 运行库
shell: powershell
run: |
$target = "${{ github.workspace }}\x64\Release\a\OptiScaler"
New-Item -ItemType Directory -Force -Path $target | Out-Null
Copy-Item ${{ github.workspace }}\dist\nvngx\* $target
# nvngx_dlssnr.dll is too large for normal Git and public forks cannot upload new LFS objects.
# Keep it as a dedicated Release asset, download it at build time, and verify the exact tested file.
- name: Add DLSS Neural Rendering runtime / 添加 DLSS 神经渲染运行库
shell: powershell
run: |
$url = "https://github.com/abc354402600/OptiScaler-Aurora/releases/download/aurora-runtime-dlssnr-310.8/nvngx_dlssnr.dll"
$target = "${{ github.workspace }}\x64\Release\a\OptiScaler\nvngx_dlssnr.dll"
$expectedSha256 = "e67dee209320cdafe0e93e45675d7aa34323a53acc57a72b2e40a181581c989a"
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri $url -OutFile $target
$actualSha256 = (Get-FileHash $target -Algorithm SHA256).Hash.ToLowerInvariant()
if ($actualSha256 -ne $expectedSha256) {
Write-Error "nvngx_dlssnr.dll SHA256 mismatch. Expected $expectedSha256, got $actualSha256"
exit 1
}
Write-Output "DLSS Neural Rendering runtime verified: $actualSha256"
- name: Add Runtime Sync / 添加运行库同步工具
shell: powershell
run: |
Copy-Item "${{ github.workspace }}\dist\runtime_sync\runtime_sync.ps1" "${{ github.workspace }}\x64\Release\a\runtime_sync.ps1"
Copy-Item "${{ github.workspace }}\dist\runtime_sync\Check_DLSS_Runtime.bat" "${{ github.workspace }}\x64\Release\a\Check_DLSS_Runtime.bat"
- name: Test compatibility lifecycle guards
shell: powershell
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vs = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
$vcvars = Join-Path $vs 'VC\Auxiliary\Build\vcvars64.bat'
foreach ($name in @('Aurora_DLSSG_Frame_Guard_Tests','Aurora_Provider_Handle_Tests','Aurora_Input_Lock_Tests','Aurora_Streamline_Binding_Tests','Aurora_Provider_Create_Tests','Aurora_Provider_Publication_Tests','Aurora_Native_Device_Tests')) {
$command = 'call "' + $vcvars + '" && cl /nologo /EHsc /std:c++20 /I OptiScaler tests\' + $name + '.cpp /Fe:x64\' + $name + '.exe && x64\' + $name + '.exe'
& $env:ComSpec /d /c $command
if ($LASTEXITCODE) { throw "Compatibility guard test failed: $name" }
}
foreach ($script in @('test_shutdown_routing.py','test_provider_publication_routes.py','test_provider_dll_boundary.py','test_combo_release.py','test_native_operation_routes.py','test_native_module_publication.py','test_native_init_scopes.py')) {
$command = 'call "' + $vcvars + '" && python tests\' + $script + ' --compiler cl'
& $env:ComSpec /d /c $command
if ($LASTEXITCODE) { throw "Compatibility routing test failed: $script" }
}
- name: Package Aurora / 打包 Aurora
shell: powershell
run: |
$zipName = "${{ steps.get_version.outputs.filename }}.7z"
7z a -r ${{ github.workspace }}\$zipName ${{ github.workspace }}\x64\Release\a\*.*
continue-on-error: false
- name: Upload Aurora artifact / 上传 Aurora 构建产物
uses: actions/upload-artifact@v7.0.0
with:
name: '${{ steps.get_version.outputs.filename }}'
path: '${{ github.workspace }}\${{ steps.get_version.outputs.filename }}.7z'
archive: false
compression-level: 0
if-no-files-found: error