Skip to content

Commit 30d66c2

Browse files
Merge pull request #139 from microsoft/users/jstatia/integrate_transparency_to_exe
This PR introduces a plug-in model to CoseSignTool and adds the code transparency service plug-in as the first plug-in
2 parents dee3d10 + c9f9809 commit 30d66c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+5011
-118
lines changed

.github/workflows/dotnet.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ jobs:
4646
with:
4747
dotnet-version: 8.0.x
4848

49+
# Show dotnet info for debugging architecture issues
50+
- name: Show .NET info
51+
run: dotnet --info
52+
4953
# Use the Dotnet Test command to load dependencies, build, and test the code.
5054
# We have to run the test projects individually so CoseSignTool.Tests can run under arm64 on the Mac runner.
5155
- name: Build and Test debug
@@ -60,6 +64,8 @@ jobs:
6064
dotnet test --no-restore CoseSign1.Transparent.CTS.Tests/CoseSign1.Transparent.CTS.Tests.csproj
6165
dotnet test --no-restore CoseHandler.Tests/CoseHandler.Tests.csproj
6266
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
6369
6470
# List the contents of the working directory to make sure all the artifacts are there.
6571
- name: List working directory
@@ -284,12 +290,77 @@ jobs:
284290
# Running build and test separately because we can't pass the version number to dotnet test, or
285291
# Setting the version number dynamically in the csproj files, using <FileVersion>$(VersionBin)</FileVersion>
286292
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
287340

288341
# List the contents of the published directory to make sure all the artifacts are there.
289342
- name: List published directory
290343
run: ${{ matrix.dir_command }}
291344
working-directory: ./published
292345

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+
293364
# Verify that the file versions on the DLLs match the release version
294365
- name: Check File Version
295366
run: |

0 commit comments

Comments
 (0)