Skip to content

Commit 70b2954

Browse files
BuildCommand: verify NuGet package signatures after signing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1eb4018 commit 70b2954

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/PostSharp.Engineering.BuildTools/Build/BuildCommand.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,21 @@ void Sign( string filter )
293293
return false;
294294
}
295295

296+
// Verify signed NuGet packages.
297+
foreach ( var nupkg in Directory.EnumerateFiles( publicArtifactsDirectory, "*.nupkg" ) )
298+
{
299+
if ( !ToolInvocationHelper.InvokeTool(
300+
context.Console,
301+
"dotnet",
302+
$"nuget verify --all \"{nupkg}\"",
303+
context.RepoDirectory ) )
304+
{
305+
context.Console.WriteError( $"Signature verification failed for '{Path.GetFileName( nupkg )}'." );
306+
307+
return false;
308+
}
309+
}
310+
296311
// Zipping public artifacts.
297312
CreateZip( publicArtifactsDirectory );
298313

0 commit comments

Comments
 (0)