Skip to content

Commit

Permalink
Set up build signing pipeline with Azure Pipelines (#606)
Browse files Browse the repository at this point in the history
Also:
* Created solution just for building DurableTask.AzureStorage and DurableTask.Core
* Removed legacy static analysis, which was only working for net461 anyways
* Updated some test projects from .net core 2.1 (out of support) to .net core 3.1
  • Loading branch information
cgillum committed Sep 9, 2021
1 parent 1071bd7 commit c8df4ab
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 9 deletions.
103 changes: 103 additions & 0 deletions azure-pipelines-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
trigger: none
pr: none

pool:
vmImage: 'windows-latest'

steps:
# Start by restoring all the dependencies. This needs to be its own task
# from what I can tell. We specifically only target DurableTask.AzureStorage
# and its direct dependencies.
- task: DotNetCoreCLI@2
displayName: 'Restore nuget dependencies'
inputs:
command: restore
verbosityRestore: Minimal
projects: 'src/DurableTask.AzureStorage/DurableTask.AzureStorage.sln'

# Build the filtered solution in release mode, specifying the continuous integration flag.
- task: VSBuild@1
displayName: 'Build'
inputs:
solution: 'src/DurableTask.AzureStorage/DurableTask.AzureStorage.sln'
vsVersion: '16.0'
logFileVerbosity: minimal
configuration: Release
msbuildArgs: /p:GITHUB_RUN_NUMBER=$(Build.BuildId) /p:ContinuousIntegrationBuild=true

# Authenticode sign all the DLLs with the Microsoft certificate.
# This appears to be an in-place signing job, which is convenient.
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'ESRP CodeSigning: Authenticode'
inputs:
ConnectedServiceName: 'ESRP Service'
FolderPath: 'src'
Pattern: 'DurableTask.*.dll'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolSign",
"Parameters": {
"OpusName": "Microsoft",
"OpusInfo": "http://www.microsoft.com",
"FileDigest": "/fd \"SHA256\"",
"PageHash": "/NPH",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
# Packaging needs to be a separate step from build.
# This will automatically pick up the signed DLLs.
- task: DotNetCoreCLI@2
displayName: Generate nuget packages
inputs:
command: pack
verbosityPack: Minimal
configuration: Release
nobuild: true
packDirectory: $(build.artifactStagingDirectory)
packagesToPack: 'src/DurableTask.AzureStorage/DurableTask.AzureStorage.sln'

# Digitally sign all the nuget packages with the Microsoft certificate.
# This appears to be an in-place signing job, which is convenient.
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'ESRP CodeSigning: Nupkg'
inputs:
ConnectedServiceName: 'ESRP Service'
FolderPath: $(build.artifactStagingDirectory)
Pattern: '*.nupkg'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-401405",
"OperationCode": "NuGetVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
# Make the nuget packages available for download in the ADO portal UI
- publish: $(build.artifactStagingDirectory)
displayName: 'Publish nuget packages to Artifacts'
artifact: PackageOutput
58 changes: 58 additions & 0 deletions src/DurableTask.AzureStorage/DurableTask.AzureStorage.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31702.391
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{501E1168-418C-4832-B88C-617735BD02C9}"
ProjectSection(SolutionItems) = preProject
..\..\.nuget\NuGet.Config = ..\..\.nuget\NuGet.Config
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DBCD161C-D409-48E5-924E-9B7FA1C36B84}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{C0904C83-9993-49FA-A49C-C019AEB86C68}"
ProjectSection(SolutionItems) = preProject
..\..\tools\DurableTask.props = ..\..\tools\DurableTask.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DurableTask.Core", "..\DurableTask.Core\DurableTask.Core.csproj", "{C8634F14-BE3B-4685-B0E1-C5726F8F3758}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DurableTask.AzureStorage", "DurableTask.AzureStorage.csproj", "{F1B270EA-9DC2-4753-B3DE-B45D3C128FDB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C8634F14-BE3B-4685-B0E1-C5726F8F3758}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C8634F14-BE3B-4685-B0E1-C5726F8F3758}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8634F14-BE3B-4685-B0E1-C5726F8F3758}.Debug|x64.ActiveCfg = Debug|Any CPU
{C8634F14-BE3B-4685-B0E1-C5726F8F3758}.Debug|x64.Build.0 = Debug|Any CPU
{C8634F14-BE3B-4685-B0E1-C5726F8F3758}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C8634F14-BE3B-4685-B0E1-C5726F8F3758}.Release|Any CPU.Build.0 = Release|Any CPU
{C8634F14-BE3B-4685-B0E1-C5726F8F3758}.Release|x64.ActiveCfg = Release|Any CPU
{C8634F14-BE3B-4685-B0E1-C5726F8F3758}.Release|x64.Build.0 = Release|Any CPU
{F1B270EA-9DC2-4753-B3DE-B45D3C128FDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F1B270EA-9DC2-4753-B3DE-B45D3C128FDB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F1B270EA-9DC2-4753-B3DE-B45D3C128FDB}.Debug|x64.ActiveCfg = Debug|Any CPU
{F1B270EA-9DC2-4753-B3DE-B45D3C128FDB}.Debug|x64.Build.0 = Debug|Any CPU
{F1B270EA-9DC2-4753-B3DE-B45D3C128FDB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F1B270EA-9DC2-4753-B3DE-B45D3C128FDB}.Release|Any CPU.Build.0 = Release|Any CPU
{F1B270EA-9DC2-4753-B3DE-B45D3C128FDB}.Release|x64.ActiveCfg = Release|Any CPU
{F1B270EA-9DC2-4753-B3DE-B45D3C128FDB}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{C8634F14-BE3B-4685-B0E1-C5726F8F3758} = {DBCD161C-D409-48E5-924E-9B7FA1C36B84}
{F1B270EA-9DC2-4753-B3DE-B45D3C128FDB} = {DBCD161C-D409-48E5-924E-9B7FA1C36B84}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EnterpriseLibraryConfigurationToolBinariesPath = packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4
SolutionGuid = {2D63A120-9394-48D9-8CA9-1184364FB854}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),DurableTask.sln))\tools\DurableTask.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net461</TargetFrameworks>
</PropertyGroup>


Expand All @@ -13,7 +13,7 @@
<PackageReference Include="WindowsAzure.Storage" version="7.2.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<ItemGroup Condition="'$(TargetFramework)' != 'net461'">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.5.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.6" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),DurableTask.sln))\tools\DurableTask.props" />
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net461;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 0 additions & 6 deletions tools/DurableTask.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
<LangVersion>8.0</LangVersion>
<!-- See https://github.com/Azure/durabletask/issues/428 -->
<NoWarn>NU5125,NU5048</NoWarn>
<!-- Code Analysis Settings -->
<RunCodeAnalysis>True</RunCodeAnalysis>
<RunCodeAnalysis Condition=" '$(Configuration)' == 'Debug' ">False</RunCodeAnalysis>
<!-- Disable code analysis for netstandard2.0: https://github.com/dotnet/core/issues/758 -->
<RunCodeAnalysis Condition=" '$(TargetFramework)' == 'netstandard2.0'">False</RunCodeAnalysis>
<CodeAnalysisTreatWarningsAsErrors>True</CodeAnalysisTreatWarningsAsErrors>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<!-- SourceLink Settings-->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down

0 comments on commit c8df4ab

Please sign in to comment.