msbuild

Форк
0
287 строк · 10.3 Кб
1
parameters:
2
  # Which publishing infra should be used. THIS SHOULD MATCH THE VERSION ON THE BUILD MANIFEST.
3
  # Publishing V1 is no longer supported
4
  # Publishing V2 is no longer supported
5
  # Publishing V3 is the default
6
  - name: publishingInfraVersion
7
    displayName: Which version of publishing should be used to promote the build definition?
8
    type: number
9
    default: 3
10
    values:
11
    - 3
12

13
  - name: BARBuildId
14
    displayName: BAR Build Id
15
    type: number
16
    default: 0
17

18
  - name: PromoteToChannelIds
19
    displayName: Channel to promote BARBuildId to
20
    type: string
21
    default: ''
22

23
  - name: enableSourceLinkValidation
24
    displayName: Enable SourceLink validation
25
    type: boolean
26
    default: false
27

28
  - name: enableSigningValidation
29
    displayName: Enable signing validation
30
    type: boolean
31
    default: true
32

33
  - name: enableSymbolValidation
34
    displayName: Enable symbol validation
35
    type: boolean
36
    default: false
37

38
  - name: enableNugetValidation
39
    displayName: Enable NuGet validation
40
    type: boolean
41
    default: true
42
    
43
  - name: publishInstallersAndChecksums
44
    displayName: Publish installers and checksums
45
    type: boolean
46
    default: true
47

48
  - name: SDLValidationParameters
49
    type: object
50
    default:
51
      enable: false
52
      publishGdn: false
53
      continueOnError: false
54
      params: ''
55
      artifactNames: ''
56
      downloadArtifacts: true
57

58
  # These parameters let the user customize the call to sdk-task.ps1 for publishing
59
  # symbols & general artifacts as well as for signing validation
60
  - name: symbolPublishingAdditionalParameters
61
    displayName: Symbol publishing additional parameters
62
    type: string
63
    default: ''
64

65
  - name: artifactsPublishingAdditionalParameters
66
    displayName: Artifact publishing additional parameters
67
    type: string
68
    default: ''
69

70
  - name: signingValidationAdditionalParameters
71
    displayName: Signing validation additional parameters
72
    type: string
73
    default: ''
74

75
  # Which stages should finish execution before post-build stages start
76
  - name: validateDependsOn
77
    type: object
78
    default:
79
    - build
80

81
  - name: publishDependsOn
82
    type: object
83
    default:
84
    - Validate
85

86
  # Optional: Call asset publishing rather than running in a separate stage
87
  - name: publishAssetsImmediately
88
    type: boolean
89
    default: false
90

