msbuild

Форк
0
283 строки · 10.7 Кб
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/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: VSEngSS-MicroBuild2022-1ES
107
          demands: Cmd
108
        # If it's not devdiv, it's dnceng
109
        ${{ else }}:
110
          name: $(DncEngInternalBuildPool)
111
          demands: ImageOverride -equals windows.vs2019.amd64
112

113
      steps:
114
        - template: setup-maestro-vars.yml
115
          parameters:
116
            BARBuildId: ${{ parameters.BARBuildId }}
117
            PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
118

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

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

137
    - job:
138
      displayName: Signing Validation
139
      condition: and( eq( ${{ parameters.enableSigningValidation }}, 'true'), ne( variables['PostBuildSign'], 'true'))
140
      pool:
141
        # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
142
        ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
143
          name: VSEngSS-MicroBuild2022-1ES
144
          demands: Cmd
145
        # If it's not devdiv, it's dnceng
146
        ${{ else }}:
147
          name: $(DncEngInternalBuildPool)
148
          demands: ImageOverride -equals windows.vs2019.amd64
149
      steps:
150
        - template: setup-maestro-vars.yml
151
          parameters:
152
            BARBuildId: ${{ parameters.BARBuildId }}
153
            PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
154

155
        - task: DownloadBuildArtifacts@0
156
          displayName: Download Package Artifacts
157
          inputs:
158
            buildType: specific
159
            buildVersionToDownload: specific
160
            project: $(AzDOProjectName)
161
            pipeline: $(AzDOPipelineId)
162
            buildId: $(AzDOBuildId)
163
            artifactName: PackageArtifacts
164
            checkDownloadedFiles: true
165
            itemPattern: |
166
              **
167
              !**/Microsoft.SourceBuild.Intermediate.*.nupkg
168

169
        # This is necessary whenever we want to publish/restore to an AzDO private feed
170
        # Since sdk-task.ps1 tries to restore packages we need to do this authentication here
171
        # otherwise it'll complain about accessing a private feed.
172
        - task: NuGetAuthenticate@1
173
          displayName: 'Authenticate to AzDO Feeds'
174

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

186
        - template: ../steps/publish-logs.yml
187
          parameters:
188
            StageLabel: 'Validation'
189
            JobLabel: 'Signing'
190

191
    - job:
192
      displayName: SourceLink Validation
193
      condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true')
194
      pool:
195
        # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com)
196
        ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
197
          name: VSEngSS-MicroBuild2022-1ES
198
          demands: Cmd
199
        # If it's not devdiv, it's dnceng
200
        ${{ else }}:
201
          name: $(DncEngInternalBuildPool)
202
          demands: ImageOverride -equals windows.vs2019.amd64
203
      steps:
204
        - template: setup-maestro-vars.yml
205
          parameters:
206
            BARBuildId: ${{ parameters.BARBuildId }}
207
            PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
208

209
        - task: DownloadBuildArtifacts@0
210
          displayName: Download Blob Artifacts
211
          inputs:
212
            buildType: specific
213
            buildVersionToDownload: specific
214
            project: $(AzDOProjectName)
215
            pipeline: $(AzDOPipelineId)
216
            buildId: $(AzDOBuildId)
217
            artifactName: BlobArtifacts
218
            checkDownloadedFiles: true
219

220
        - task: PowerShell@2
221
          displayName: Validate
222
          inputs:
223
            filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1
224
            arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/
225
              -ExtractPath $(Agent.BuildDirectory)/Extract/
226
              -GHRepoName $(Build.Repository.Name)
227
              -GHCommit $(Build.SourceVersion)
228
              -SourcelinkCliVersion $(SourceLinkCLIVersion)
229
          continueOnError: true
230

231
    - template: /eng/common/templates/job/execute-sdl.yml
232
      parameters:
233
        enable: ${{ parameters.SDLValidationParameters.enable }}
234
        publishGuardianDirectoryToPipeline: ${{ parameters.SDLValidationParameters.publishGdn }}
235
        additionalParameters: ${{ parameters.SDLValidationParameters.params }}
236
        continueOnError: ${{ parameters.SDLValidationParameters.continueOnError }}
237
        artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }}
238
        downloadArtifacts: ${{ parameters.SDLValidationParameters.downloadArtifacts }}
239

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

269
        - task: NuGetAuthenticate@1
270

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

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

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

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

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