-
Notifications
You must be signed in to change notification settings - Fork 351
/
publish.yml
134 lines (123 loc) · 5.5 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
parameters:
artifactsPublishingAdditionalParameters: ''
PromoteToChannelIds: ''
BARBuildId: ''
symbolPublishingAdditionalParameters: ''
buildQuality: 'daily'
stages:
- stage: publish
displayName: Publishing
jobs:
- job: publish_assets
displayName: Publish Assets and Symbols
timeoutInMinutes: 120
variables:
- group: DotNet-Symbol-Server-Pats
- group: AzureDevOps-Artifact-Feeds-Pats
- group: Publish-Build-Assets
- template: /eng/common/templates-official/post-build/common-variables.yml@self
steps:
- task: AzureCLI@2
displayName: Validate and Locate Build
inputs:
azureSubscription: "Darc: Maestro Production"
scriptType: ps
scriptLocation: scriptPath
scriptPath: $(Build.SourcesDirectory)/eng/publishing/v3/validate-and-locate-build.ps1
arguments: >
-BuildId ${{ parameters.BARBuildId }}
-PromoteToChannelIds ${{ parameters.PromoteToChannelIds }}
-DarcVersion $(DarcVersion)
- task: DownloadBuildArtifacts@0
displayName: Download Build Assets
continueOnError: true
enabled: true
inputs:
buildType: specific
buildVersionToDownload: specific
project: $(AzDOProject)
pipeline: $(AzDOPipelineId)
buildId: $(AzDOBuildId)
downloadType: 'specific'
itemPattern: |
AssetManifests/**
BlobArtifacts/MergedManifest.xml
PdbArtifacts/**
ReleaseConfigs/SymbolPublishingExclusionsFile.txt
downloadPath: '$(Build.ArtifactStagingDirectory)'
- task: NuGetToolInstaller@1
displayName: 'Install NuGet.exe'
- task: NuGetAuthenticate@1
displayName: 'Authenticate to AzDO Feeds'
- task: PowerShell@2
displayName: Enable cross-org publishing
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/enable-cross-org-publishing.ps1
arguments: -token $(dn-bot-all-orgs-artifact-feeds-rw)
- task: AzureCLI@2
displayName: Get aka.ms client certificate
inputs:
azureSubscription: 'DotNet-Engineering-Services_KeyVault'
scriptType: pscore
scriptLocation: inlineScript
inlineScript: |
az keyvault secret show --vault-name EngKeyVault --name Redirection-UST-Client-NetCoreDeployment | ConvertFrom-Json | Select-Object -Expand value > $(Agent.TempDirectory)/akamsclientcert.pfx
- task: AzureCLI@2
displayName: Authenticate Maestro API
name: AuthenticateMaestro
inputs:
azureSubscription: 'Darc: Maestro Production'
addSpnToEnvironment: true
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
# MaestroAppClientId provided by Publish-Build-Assets
$token = (az account get-access-token --resource "$(MaestroAppClientId)" | ConvertFrom-Json).accessToken
echo "##vso[task.setvariable variable=MaestroToken;isOutput=true;isSecret=true]$token"
- task: AzureCLI@2
displayName: Publish packages, blobs and symbols
inputs:
azureSubscription: maestro-build-promotion
addSpnToEnvironment: true
scriptType: ps
scriptLocation: scriptPath
scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1
arguments: >
-task PublishArtifactsInManifest -restore -msbuildEngine dotnet
/p:PublishingInfraVersion=3
/p:BARBuildId=${{ parameters.BARBuildId }}
/p:TargetChannels='${{ parameters.PromoteToChannelIds }}'
/p:IsInternalBuild=${{ contains(variables['AzDOBranch'], 'internal/') }}
/p:NugetPath=$(NuGetExeToolPath)
/p:MaestroApiEndpoint='$(MaestroApiEndPoint)'
/p:BuildAssetRegistryToken='$(AuthenticateMaestro.MaestroToken)'
/p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/'
/p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/'
/p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/'
/p:PublishInstallersAndChecksums=true
/p:AzureDevOpsFeedsKey='$(dn-bot-all-orgs-artifact-feeds-rw)'
/p:AkaMSClientId=$(akams-app-id)
/p:AkaMSClientCertificate=$(Agent.TempDirectory)/akamsclientcert.pfx
/p:ManagedIdentityClientId=$env:servicePrincipalId
${{ parameters.artifactsPublishingAdditionalParameters }}
/p:PDBArtifactsBasePath='$(Build.ArtifactStagingDirectory)/PDBArtifacts/'
/p:SymbolPublishingExclusionsFile='$(Build.ArtifactStagingDirectory)/ReleaseConfigs/SymbolPublishingExclusionsFile.txt'
/p:TempSymbolsAzureDevOpsOrg='dnceng'
/p:TempSymbolsAzureDevOpsOrgToken='$(dnceng-symbol-server-pat)'
/p:SymbolRequestProject='dotnet'
${{ parameters.symbolPublishingAdditionalParameters}}
/p:BuildQuality='${{ parameters.buildQuality }}'
/p:AzdoApiToken='$(dn-bot-all-orgs-build-rw-code-rw)'
/p:ArtifactsBasePath='$(Build.ArtifactStagingDirectory)/'
/p:BuildId='$(AzDOBuildId)'
/p:AzureDevOpsOrg='$(AzDOAccount)'
/p:AzureProject='$(AzDOProject)'
/p:UseStreamingPublishing='true'
/p:StreamingPublishingMaxClients=16
/p:NonStreamingPublishingMaxClients=12
- template: /eng/common/templates-official/steps/publish-logs.yml@self
parameters:
StageLabel: '${{ parameters.stageName }}'
JobLabel: 'AssetsPublishing'
BinlogToolVersion: $(BinlogToolVersion)
CustomSensitiveDataList: '$(AuthenticateMaestro.MaestroToken)'