Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up release build #2571

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions build/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
- 'Check Roslyn Results '
- [template-sign-binary.yaml](template-sign-binary.yaml) - Sign the binaries, requires dotnet core 2.x.
- [template-pack-and-sign-all-nugets.yaml](template-pack-and-sign-all-nugets.yaml)
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web')`
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.UI')`
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.MicrosoftGraph')`
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.MicrosoftGraphBeta')`
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\ProjectTemplates')`
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.TokenCache')`
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.TokenAcquisition')`
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.Certificate')`
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.Certificateless')`
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.OWIN')`
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.DownstreamApi')`
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.GraphServiceClient')`
- [template-pack-and-sign-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.GraphServiceClientBeta')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.UI')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.MicrosoftGraph')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.MicrosoftGraphBeta')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\ProjectTemplates')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.TokenCache')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.TokenAcquisition')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.Certificate')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.Certificateless')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.OWIN')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.DownstreamApi')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.GraphServiceClient')`
- [template-pack-nuget.yaml](template-pack-and-sign-nuget.yaml) `('$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.GraphServiceClientBeta')`
- 'Copy Files from `$(Build.SourcesDirectory)` to: `$(Build.ArtifactStagingDirectory)\packages'`
- Sign Packages `'('$(Build.ArtifactStagingDirectory)\packages')`
- [template-publish-packages-and-symbols.yaml](template-publish-packages-and-symbols.yaml)
Expand Down
129 changes: 95 additions & 34 deletions build/template-pack-and-sign-all-nugets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ parameters:
BuildConfiguration: 'release'
NugetPackagesWildcard: '$(Build.ArtifactStagingDirectory)\packages\*.nupkg'


steps:

# The signing task requires dotnet core 2.x
Expand All @@ -14,100 +13,161 @@ steps:
inputs:
version: 2.x

# Pack and sign Microsoft.Identity.Web
- template: template-pack-and-sign-nuget.yaml
- task: EsrpCodeSigning@4
inputs:
ConnectedServiceName: 'IDDP Code Signing'
FolderPath: '$(Build.SourcesDirectory)\src'
Pattern: 'Microsoft.Identity.Web*.dll'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft.Identity.Web"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd sha256"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [ ],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
}
]
SessionTimeout: '60'
MaxConcurrency: '50'
MaxRetryAttempts: '5'
PendingAnalysisWaitTimeoutMinutes: '5'

- task: BinSkim@4
inputs:
InputType: Basic
AnalyzeTargetGlob: '$(Build.SourcesDirectory)\src\**\bin\**\Microsoft.Identity.Web*.dll'
AnalyzeVerbose: true
AnalyzeHashes: true
toolVersion: Exact

- task: PostAnalysis@2
displayName: 'Check BinSkim Results'
inputs:
GdnBreakGdnToolBinSkim: true

# Pack Microsoft.Identity.Web
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web'
AssemblyName: 'Microsoft.Identity.Web'
HasRefAssembly: 'false'

# Pack and sign Microsoft.Identity.Web.UI
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.UI
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.UI'
AssemblyName: 'Microsoft.Identity.Web.UI*'

# Pack and sign Microsoft.Identity.Web.MicrosoftGraph
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.MicrosoftGraph
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.MicrosoftGraph'
AssemblyName: 'Microsoft.Identity.Web.MicrosoftGraph*'

# Pack and sign Microsoft.Identity.Web.MicrosoftGraphBeta
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.MicrosoftGraphBeta
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.MicrosoftGraphBeta'
AssemblyName: 'Microsoft.Identity.Web.MicrosoftGraphBeta*'

# Pack and sign Microsoft.Identity.Web.GraphServiceClient
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.GraphServiceClient
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.GraphServiceClient'
AssemblyName: 'Microsoft.Identity.Web.GraphServiceClient*'

# Pack and sign Microsoft.Identity.Web.GraphServiceClientBeta
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.GraphServiceClientBeta
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.GraphServiceClientBeta'
AssemblyName: 'Microsoft.Identity.Web.GraphServiceClientBeta*'

# Pack and sign Microsoft.Identity.Web.TokenCache
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.TokenCache
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.TokenCache'
AssemblyName: 'Microsoft.Identity.Web.TokenCache*'

# Pack and sign Microsoft.Identity.Web.TokenAcquisition
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.TokenAcquisition
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.TokenAcquisition'
AssemblyName: 'Microsoft.Identity.Web.TokenAcquisition*'

# Pack and sign Microsoft.Identity.Web.Certificate
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.Certificate
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.Certificate'
AssemblyName: 'Microsoft.Identity.Web.Certificate*'

# Pack and sign Microsoft.Identity.Web.Certificateless
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.Certificateless
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.Certificateless'
AssemblyName: 'Microsoft.Identity.Web.Certificateless*'

# Pack and sign Microsoft.Identity.Web.OWIN
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.OWIN
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.OWIN'
AssemblyName: 'Microsoft.Identity.Web.OWIN*'

# Pack and sign Microsoft.Identity.Web.DownstreamApi
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.DownstreamApi
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.DownstreamApi'
AssemblyName: 'Microsoft.Identity.Web.DownstreamApi*'

# Pack and sign Microsoft.Identity.Web.Diagnostics
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.Diagnostics
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.Diagnostics'
AssemblyName: 'Microsoft.Identity.Web.Diagnostics*'

# Pack and sign Microsoft.Identity.Web.Diagnostics
- template: template-pack-and-sign-nuget.yaml
# Pack Microsoft.Identity.Web.Diagnostics
- template: template-pack-nuget.yaml
parameters:
BuildConfiguration: ${{ parameters.BuildConfiguration }}
ProjectRootPath: '$(Build.SourcesDirectory)\src\Microsoft.Identity.Web.Azure'
Expand All @@ -123,7 +183,7 @@ steps:
flattenFolders: true

# Sign all final nuget packages in the staging directory
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
- task: EsrpCodeSigning@4
displayName: 'Sign Packages'
inputs:
ConnectedServiceName: 'IDDP Code Signing'
Expand All @@ -147,9 +207,10 @@ steps:
"toolVersion": "1.0"
}
]
SessionTimeout: 20
VerboseLogin: true
timeoutInMinutes: 5
SessionTimeout: '60'
MaxConcurrency: '50'
MaxRetryAttempts: '5'
PendingAnalysisWaitTimeoutMinutes: '5'

- task: NuGetCommand@2
displayName: 'Verify packages are signed'
Expand Down
87 changes: 0 additions & 87 deletions build/template-pack-and-sign-nuget.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions build/template-pack-nuget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

parameters:
BuildConfiguration: 'release'
NoBuild: 'true'
ProjectRootPath: ''
AssemblyName: ''

steps:

# Pack a nuget
- task: DotNetCoreCLI@2
displayName: 'Pack ${{ parameters.ProjectRootPath }}\${{ parameters.AssemblyName }}.csproj'
inputs:
command: pack
projects: '${{ parameters.ProjectRootPath }}\${{ parameters.AssemblyName }}.csproj'
nobuild: '${{parameters.NoBuild}}'
packagesToPack: '${{ parameters.ProjectRootPath }}\${{ parameters.AssemblyName }}.csproj'
IncludeSymbols: true
verbosityPack: normal
packDirectory:
arguments: '--configuration ${{ parameters.BuildConfiguration }}'
Loading