Skip to content

Commit 68d6cd6

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 <[email protected]>
1 parent 296838c commit 68d6cd6

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed

.azure-pipelines/release.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,3 +599,121 @@ extends:
599599
cp $(Build.ArtifactStagingDirectory)/installers/*.tar.gz $(Build.ArtifactStagingDirectory)/_final
600600
cp $(Build.ArtifactStagingDirectory)/symbols/*.tar.gz $(Build.ArtifactStagingDirectory)/_final
601601
cp -r $(Build.ArtifactStagingDirectory)/payload $(Build.ArtifactStagingDirectory)/_final
602+
603+
#
604+
# .NET Tool build job
605+
#
606+
- job: dotnet_tool
607+
displayName: '.NET Tool NuGet Package'
608+
pool:
609+
name: GitClientPME-1ESHostedPool-intel-pc
610+
image: win-x86_64-ado1es
611+
os: windows
612+
templateContext:
613+
outputs:
614+
- output: pipelineArtifact
615+
targetPath: '$(Build.ArtifactStagingDirectory)/packages'
616+
artifactName: 'dotnet-tool'
617+
steps:
618+
- checkout: self
619+
- task: PowerShell@2
620+
displayName: 'Read version file'
621+
inputs:
622+
targetType: inline
623+
script: |
624+
$version = (Get-Content .\VERSION) -replace '\.\d+$', ''
625+
Write-Host "##vso[task.setvariable variable=version;isReadOnly=true]$version"
626+
- task: UseDotNet@2
627+
displayName: 'Use .NET 8 SDK'
628+
inputs:
629+
packageType: sdk
630+
version: '8.x'
631+
- task: NuGetToolInstaller@1
632+
displayName: 'Install NuGet CLI'
633+
inputs:
634+
versionSpec: '>= 6.0'
635+
- task: PowerShell@2
636+
displayName: 'Build payload'
637+
inputs:
638+
targetType: filePath
639+
filePath: './src/shared/DotnetTool/layout.ps1'
640+
arguments: |
641+
-Configuration Release `
642+
-Output "$(Build.ArtifactStagingDirectory)/nupkg"
643+
- task: EsrpCodeSigning@5
644+
condition: and(succeeded(), eq('${{ parameters.esrp }}', true))
645+
displayName: 'Sign payload'
646+
inputs:
647+
connectedServiceName: '$(esrpAppConnectionName)'
648+
useMSIAuthentication: true
649+
appRegistrationClientId: '$(esrpClientId)'
650+
appRegistrationTenantId: '$(esrpTenantId)'
651+
authAkvName: '$(esrpKeyVaultName)'
652+
authSignCertName: '$(esrpSignReqCertName)'
653+
serviceEndpointUrl: '$(esrpEndpointUrl)'
654+
folderPath: '$(Build.ArtifactStagingDirectory)/nupkg'
655+
pattern: |
656+
**/*.exe
657+
**/*.dll
658+
useMinimatch: true
659+
signConfigType: inlineSignParams
660+
inlineOperation: |
661+
[
662+
{
663+
"KeyCode": "CP-230012",
664+
"OperationCode": "SigntoolSign",
665+
"ToolName": "sign",
666+
"ToolVersion": "1.0",
667+
"Parameters": {
668+
"OpusName": "Microsoft",
669+
"OpusInfo": "https://www.microsoft.com",
670+
"FileDigest": "/fd SHA256",
671+
"PageHash": "/NPH",
672+
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
673+
}
674+
},
675+
{
676+
"KeyCode": "CP-230012",
677+
"OperationCode": "SigntoolVerify",
678+
"ToolName": "sign",
679+
"ToolVersion": "1.0",
680+
"Parameters": {}
681+
}
682+
]
683+
- task: PowerShell@2
684+
displayName: 'Create NuGet packages'
685+
inputs:
686+
targetType: filePath
687+
filePath: './src/shared/DotnetTool/pack.ps1'
688+
arguments: |
689+
-Configuration Release `
690+
-Version "$(version)" `
691+
-PackageRoot "$(Build.ArtifactStagingDirectory)/nupkg" `
692+
-Output "$(Build.ArtifactStagingDirectory)/packages"
693+
- task: EsrpCodeSigning@5
694+
condition: and(succeeded(), eq('${{ parameters.esrp }}', true))
695+
displayName: 'Sign NuGet packages'
696+
inputs:
697+
connectedServiceName: '$(esrpAppConnectionName)'
698+
useMSIAuthentication: true
699+
appRegistrationClientId: '$(esrpClientId)'
700+
appRegistrationTenantId: '$(esrpTenantId)'
701+
authAkvName: '$(esrpKeyVaultName)'
702+
authSignCertName: '$(esrpSignReqCertName)'
703+
serviceEndpointUrl: '$(esrpEndpointUrl)'
704+
folderPath: '$(Build.ArtifactStagingDirectory)/packages'
705+
pattern: |
706+
**/*.nupkg
707+
**/*.snupkg
708+
useMinimatch: true
709+
signConfigType: inlineSignParams
710+
inlineOperation: |
711+
[
712+
{
713+
"KeyCode": "CP-401405",
714+
"OperationCode": "NuGetSign",
715+
"ToolName": "sign",
716+
"ToolVersion": "1.0",
717+
"Parameters": {}
718+
}
719+
]

0 commit comments

Comments
 (0)