Skip to content

Commit

Permalink
Update code-signing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kenelin committed Apr 7, 2022
1 parent 6a943d1 commit bc0caa7
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,6 @@ Task("Sign-Assemblies")
.IsDependentOn("Run-Sonar-End")
.Does(() =>
{
var currentSignTimestamp = DateTime.Now;
Information($"Last timestamp: {lastSignTimestamp}");
Information($"Current timestamp: {currentSignTimestamp}");
var signKey = "./temp/key.pfx";
System.IO.File.WriteAllBytes(
signKey,
Expand All @@ -334,27 +331,9 @@ Task("Sign-Assemblies")
};
foreach (var targetPlatform in targetPlatforms)
{
var file = $"./temp/{configuration}/{product}/bin/{targetPlatform}/{product}.dll";
var totalTimeInMilli = (DateTime.Now - lastSignTimestamp).TotalMilliseconds;
if (totalTimeInMilli < signIntervalInMilli)
{
System.Threading.Thread.Sleep(signIntervalInMilli - (int)totalTimeInMilli);
}
Sign(
file,
new SignToolSignSettings
{
CertPath = signKey,
Password = signPass,
TimeStampUri = signSha1Uri
}
);
lastSignTimestamp = DateTime.Now;
System.Threading.Thread.Sleep(signIntervalInMilli);
Sign(
file,
$"./temp/{configuration}/{product}/bin/{targetPlatform}/{product}.dll",
new SignToolSignSettings
{
AppendSignature = true,
Expand All @@ -365,7 +344,6 @@ Task("Sign-Assemblies")
TimeStampUri = signSha256Uri
}
);
lastSignTimestamp = DateTime.Now;
}
});

Expand Down

0 comments on commit bc0caa7

Please sign in to comment.