@@ -12,11 +12,15 @@ $artifacts = Join-Path $root 'artifacts'
1212$portable = Join-Path $artifacts ' portable'
1313$payload = Join-Path $root ' src\DarksFIDO2.Setup\Payload'
1414$out = Join-Path $artifacts ' release'
15+ $providerProject = Join-Path $root ' src\DarksFIDO2.Provider\DarksFIDO2.Provider.csproj'
16+ [xml ]$providerProjectXml = Get-Content - LiteralPath $providerProject - Raw
17+ $version = @ ($providerProjectXml.Project.PropertyGroup.Version | Where-Object { $_ })[0 ]
18+ if (! $version ) { throw ' The provider project version is missing.' }
1519
1620Remove-Item $artifacts - Recurse - Force - ErrorAction SilentlyContinue
1721New-Item $portable , $payload , $out - ItemType Directory - Force | Out-Null
1822
19- & $dotnet restore (Join-Path $root ' DarksFIDO2.slnx' ) -- locked- mode
23+ & $dotnet restore (Join-Path $root ' DarksFIDO2.slnx' ) -- locked- mode - r $Runtime - p:PublishReadyToRun = true
2024if ($LASTEXITCODE -ne 0 ) { throw ' Locked dependency restore failed.' }
2125
2226# Keep the GUI self-contained but multi-file. A single-file WPF bundle extracts a full
@@ -42,6 +46,7 @@ foreach ($name in 'DarksFIDO2.exe','darksfido-cli.exe','DarksFIDO2.Provider.exe'
4246& (Join-Path $PSScriptRoot ' build-provider-package.ps1' ) - ProviderExecutable (Join-Path $portable ' DarksFIDO2.Provider.exe' ) - OutputPath $providerPackage - CertificateThumbprint $CertificateThumbprint - MakeAppx $makeAppx - SignTool $signTool - TimestampServer $TimestampServer
4347Copy-Item $providerPackage (Join-Path $portable ' DarksFIDO2.Provider.msix' ) - Force
4448Copy-Item $providerPackage (Join-Path $payload ' DarksFIDO2.Provider.msix' ) - Force
49+ Copy-Item $providerPackage (Join-Path $out ' DarksFIDO2.Provider.msix' ) - Force
4550$certificatePath = Join-Path $out ' DarksFIDO2-Signing-Public.cer'
4651Export-Certificate - Cert (" Cert:\CurrentUser\My\" + $CertificateThumbprint ) - FilePath $certificatePath - Force | Out-Null
4752
@@ -69,4 +74,17 @@ $setup = Join-Path $artifacts 'setup\DarksFIDO2-Setup.exe'
6974& $signTool sign / sha1 $CertificateThumbprint / fd SHA256 / tr $TimestampServer / td SHA256 $setup | Out-Null
7075if ($LASTEXITCODE -ne 0 ) { throw ' Setup signing failed.' }
7176Copy-Item $setup (Join-Path $out ' DarksFIDO2-Setup.exe' ) - Force
77+ $releaseNotes = Join-Path $root " RELEASE-NOTES-$version .md"
78+ $securityAudit = Join-Path $root " SECURITY-AUDIT-$version .md"
79+ if (! (Test-Path - LiteralPath $releaseNotes ) -or ! (Test-Path - LiteralPath $securityAudit )) {
80+ throw " Release notes and security audit are required for version $version ."
81+ }
82+ Copy-Item $releaseNotes , $securityAudit - Destination $out - Force
83+ $checksumLines = Get-ChildItem - LiteralPath $out - File |
84+ Sort-Object Name |
85+ ForEach-Object { " $ ( Get-FileHash - LiteralPath $_.FullName - Algorithm SHA256 | Select-Object - ExpandProperty Hash) *$ ( $_.Name ) " }
86+ [IO.File ]::WriteAllLines(
87+ (Join-Path $out ' SHA256SUMS.txt' ),
88+ [string []]$checksumLines ,
89+ [Text.UTF8Encoding ]::new($false ))
7290Get-ChildItem $out | Select-Object Name, Length, LastWriteTime
0 commit comments