Repository navigation
178 lines (148 loc) · 8.27 KB
/
Copy pathjust_build_no_signature.yml
File metadata and controls
178 lines (148 loc) · 8.27 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# 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" ]
tags: [ "aurora-v1.1.1" ]
# 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@v3
- 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
- name: Verify official runtime inventory
shell: powershell
run: .\scripts\verify_runtime_inventory.ps1
# Streamline 2.14.1 is included in every Aurora package.
- name: Add Streamline 2.14.1 / 添加 Streamline 2.14.1
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
# Official production DLSS 310.9.1 runtimes are included in every Aurora package.
- name: Add DLSS 310.9.1 / 添加 DLSS 310.9.1 运行库
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
Copy-Item "${{ github.workspace }}\dist\runtime_versions.json" "$target\runtime_versions.json"
.\scripts\verify_runtime_inventory.ps1 -PackageRoot "${{ github.workspace }}\x64\Release\a"
# 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 runtime version preservation
shell: powershell
run: .\tests\test_runtime_no_downgrade.ps1
- 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','Aurora_Provider_Publication_Allocation_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_october_compatibility.py','test_vulkan_timing_results.py','test_depth_copy_resource.py','test_hud_publication.py','test_hud_copy_failure.py','test_shutdown_routing.py','test_provider_publication_routes.py','test_provider_dll_boundary.py','test_combo_release.py','test_combo_shutdown.py','test_native_operation_routes.py','test_native_module_publication.py','test_native_init_scopes.py', 'test_exported_init_chains.py','test_ngx_init_paths.py','test_ngx_init_metadata.py','test_provider_release_admission.py','test_provider_call_admission.py','test_provider_init_footprint.py','test_provider_handle_api.py','test_upstream_resource_guards.py','test_provider_settings.py','test_provider_shutdown_drain.py','test_ffx_release.py','test_ffx_create.py','test_combo_create.py','test_provider_init_allocation.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\*.*
if ($LASTEXITCODE) { throw '7z packaging failed' }
7z t "$zipName"
if ($LASTEXITCODE) { throw '7z archive verification failed' }
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
- name: Publish Aurora v1.1.1 / 发布正式版
if: github.ref == 'refs/tags/aurora-v1.1.1'
shell: powershell
env:
GH_TOKEN: ${{ github.token }}
run: .\scripts\publish_aurora_release.ps1 -Archive '${{ steps.get_version.outputs.filename }}.7z'