summaryrefslogtreecommitdiff
path: root/eng/common/templates/post-build/post-build.yml
blob: e6b75088c94749d69213a1eeb5ab9a3c4ebab652 (plain)
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
parameters:
  enableSourceLinkValidation: true
  enableSigningValidation: true
  enableSymbolValidation: true
  enableNugetValidation: true
  SDLValidationParameters:
    enable: false
    params: ''

  # These parameters let the user customize the call to sdk-task.ps1 for publishing
  # symbols & general artifacts as well as for signing validation
  symbolPublishingAdditionalParameters: ''
  artifactsPublishingAdditionalParameters: ''
  signingValidationAdditionalParameters: ''

  # Which stages should finish execution before post-build stages start
  dependsOn: [build]

stages:
- stage: validate
  dependsOn: ${{ parameters.dependsOn }}
  displayName: Validate
  jobs:
  - ${{ if eq(parameters.enableNugetValidation, 'true') }}:
    - job:
      displayName: NuGet Validation
      pool:
        vmImage: 'windows-2019'
      steps:
        - task: DownloadBuildArtifacts@0
          displayName: Download Package Artifacts
          inputs:
            buildType: current
            artifactName: PackageArtifacts

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

  - ${{ if eq(parameters.enableSigningValidation, 'true') }}:
    - job:
      displayName: Signing Validation
      pool:
        vmImage: 'windows-2019'
      steps:
        - task: DownloadBuildArtifacts@0
          displayName: Download Package Artifacts
          inputs:
            buildType: current
            artifactName: PackageArtifacts

        - task: PowerShell@2
          displayName: Validate
          inputs:
            filePath: eng\common\sdk-task.ps1
            arguments: -task SigningValidation -restore -msbuildEngine dotnet
              /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts'
              /p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt'
              /p:Configuration=Release 
              ${{ parameters.signingValidationAdditionalParameters }}

  - ${{ if eq(parameters.enableSourceLinkValidation, 'true') }}:
    - job:
      displayName: SourceLink Validation
      variables:
        - template: common-variables.yml
      pool:
        vmImage: 'windows-2019'
      steps:
        - task: DownloadBuildArtifacts@0
          displayName: Download Blob Artifacts
          inputs:
            buildType: current
            artifactName: BlobArtifacts

        - task: PowerShell@2
          displayName: Validate
          inputs:
            filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1
            arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/ 
              -ExtractPath $(Agent.BuildDirectory)/Extract/ 
              -GHRepoName $(Build.Repository.Name) 
              -GHCommit $(Build.SourceVersion)
              -SourcelinkCliVersion $(SourceLinkCLIVersion)

  - ${{ if eq(parameters.SDLValidationParameters.enable, 'true') }}:
    - template: /eng/common/templates/job/execute-sdl.yml
      parameters:
        additionalParameters: ${{ parameters.SDLValidationParameters.params }}

- template: \eng\common\templates\post-build\channels\netcore-dev-5.yml
  parameters:
    enableSymbolValidation: ${{ parameters.enableSymbolValidation }}
    symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
    artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}

- template: \eng\common\templates\post-build\channels\public-dev-release.yml
  parameters:
    enableSymbolValidation: ${{ parameters.enableSymbolValidation }}
    symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
    artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}

- template: \eng\common\templates\post-build\channels\netcore-tools-latest.yml
  parameters:
    enableSymbolValidation: ${{ parameters.enableSymbolValidation }}
    symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
    artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}

- template: \eng\common\templates\post-build\channels\public-validation-release.yml
  parameters:
    artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}

- template: \eng\common\templates\post-build\channels\public-release.yml
  parameters:
    symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
    artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}

- template: \eng\common\templates\post-build\channels\internal-servicing.yml
  parameters:
    symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
    artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}