Repository navigation
fix(fg): avoid global provider shutdown after device shutdown #36
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
| # 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')) { | |
| $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" } | |
| } | |
| $command = 'call "' + $vcvars + '" && python tests\test_shutdown_routing.py --compiler cl' | |
| & $env:ComSpec /d /c $command | |
| if ($LASTEXITCODE) { throw 'Shutdown routing test failed' } | |
| - 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 |