Skip to content

Commit 3f26acf

Browse files
committed
.azure-pipelines/release.yml: add .NET Tool release pipeline
Add a release pipeline for the .NET Tool using Azure Pipelines. Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
1 parent eb21840 commit 3f26acf

1 file changed

Lines changed: 110 additions & 0 deletions

File tree

.azure-pipelines/release.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,3 +560,113 @@ extends:
560560
"Parameters": {}
561561
}
562562
]
563+
564+
#
565+
# .NET Tool / NuGet Package build jobs
566+
#
567+
- job: nuget_package
568+
displayName: '.NET Tool NuGet Package'
569+
pool:
570+
name: GitClientPME-1ESHostedPool-intel-pc
571+
image: ubuntu-x86_64-ado1es
572+
os: linux
573+
variables:
574+
version: $[stageDependencies.prebuild.vars.outputs['version.value']]
575+
templateContext:
576+
outputs:
577+
- output: pipelineArtifact
578+
targetPath: '$(Build.ArtifactStagingDirectory)/payload'
579+
artifactName: 'nuget_payload'
580+
- output: pipelineArtifact
581+
targetPath: '$(Build.ArtifactStagingDirectory)/packages'
582+
artifactName: 'nuget_packages'
583+
steps:
584+
- checkout: self
585+
- task: UseDotNet@2
586+
displayName: 'Use .NET 8 SDK'
587+
inputs:
588+
packageType: sdk
589+
version: '8.x'
590+
- task: Bash@3
591+
displayName: 'Build payload'
592+
inputs:
593+
targetType: filePath
594+
filePath: './src/shared/DotnetTool/layout.sh'
595+
arguments: |
596+
--configuration="Release" \
597+
--output="$(Build.ArtifactStagingDirectory)/payload"
598+
- task: EsrpCodeSigning@5
599+
condition: and(succeeded(), eq('${{ parameters.esrp }}', true))
600+
displayName: 'Sign payload'
601+
inputs:
602+
connectedServiceName: '$(esrpAppConnectionName)'
603+
useMSIAuthentication: true
604+
appRegistrationClientId: '$(esrpClientId)'
605+
appRegistrationTenantId: '$(esrpTenantId)'
606+
authAkvName: '$(esrpKeyVaultName)'
607+
authSignCertName: '$(esrpSignReqCertName)'
608+
serviceEndpointUrl: '$(esrpEndpointUrl)'
609+
folderPath: '$(Build.ArtifactStagingDirectory)/payload'
610+
pattern: |
611+
**/*.exe
612+
**/*.dll
613+
useMinimatch: true
614+
signConfigType: inlineSignParams
615+
inlineOperation: |
616+
[
617+
{
618+
"KeyCode": "CP-230012",
619+
"OperationCode": "SigntoolSign",
620+
"ToolName": "sign",
621+
"ToolVersion": "1.0",
622+
"Parameters": {
623+
"OpusName": "Microsoft",
624+
"OpusInfo": "https://www.microsoft.com",
625+
"FileDigest": "/fd SHA256",
626+
"PageHash": "/NPH",
627+
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
628+
}
629+
},
630+
{
631+
"KeyCode": "CP-230012",
632+
"OperationCode": "SigntoolVerify",
633+
"ToolName": "sign",
634+
"ToolVersion": "1.0",
635+
"Parameters": {}
636+
}
637+
]
638+
- task: Bash@3
639+
displayName: 'Create NuGet package'
640+
inputs:
641+
targetType: filePath
642+
filePath: './src/shared/DotnetTool/pack.sh'
643+
arguments: |
644+
--configuration=Release \
645+
--version="$(version)" \
646+
--package-root="$(Build.ArtifactStagingDirectory)/payload" \
647+
--output="$(Build.ArtifactStagingDirectory)/packages"
648+
- task: EsrpCodeSigning@5
649+
condition: and(succeeded(), eq('${{ parameters.esrp }}', true))
650+
displayName: 'Sign NuGet package'
651+
inputs:
652+
connectedServiceName: '$(esrpAppConnectionName)'
653+
useMSIAuthentication: true
654+
appRegistrationClientId: '$(esrpClientId)'
655+
appRegistrationTenantId: '$(esrpTenantId)'
656+
authAkvName: '$(esrpKeyVaultName)'
657+
authSignCertName: '$(esrpSignReqCertName)'
658+
serviceEndpointUrl: '$(esrpEndpointUrl)'
659+
folderPath: '$(Build.ArtifactStagingDirectory)/packages'
660+
pattern: '**/*.nupkg'
661+
useMinimatch: true
662+
signConfigType: inlineSignParams
663+
inlineOperation: |
664+
[
665+
{
666+
"KeyCode": "CP-401405",
667+
"OperationCode": "NuGetSign",
668+
"ToolName": "sign",
669+
"ToolVersion": "1.0",
670+
"Parameters": {}
671+
}
672+
]

0 commit comments

Comments
 (0)