@@ -157,6 +157,49 @@ jobs:
157157 dotnet build src/Couchbase.Analytics/Couchbase.Analytics.csproj -c Release --no-restore /p:ContinuousIntegrationBuild=true /p:Version="${{ needs.validate-inputs.outputs.tag }}" /p:IncludeSymbols=true /p:IncludeSource=true /p:SourceLinkCreate=true /p:SignAssembly=true /p:AssemblyOriginatorKeyFile="$env:SIGNKEY_PATH"
158158 dotnet pack src/Couchbase.Analytics/Couchbase.Analytics.csproj -c Release /p:ContinuousIntegrationBuild=true /p:Version="${{ needs.validate-inputs.outputs.tag }}" /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:IncludeSource=true /p:SourceLinkCreate=true /p:SignAssembly=true /p:AssemblyOriginatorKeyFile="$env:SIGNKEY_PATH"
159159
160+ - name : Verify package contents (DLL <-> PDB parity)
161+ shell : pwsh
162+ run : |
163+ $ver = "${{ needs.validate-inputs.outputs.tag }}"
164+ $packDir = "src/Couchbase.Analytics/bin/Release"
165+ $nupkg = Get-ChildItem -Path $packDir -Filter "*.$ver.nupkg" | Where-Object { $_.Name -notlike "*.symbols.nupkg" } | Select-Object -First 1
166+ $snupkg = Get-ChildItem -Path $packDir -Filter "*.$ver.snupkg" | Select-Object -First 1
167+ if (-not $nupkg) { Write-Error "No .nupkg matching version $ver found in $packDir"; exit 1 }
168+ if (-not $snupkg) { Write-Error "No .snupkg matching version $ver found in $packDir"; exit 1 }
169+
170+ Add-Type -AssemblyName System.IO.Compression.FileSystem
171+
172+ function Get-LibEntries($path, $extension) {
173+ $zip = [System.IO.Compression.ZipFile]::OpenRead($path)
174+ try {
175+ return @($zip.Entries | Where-Object { $_.FullName -like "lib/*$extension" } | ForEach-Object { $_.FullName })
176+ } finally {
177+ $zip.Dispose()
178+ }
179+ }
180+
181+ $dlls = Get-LibEntries $nupkg.FullName ".dll"
182+ $pdbs = Get-LibEntries $snupkg.FullName ".pdb"
183+
184+ Write-Host "DLLs in $($nupkg.Name):"
185+ $dlls | ForEach-Object { Write-Host " $_" }
186+ Write-Host "PDBs in $($snupkg.Name):"
187+ $pdbs | ForEach-Object { Write-Host " $_" }
188+
189+ # Every DLL shipped in lib/<tfm>/ must have a matching PDB at the same path in the symbol package.
190+ $missing = @()
191+ foreach ($dll in $dlls) {
192+ $expectedPdb = [System.IO.Path]::ChangeExtension($dll, ".pdb")
193+ if (-not ($pdbs -contains $expectedPdb)) {
194+ $missing += $expectedPdb
195+ }
196+ }
197+ if ($missing.Count -gt 0) {
198+ Write-Error ("Symbol package is missing PDB(s) for bundled DLL(s):`n " + ($missing -join "`n "))
199+ exit 1
200+ }
201+ Write-Host "Symbol package contains PDBs for all $($dlls.Count) bundled DLL(s)."
202+
160203 - name : Upload Packages Artifact
161204 uses : actions/upload-artifact@v4
162205 with :
0 commit comments