|
46 | 46 | with: |
47 | 47 | dotnet-version: 8.0.x |
48 | 48 |
|
| 49 | + # Show dotnet info for debugging architecture issues |
| 50 | + - name: Show .NET info |
| 51 | + run: dotnet --info |
| 52 | + |
49 | 53 | # Use the Dotnet Test command to load dependencies, build, and test the code. |
50 | 54 | # We have to run the test projects individually so CoseSignTool.Tests can run under arm64 on the Mac runner. |
51 | 55 | - name: Build and Test debug |
|
60 | 64 | dotnet test --no-restore CoseSign1.Transparent.CTS.Tests/CoseSign1.Transparent.CTS.Tests.csproj |
61 | 65 | dotnet test --no-restore CoseHandler.Tests/CoseHandler.Tests.csproj |
62 | 66 | dotnet test --no-restore CoseSignTool.Tests/CoseSignTool.Tests.csproj |
| 67 | + dotnet test --no-restore CoseSignTool.Abstractions.Tests/CoseSignTool.Abstractions.Tests.csproj |
| 68 | + dotnet test --no-restore CoseSignTool.CTS.Plugin.Tests/CoseSignTool.CTS.Plugin.Tests.csproj |
63 | 69 |
|
64 | 70 | # List the contents of the working directory to make sure all the artifacts are there. |
65 | 71 | - name: List working directory |
@@ -284,12 +290,77 @@ jobs: |
284 | 290 | # Running build and test separately because we can't pass the version number to dotnet test, or |
285 | 291 | # Setting the version number dynamically in the csproj files, using <FileVersion>$(VersionBin)</FileVersion> |
286 | 292 | shell: bash |
| 293 | + |
| 294 | + # Build and copy the CTS plugin to the plugins directory |
| 295 | + - name: Build and deploy CTS plugin |
| 296 | + run: | |
| 297 | + VERSION=${{ needs.create_release.outputs.tag_name }} |
| 298 | + |
| 299 | + # Build the CTS plugin |
| 300 | + dotnet build --configuration Debug --property:FileVersion=$VERSION CoseSignTool.CTS.Plugin/CoseSignTool.CTS.Plugin.csproj |
| 301 | + dotnet build --configuration Release --property:FileVersion=$VERSION CoseSignTool.CTS.Plugin/CoseSignTool.CTS.Plugin.csproj |
| 302 | + |
| 303 | + # Create plugins directories |
| 304 | + mkdir -p published/debug/plugins |
| 305 | + mkdir -p published/release/plugins |
| 306 | + |
| 307 | + # Copy the CTS plugin DLL to the plugins directories |
| 308 | + cp CoseSignTool.CTS.Plugin/bin/Debug/net8.0/CoseSignTool.CTS.Plugin.dll published/debug/plugins/ |
| 309 | + cp CoseSignTool.CTS.Plugin/bin/Release/net8.0/CoseSignTool.CTS.Plugin.dll published/release/plugins/ |
| 310 | + |
| 311 | + # Copy plugin-specific dependencies that aren't already in the main application |
| 312 | + # These are the Azure-specific libraries that the plugin needs but the main app doesn't include |
| 313 | + |
| 314 | + # Function to safely copy dependencies |
| 315 | + copy_if_exists() { |
| 316 | + if [ -f "$1" ]; then |
| 317 | + cp "$1" "$2" |
| 318 | + echo "Copied: $1 -> $2" |
| 319 | + else |
| 320 | + echo "Not found (skipping): $1" |
| 321 | + fi |
| 322 | + } |
| 323 | + |
| 324 | + # Copy Azure.Security.CodeTransparency (plugin-specific) |
| 325 | + copy_if_exists "CoseSignTool.CTS.Plugin/bin/Debug/net8.0/Azure.Security.CodeTransparency.dll" "published/debug/plugins/" |
| 326 | + copy_if_exists "CoseSignTool.CTS.Plugin/bin/Release/net8.0/Azure.Security.CodeTransparency.dll" "published/release/plugins/" |
| 327 | + |
| 328 | + # Copy other Azure dependencies that might not be in main app |
| 329 | + copy_if_exists "CoseSignTool.CTS.Plugin/bin/Debug/net8.0/Azure.dll" "published/debug/plugins/" |
| 330 | + copy_if_exists "CoseSignTool.CTS.Plugin/bin/Release/net8.0/Azure.dll" "published/release/plugins/" |
| 331 | + copy_if_exists "CoseSignTool.CTS.Plugin/bin/Debug/net8.0/Azure.Identity.dll" "published/debug/plugins/" |
| 332 | + copy_if_exists "CoseSignTool.CTS.Plugin/bin/Release/net8.0/Azure.Identity.dll" "published/release/plugins/" |
| 333 | + |
| 334 | + # Copy Core Azure dependencies |
| 335 | + copy_if_exists "CoseSignTool.CTS.Plugin/bin/Debug/net8.0/Azure.Core.dll" "published/debug/plugins/" |
| 336 | + copy_if_exists "CoseSignTool.CTS.Plugin/bin/Release/net8.0/Azure.Core.dll" "published/release/plugins/" |
| 337 | + |
| 338 | + echo "CTS Plugin deployment completed." |
| 339 | + shell: bash |
287 | 340 |
|
288 | 341 | # List the contents of the published directory to make sure all the artifacts are there. |
289 | 342 | - name: List published directory |
290 | 343 | run: ${{ matrix.dir_command }} |
291 | 344 | working-directory: ./published |
292 | 345 |
|
| 346 | + # Verify the CTS plugin was properly deployed |
| 347 | + - name: Verify CTS plugin deployment |
| 348 | + run: | |
| 349 | + echo "Checking if CTS plugin exists in debug build:" |
| 350 | + ls -la published/debug/plugins/ || echo "Debug plugins directory not found" |
| 351 | + |
| 352 | + echo "Checking if CTS plugin exists in release build:" |
| 353 | + ls -la published/release/plugins/ || echo "Release plugins directory not found" |
| 354 | + |
| 355 | + echo "Testing plugin discovery (debug build):" |
| 356 | + cd published/debug |
| 357 | + ./CoseSignTool --help | grep -i "cts" || echo "CTS plugin commands not found in help output" |
| 358 | + |
| 359 | + echo "Testing plugin discovery (release build):" |
| 360 | + cd ../release |
| 361 | + ./CoseSignTool --help | grep -i "cts" || echo "CTS plugin commands not found in help output" |
| 362 | + shell: bash |
| 363 | + |
293 | 364 | # Verify that the file versions on the DLLs match the release version |
294 | 365 | - name: Check File Version |
295 | 366 | run: | |
|
0 commit comments