File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 Remove-Item -Recurse -Force Publish, Pure3DDataViewer.zip -ErrorAction Ignore
3434 New-Item -ItemType Directory -Force Publish\Plugins | Out-Null
3535
36+ - name : Inject commit hash into FrmMain.cs
37+ run : |
38+ $file = "Pure3DDataViewer/Pure3DDataViewer/FrmMain.cs"
39+ $commit = "${{ github.sha }}".Substring(0,7)
40+
41+ $content = Get-Content $file -Raw
42+
43+ $pattern = '\{Text\}\s+v\{version\}'
44+ $replacement = "{Text} v{version}-$commit"
45+
46+ $newContent = [regex]::Replace($content, $pattern, $replacement)
47+
48+ if ($content -eq $newContent) {
49+ Write-Host "Pattern did not match. Dumping nearby lines for debugging:"
50+ Get-Content $file | Select-String "_Text"
51+ exit 1
52+ } else {
53+ Write-Host "Commit hash injected: -$commit"
54+ }
55+
56+ Set-Content $file $newContent
57+
3658 - name : Publish main app
3759 run : |
3860 dotnet publish Pure3DDataViewer/Pure3DDataViewer/Pure3DDataViewer.csproj -c Release -r win-x64 -p:PublishSingleFile=true --self-contained false -o Pure3DDataViewer/Pure3DDataViewer/bin/publish
You can’t perform that action at this time.
0 commit comments