91
stages:
92
- ${{ if or(eq( parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}:
93
  - stage: Validate
94
    dependsOn: ${{ parameters.validateDependsOn }}
95
    displayName: Validate Build Assets
96
    variables:
97
      - template: common-variables.yml
98
      - template: /eng/common/templates-official/variables/pool-providers.yml
99
    jobs:
100
    - job:
101
      displayName: NuGet Validation
102
      condition: and(succeededOrFailed(), eq( ${{ parameters.enableNugetValidation }}, 'true'))
103
      pool:
104
        # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
105
        ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
106
          name: AzurePipelines-EO
107
          image: 1ESPT-Windows2022
108
          demands: Cmd
109
          os: windows
110
        # If it's not devdiv, it's dnceng
111
        ${{ else }}:
112
          name: $(DncEngInternalBuildPool)
113
          image: 1es-windows-2022
114
          os: windows
115

116
      steps:
117
        - template: setup-maestro-vars.yml
118
          parameters:
119
            BARBuildId: ${{ parameters.BARBuildId }}
120
            PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
121

122
        - task: DownloadBuildArtifacts@0
123
          displayName: Download Package Artifacts
124
          inputs:
125
            buildType: specific
126
            buildVersionToDownload: specific
127
            project: $(AzDOProjectName)
128
            pipeline: $(AzDOPipelineId)
129
            buildId: $(AzDOBuildId)
130
            artifactName: PackageArtifacts
131
            checkDownloadedFiles: true
132

133
        - task: PowerShell@2
134
          displayName: Validate
135
          inputs:
136
            filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1
137
            arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ 
138
              -ToolDestinationPath $(Agent.BuildDirectory)/Extract/ 
139

140
    - job:
141
      displayName: Signing Validation
142
      condition: and( eq( ${{ parameters.enableSigningValidation }}, 'true'), ne( variables['PostBuildSign'], 'true'))
143
      pool:
144
        # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
145
        ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
146
          name: AzurePipelines-EO
147
          image: 1ESPT-Windows2022
148
          demands: Cmd
149
          os: windows
150
        # If it's not devdiv, it's dnceng
151
        ${{ else }}:
152
          name: $(DncEngInternalBuildPool)
153
          image: 1es-windows-2022
154
          os: windows
155
      steps:
156
        - template: setup-maestro-vars.yml
157
          parameters:
158
            BARBuildId: ${{ parameters.BARBuildId }}
159
            PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
160

161
        - task: DownloadBuildArtifacts@0
162
          displayName: Download Package Artifacts
163
          inputs:
164
            buildType: specific
165
            buildVersionToDownload: specific
166
            project: $(AzDOProjectName)
167
            pipeline: $(AzDOPipelineId)
168
            buildId: $(AzDOBuildId)
169
            artifactName: PackageArtifacts
170
            checkDownloadedFiles: true
171
            itemPattern: |
172
              **
173
              !**/Microsoft.SourceBuild.Intermediate.*.nupkg
174

175
        # This is necessary whenever we want to publish/restore to an AzDO private feed
176
        # Since sdk-task.ps1 tries to restore packages we need to do this authentication here
177
        # otherwise it'll complain about accessing a private feed.
178
        - task: NuGetAuthenticate@1
179
          displayName: 'Authenticate to AzDO Feeds'
180

181
        # Signing validation will optionally work with the buildmanifest file which is downloaded from
182
        # Azure DevOps above.
183
        - task: PowerShell@2
184
          displayName: Validate
185
          inputs:
186
            filePath: eng\common\sdk-task.ps1
187
            arguments: -task SigningValidation -restore -msbuildEngine vs
188
              /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts'
189
              /p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt'
190
              ${{ parameters.signingValidationAdditionalParameters }}
191

192
        - template: ../steps/publish-logs.yml
193
          parameters:
194
            StageLabel: 'Validation'
195
            JobLabel: 'Signing'
196
            BinlogToolVersion: $(BinlogToolVersion)
197

198
    - job:
199
      displayName: SourceLink Validation
200
      condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true')
201
      pool:
202
        # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
203
        ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
204
          name: AzurePipelines-EO
205
          image: 1ESPT-Windows2022
206
          demands: Cmd
207
          os: windows
208
        # If it's not devdiv, it's dnceng
209
        ${{ else }}:
210
          name: $(DncEngInternalBuildPool)
211
          image: 1es-windows-2022
212
          os: windows
213
      steps:
214
        - template: setup-maestro-vars.yml
215
          parameters:
216
            BARBuildId: ${{ parameters.BARBuildId }}
217
            PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
218

219
        - task: DownloadBuildArtifacts@0
220
          displayName: Download Blob Artifacts
221
          inputs:
222
            buildType: specific
223
            buildVersionToDownload: specific
224
            project: $(AzDOProjectName)
225
            pipeline: $(AzDOPipelineId)
226
            buildId: $(AzDOBuildId)
227
            artifactName: BlobArtifacts
228
            checkDownloadedFiles: true
229

230
        - task: PowerShell@2
231
          displayName: Validate
232
          inputs:
233
            filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1
234
            arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/ 
235
              -ExtractPath $(Agent.BuildDirectory)/Extract/ 
236
              -GHRepoName $(Build.Repository.Name) 
237
              -GHCommit $(Build.SourceVersion)
238
              -SourcelinkCliVersion $(SourceLinkCLIVersion)
239
          continueOnError: true
240

241
- ${{ if ne(parameters.publishAssetsImmediately, 'true') }}:
242
  - stage: publish_using_darc
243
    ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}:
244
      dependsOn: ${{ parameters.publishDependsOn }}
245
    ${{ else }}:
246
      dependsOn: ${{ parameters.validateDependsOn }}
247
    displayName: Publish using Darc
248
    variables:
249
      - template: common-variables.yml
250
      - template: /eng/common/templates-official/variables/pool-providers.yml
251
    jobs:
252
    - job:
253
      displayName: Publish Using Darc
254
      timeoutInMinutes: 120
255
      pool:
256
        # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
257
        ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
258
          name: AzurePipelines-EO
259
          image: 1ESPT-Windows2022
260
          demands: Cmd
261
          os: windows
262
        # If it's not devdiv, it's dnceng
263
        ${{ else }}:
264
          name: NetCore1ESPool-Publishing-Internal
265
          image: windows.vs2019.amd64
266
          os: windows
267
      steps:
268
        - template: setup-maestro-vars.yml
269
          parameters:
270
            BARBuildId: ${{ parameters.BARBuildId }}
271
            PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
272

273
        - task: NuGetAuthenticate@1
274

275
        - task: AzureCLI@2
276
          displayName: Publish Using Darc
277
          inputs:
278
            azureSubscription: "Darc: Maestro Production"
279
            scriptType: ps
280
            scriptLocation: scriptPath
281
            scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
282
            arguments: -BuildId $(BARBuildId) 
283
              -PublishingInfraVersion ${{ parameters.publishingInfraVersion }}
284
              -AzdoToken '$(System.AccessToken)'
285
              -WaitPublishingFinish true
286
              -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}'
287
              -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'
288

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.