Skip to content

Commit 5e4b28e

Browse files
committed
build: create unified Aurora package
1 parent 9cbba9a commit 5e4b28e

1 file changed

Lines changed: 56 additions & 76 deletions

File tree

‎.github/workflows/just_build_no_signature.yml‎

Lines changed: 56 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,20 @@
33
# separate terms of service, privacy policy, and support
44
# documentation.
55

6-
name: Build (No Signing)
6+
name: Build Aurora (No Signing) / 构建 Aurora(未签名)
77

88
on:
99
workflow_dispatch:
1010
push:
11-
branches: [ "dlss-neural-rendering" ]
11+
branches: [ "aurora" ]
1212
# pull_request:
1313
# branches: [ "master" ]
14-
14+
1515
env:
1616
# Path to the solution file relative to the root of the project.
1717
SOLUTION_FILE_PATH: .
1818

1919
# Configuration type to build.
20-
# You can convert this to a build matrix if you need coverage of multiple configuration types.
21-
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
2220
BUILD_CONFIGURATION: Release
2321

2422
permissions:
@@ -30,46 +28,42 @@ jobs:
3028
environment: Build
3129

3230
steps:
33-
- uses: actions/checkout@v6
31+
- name: Checkout / 检出源码
32+
uses: actions/checkout@v6
3433
with:
3534
submodules: 'true'
36-
37-
- name: Extract Version
35+
36+
- name: Extract version / 读取版本号
3837
id: get_version
3938
working-directory: ${{ github.workspace }}
4039
shell: powershell
4140
run: |
42-
# Ensure the file exists before proceeding
4341
$resourceFile = ".\OptiScaler\resource.h"
4442
if (-Not (Test-Path $resourceFile)) {
4543
Write-Error "File not found: $resourceFile"
4644
exit 1
4745
}
48-
49-
# Helper function to extract the first matching line for a version component
46+
5047
function Get-Version-Component {
5148
param (
5249
[string]$pattern,
5350
[string]$replacement
5451
)
55-
# Use Select-String and take only the first match
52+
5653
$line = Get-Content $resourceFile | Select-String -Pattern $pattern | Select-Object -First 1
5754
if ($line) {
5855
return ($line.Line -replace $replacement).Trim()
59-
} else {
60-
Write-Error "Pattern not found: $pattern"
61-
exit 1
6256
}
57+
58+
Write-Error "Pattern not found: $pattern"
59+
exit 1
6360
}
64-
65-
# Extract version components (only the first match for each pattern)
61+
6662
$majorVersion = Get-Version-Component 'VER_MAJOR_VERSION' '#define VER_MAJOR_VERSION\s+'
6763
$minorVersion = Get-Version-Component 'VER_MINOR_VERSION' '#define VER_MINOR_VERSION\s+'
6864
$hotfixVersion = Get-Version-Component 'VER_HOTFIX_VERSION' '#define VER_HOTFIX_VERSION\s+'
6965
$buildVersion = Get-Version-Component 'VER_BUILD_NUMBER' '#define VER_BUILD_NUMBER\s+'
70-
71-
# Release flavour and fork tag, so the archive name matches VER_PRODUCT_VERSION_STR.
72-
# Anchoring on #define skips the #ifdef and #ifndef lines that carry the same names.
66+
7367
$resourceLines = Get-Content $resourceFile
7468
$devRelease = $resourceLines | Select-String -Pattern '^\s*#define\s+VER_DEV_RELEASE' -Quiet
7569
$forkLine = $resourceLines | Select-String -Pattern '^\s*#define\s+VER_FORK_TAG' | Select-Object -First 1
@@ -79,94 +73,80 @@ jobs:
7973
8074
if ($devRelease) { $suffix = "-dev" } else { $suffix = "-pre$buildVersion" }
8175
82-
# Merge into a single version string
8376
$version = "v$majorVersion.$minorVersion.$hotfixVersion$suffix$forkTag"
84-
85-
# Get the current date in a specific format (e.g., YYYYMMDD)
8677
$date = Get-Date -Format "yyyyMMdd"
87-
88-
# Construct the output filename with version and date
89-
$outputFileName = "OptiScaler_${version}_${date}"
90-
91-
# Output the generated filename
78+
$outputFileName = "OptiScaler_Aurora_${version}_${date}"
79+
9280
Write-Output "Generated Filename: $outputFileName"
93-
94-
# Write outputs to GITHUB_OUTPUT
9581
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
9682
"filename=$outputFileName" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
97-
83+
9884
continue-on-error: false
99-
100-
- name: Debug Outputs
85+
86+
- name: Debug outputs / 检查版本信息
10187
run: |
10288
echo "Version: ${{ steps.get_version.outputs.version }}"
10389
echo "Filename: ${{ steps.get_version.outputs.filename }}"
104-
105-
- name: Add MSBuild to PATH
90+
91+
- name: Add MSBuild to PATH / 配置 MSBuild
10692
uses: microsoft/setup-msbuild@v2
10793

108-
- name: Build
94+
- name: Build / 构建
10995
working-directory: ${{env.GITHUB_WORKSPACE}}
110-
# Add additional options to the MSBuild command line here (like platform or verbosity level).
111-
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
11296
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} /verbosity:minimal
113-
114-
# Into the build output, so the glob below picks it up with everything else.
115-
- name: Add the readme
97+
98+
- name: Add README / 添加说明文档
11699
run: Copy-Item ${{ github.workspace }}\dist\README.md ${{ github.workspace }}\x64\Release\a\README.md
117100

