|
35 | 35 | - name: Build (${{ matrix.config }}) |
36 | 36 | run: cmake --build ${{ github.workspace }}\build --config ${{ matrix.config }} -- /m |
37 | 37 |
|
38 | | - # CI artifacts (for convenience): DLLs + PDBs if present (no .lib, no .exe) |
| 38 | + # CI artifacts (convenience): DLLs + PDBs if present (no .lib, no .exe) |
39 | 39 | - name: Upload CI artifacts (${{ matrix.config }}) |
40 | 40 | uses: actions/upload-artifact@v4 |
41 | 41 | with: |
|
47 | 47 |
|
48 | 48 | # ----- Release publishing (only when a GitHub Release is published) ----- |
49 | 49 |
|
50 | | - # Remove any existing assets with same names (prevents stale zips) |
| 50 | + # Remove any existing assets with same names to avoid stale uploads |
51 | 51 | - name: Remove existing assets |
52 | 52 | if: github.event_name == 'release' && github.event.action == 'published' |
53 | 53 | uses: actions/github-script@v7 |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 |
|
71 | | - # Stage and zip EXACT files (DLLs only; symbols only) so .lib can never slip in |
| 71 | + # Stage and zip EXACT files; print zip contents; fail if any .lib is present |
72 | 72 | - name: Package (${{ matrix.config }}) |
73 | 73 | if: github.event_name == 'release' && github.event.action == 'published' |
74 | 74 | shell: pwsh |
@@ -101,18 +101,44 @@ jobs: |
101 | 101 | if (Test-Path $zipBin) { Remove-Item $zipBin -Force } |
102 | 102 | if (Test-Path $zipSym) { Remove-Item $zipSym -Force } |
103 | 103 |
|
104 | | - if (Test-Path "$stage\binaries") { |
105 | | - $binFiles = Get-ChildItem "$stage\binaries" -File |
106 | | - if ($binFiles) { Compress-Archive -Path ($binFiles | Select-Object -Expand FullName) -DestinationPath $zipBin -Force } |
| 104 | + $binFiles = Get-ChildItem "$stage\binaries" -File | Select-Object -Expand FullName |
| 105 | + if ($binFiles) { Compress-Archive -Path $binFiles -DestinationPath $zipBin -Force } |
| 106 | +
|
| 107 | + if ($cfg -eq "Debug") { |
| 108 | + $symFiles = Get-ChildItem "$stage\symbols" -File | Select-Object -Expand FullName |
| 109 | + if ($symFiles) { Compress-Archive -Path $symFiles -DestinationPath $zipSym -Force } |
107 | 110 | } |
108 | 111 |
|
109 | | - if ($cfg -eq "Debug" -and (Test-Path "$stage\symbols")) { |
110 | | - $symFiles = Get-ChildItem "$stage\symbols" -File |
111 | | - if ($symFiles) { Compress-Archive -Path ($symFiles | Select-Object -Expand FullName) -DestinationPath $zipSym -Force } |
| 112 | + # --- Print and verify zip entries (no .lib allowed) --- |
| 113 | + Add-Type -AssemblyName System.IO.Compression.FileSystem |
| 114 | +
|
| 115 | + function Show-And-VerifyZip([string]$zipPath, [string]$label) { |
| 116 | + if (Test-Path $zipPath) { |
| 117 | + $z = [System.IO.Compression.ZipFile]::OpenRead($zipPath) |
| 118 | + try { |
| 119 | + Write-Host "ZIP ($label): $zipPath" |
| 120 | + foreach ($e in $z.Entries) { |
| 121 | + Write-Host " - $($e.FullName)" |
| 122 | + if ($e.FullName.ToLower().EndsWith('.lib')) { |
| 123 | + throw "Found .lib in $zipPath: $($e.FullName)" |
| 124 | + } |
| 125 | + } |
| 126 | + } finally { $z.Dispose() } |
| 127 | + } else { |
| 128 | + Write-Host "ZIP ($label): (not created)" |
| 129 | + } |
112 | 130 | } |
113 | 131 |
|
| 132 | + Show-And-VerifyZip $zipBin "binaries" |
| 133 | + if ($cfg -eq "Debug") { Show-And-VerifyZip $zipSym "symbols" } |
| 134 | +
|
| 135 | + # Also show what we staged (human-friendly) |
114 | 136 | Write-Host "Binaries staged:"; Get-ChildItem "$stage\binaries" -File | ForEach-Object { Write-Host " $($_.Name)" } |
115 | | - Write-Host "Symbols staged:"; if ($cfg -eq "Debug") { Get-ChildItem "$stage\symbols" -File | ForEach-Object { Write-Host " $($_.Name)" } } else { Write-Host " (none for Release)" } |
| 137 | + if ($cfg -eq "Debug") { |
| 138 | + Write-Host "Symbols staged:"; Get-ChildItem "$stage\symbols" -File | ForEach-Object { Write-Host " $($_.Name)" } |
| 139 | + } else { |
| 140 | + Write-Host "Symbols staged: (none for Release)" |
| 141 | + } |
116 | 142 |
|
117 | 143 | # Upload assets to the GitHub Release |
118 | 144 | - name: Upload Debug assets |
|
0 commit comments