diff --git a/build.fsx b/build.fsx index feabb813..5c7170b5 100644 --- a/build.fsx +++ b/build.fsx @@ -470,6 +470,16 @@ Target "OpenBlasWinTest" DoNothing "OpenBlasWin64Build" ==> "OpenBlasWin64Test" ==> "OpenBlasWinTest" +// -------------------------------------------------------------------------------------- +// CODE SIGN +// -------------------------------------------------------------------------------------- + +Target "Sign" (fun _ -> + let fingerprint = "5dbea70701b40cab1b2ca62c75401342b4f0f03a" + let timeserver = "http://time.certum.pl/" + sign fingerprint timeserver (!! "src/Numerics/bin/Release/**/MathNet.Numerics.dll" )) + + // -------------------------------------------------------------------------------------- // PACKAGES // -------------------------------------------------------------------------------------- @@ -489,7 +499,7 @@ Target "Zip" (fun _ -> coreBundle |> zip "out/packages/Zip" "out/lib" (fun f -> f.Contains("MathNet.Numerics.") || f.Contains("System.Threading.") || f.Contains("FSharp.Core.")) if hasBuildParam "signed" || hasBuildParam "release" then coreSignedBundle |> zip "out/packages/Zip" "out/lib-signed" (fun f -> f.Contains("MathNet.Numerics."))) -"Build" ==> "Zip" ==> "Pack" +"Build" =?> ("Sign", hasBuildParam "sign") ==> "Zip" ==> "Pack" Target "DataZip" (fun _ -> CleanDir "out/Data/packages/Zip" @@ -533,7 +543,7 @@ Target "NuGet" (fun _ -> // nugetPack coreSignedBundle "out/packages/NuGet" //if hasBuildParam "all" || hasBuildParam "release" then // nugetPack coreBundle "out/packages/NuGet") -"Build" ==> "NuGet" ==> "Pack" +"Build" =?> ("Sign", hasBuildParam "sign") ==> "NuGet" ==> "Pack" Target "DataNuGet" (fun _ -> CleanDir "out/Data/packages/NuGet" diff --git a/build/build-framework.fsx b/build/build-framework.fsx index 17aa2767..b76dace1 100644 --- a/build/build-framework.fsx +++ b/build/build-framework.fsx @@ -202,6 +202,21 @@ let provideNuGetExtraFiles path (bundle:Bundle) (pack:Package) = provideFsLoader includes path provideFsIfSharpLoader path +// SIGN + +let sign fingerprint timeserver files = + files + |> Seq.map (sprintf "\"%s\"") + |> Seq.map (fun file -> sprintf """sign /v /sha1 "%s" /t "%s" %s""" fingerprint timeserver file) + |> Seq.iter (fun arguments -> + let result = + ExecProcess (fun info -> + info.FileName <- """C:\Program Files (x86)\Windows Kits\10\bin\x86\signtool.exe""" + info.Arguments <- arguments) TimeSpan.MaxValue + if result <> 0 then + failwithf "Error during SignTool call ") + + // ZIP let zip zipDir filesDir filesFilter (bundle:Bundle) =