118-
# Always stage the validated runtime set before creating the normal artifact.
119-
# This prevents the default download from silently falling back to the game's
120-
# older DLSS / Streamline copies.
121-
- name: Add Streamline to default artifact
101+
# Streamline 2.14 is included in every Aurora package.
102+
- name: Add Streamline 2.14 / 添加 Streamline 2.14
103+
shell: powershell
122104
run: |
123105
$target = "${{ github.workspace }}\x64\Release\a\OptiScaler\streamline"
124106
New-Item -ItemType Directory -Force -Path $target | Out-Null
125107
Copy-Item ${{ github.workspace }}\dist\streamline\* $target
126108
127-
- name: Add NGX snippets to default artifact
128-
run: Copy-Item ${{ github.workspace }}\dist\nvngx\* ${{ github.workspace }}\x64\Release\a\OptiScaler\
129-
130-
# The normal artifact is now the full DLSS 310.9 + Streamline 2.14 bundle.
131-
- name: Compress the artifact
109+
# DLSS 310.9 snippets already tracked in dist/nvngx are included in every Aurora package.
110+
- name: Add DLSS 310.9 snippets / 添加 DLSS 310.9 运行库
111+
shell: powershell
132112
run: |
133-
$zipName = "${{ steps.get_version.outputs.filename }}.7z"
134-
7z a -r ${{ github.workspace }}\$zipName ${{ github.workspace }}\x64\Release\a\*.*
113+
$target = "${{ github.workspace }}\x64\Release\a\OptiScaler"
114+
New-Item -ItemType Directory -Force -Path $target | Out-Null
115+
Copy-Item ${{ github.workspace }}\dist\nvngx\* $target
135116
136-
continue-on-error: false
117+
# nvngx_dlssnr.dll is too large for normal Git and public forks cannot upload new LFS objects.
118+
# Keep it as a dedicated Release asset, download it at build time, and verify the exact tested file.
119+
- name: Add DLSS Neural Rendering runtime / 添加 DLSS 神经渲染运行库
120+
shell: powershell
121+
run: |
122+
$url = "https://github.com/abc354402600/OptiScaler-Community-Fixes/releases/download/aurora-runtime-dlssnr-310.8/nvngx_dlssnr.dll"
123+
$target = "${{ github.workspace }}\x64\Release\a\OptiScaler\nvngx_dlssnr.dll"
124+
$expectedSha256 = "e67dee209320cdafe0e93e45675d7aa34323a53acc57a72b2e40a181581c989a"
137125
138-
- uses: actions/upload-artifact@v7.0.0
139-
with:
140-
name: '${{ steps.get_version.outputs.filename }}'
141-
path: '${{ github.workspace }}\${{ steps.get_version.outputs.filename }}.7z'
142-
archive: false
143-
compression-level: 0
144-
if-no-files-found: error
126+
$ProgressPreference = 'SilentlyContinue'
127+
Invoke-WebRequest -Uri $url -OutFile $target
145128
146-
# Streamline 2.14. A game carrying an older set stops at 2X whatever the ini asks for, and the
147-
# recovery step in the readme is to copy these over the ones it ships.
148-
- name: Add Streamline
149-
run: |
150-
$target = "${{ github.workspace }}\x64\Release\a\OptiScaler\streamline"
151-
New-Item -ItemType Directory -Force -Path $target | Out-Null
152-
Copy-Item ${{ github.workspace }}\dist\streamline\* $target
129+
$actualSha256 = (Get-FileHash $target -Algorithm SHA256).Hash.ToLowerInvariant()
130+
if ($actualSha256 -ne $expectedSha256) {
131+
Write-Error "nvngx_dlssnr.dll SHA256 mismatch. Expected $expectedSha256, got $actualSha256"
132+
exit 1
133+
}
153134
154-
# DLSS 310.9 snippets. OptiScaler searches its own folder ahead of the exe folder, so these
155-
# are picked up without touching what the game ships. nvngx_dlssnr.dll is not among them.
156-
- name: Add NGX snippets
157-
run: Copy-Item ${{ github.workspace }}\dist\nvngx\* ${{ github.workspace }}\x64\Release\a\OptiScaler\
135+
Write-Output "DLSS Neural Rendering runtime verified: $actualSha256"
158136
159-
- name: Compress the artifact with the redistributables
137+
- name: Package Aurora / 打包 Aurora
138+
shell: powershell
160139
run: |
161-
$zipName = "${{ steps.get_version.outputs.filename }}_with_DLSS.7z"
140+
$zipName = "${{ steps.get_version.outputs.filename }}.7z"
162141
7z a -r ${{ github.workspace }}\$zipName ${{ github.workspace }}\x64\Release\a\*.*
163142
164143
continue-on-error: false
165144

166-
- uses: actions/upload-artifact@v7.0.0
145+
- name: Upload Aurora artifact / 上传 Aurora 构建产物
146+
uses: actions/upload-artifact@v7.0.0
167147
with:
168-
name: '${{ steps.get_version.outputs.filename }}_with_DLSS'
169-
path: '${{ github.workspace }}\${{ steps.get_version.outputs.filename }}_with_DLSS.7z'
148+
name: '${{ steps.get_version.outputs.filename }}'
149+
path: '${{ github.workspace }}\${{ steps.get_version.outputs.filename }}.7z'
170150
archive: false
171151
compression-level: 0
172152
if-no-files-found: error

0 commit comments

Comments
 (0)