.vsts-pr.yml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. # Pipeline: https://dev.azure.com/dnceng-public/public/_build?definitionId=101
  2. trigger: none
  3. pr:
  4. branches:
  5. include:
  6. - main
  7. - release/*
  8. - internal/release/*
  9. variables:
  10. - name: teamName
  11. value: Roslyn-Project-System
  12. - name: _CIBuild
  13. value: -restore -build -sign -pack -ci
  14. - name: _DotNetArtifactsCategory
  15. value: .NETCore
  16. - name: _DotNetValidationArtifactsCategory
  17. value: .NETCore
  18. # Disable post-build signing for internal release-branch builds or internal manual builds.
  19. - ${{ if and(eq(variables['System.TeamProject'], 'internal'), or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), eq(variables['Build.Reason'], 'Manual'))) }}:
  20. - name: PostBuildSign
  21. value: false
  22. - ${{ else }}:
  23. - name: PostBuildSign
  24. value: true
  25. - ${{ if eq(variables['System.TeamProject'], 'public') }}:
  26. - name: _InternalRuntimeDownloadArgs
  27. value: ''
  28. - name: _OfficialBuildArgs
  29. value: ''
  30. - name: "skipComponentGovernanceDetection"
  31. value: "true"
  32. - ${{ if ne(variables['System.TeamProject'], 'public') }}:
  33. - name: _OfficialBuildArgs
  34. value: /p:OfficialBuilder=Microsoft
  35. - name: Codeql.Enabled
  36. value: true
  37. - group: DotNetBuilds storage account read tokens
  38. - name: _InternalRuntimeDownloadArgs
  39. value: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal
  40. /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
  41. - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
  42. - group: DotNet-CLI-SDLValidation-Params
  43. - template: /eng/common/templates/variables/pool-providers.yml
  44. stages:
  45. - stage: build
  46. displayName: Build
  47. jobs:
  48. - job: Publish_Build_Configuration
  49. pool:
  50. ${{ if eq(variables['System.TeamProject'], 'public') }}:
  51. vmImage: 'windows-2019'
  52. ${{ if eq(variables['System.TeamProject'], 'internal') }}:
  53. name: $(DncEngInternalBuildPool)
  54. demands: ImageOverride -equals windows.vs2019.amd64
  55. steps:
  56. - publish: $(Build.SourcesDirectory)\eng\BuildConfiguration
  57. artifact: BuildConfiguration
  58. displayName: Publish Build Config
  59. - template: /eng/build-pr.yml
  60. parameters:
  61. agentOs: Windows_NT
  62. pool:
  63. ${{ if eq(variables['System.TeamProject'], 'public') }}:
  64. name: $(DncEngPublicBuildPool)
  65. demands: ImageOverride -equals 1es-windows-2022-open
  66. ${{ if ne(variables['System.TeamProject'], 'public') }}:
  67. name: $(DncEngInternalBuildPool)
  68. demands: ImageOverride -equals 1es-windows-2022
  69. ${{ if eq(variables['System.TeamProject'], 'public') }}:
  70. helixTargetQueue: Windows.Amd64.VS2022.Pre.Open
  71. ${{ if ne(variables['System.TeamProject'], 'public') }}:
  72. helixTargetQueue: Windows.Amd64.VS2022.Pre
  73. strategy:
  74. matrix:
  75. Build_Release:
  76. _BuildConfig: Release
  77. _PublishArgs: ''
  78. ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
  79. _SignType: test
  80. _Test: -test
  81. ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
  82. _SignType: real
  83. _Test: ''
  84. - template: /eng/common/templates/job/source-build.yml
  85. parameters:
  86. platform:
  87. name: 'Managed'
  88. container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9'
  89. # Publish not needed for PR builds
  90. skipPublishValidation: true
  91. - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
  92. - template: /eng/build-pr.yml
  93. parameters:
  94. agentOs: Windows_NT_FullFramework
  95. pool:
  96. ${{ if eq(variables['System.TeamProject'], 'public') }}:
  97. name: $(DncEngPublicBuildPool)
  98. demands: ImageOverride -equals 1es-windows-2022-open
  99. ${{ if ne(variables['System.TeamProject'], 'public') }}:
  100. name: $(DncEngInternalBuildPool)
  101. demands: ImageOverride -equals windows.vs2022preview.amd64
  102. ${{ if eq(variables['System.TeamProject'], 'public') }}:
  103. helixTargetQueue: Windows.Amd64.VS2022.Pre.Open
  104. ${{ if ne(variables['System.TeamProject'], 'public') }}:
  105. helixTargetQueue: Windows.Amd64.VS2022.Pre
  106. strategy:
  107. matrix:
  108. Build_Debug:
  109. _BuildConfig: Debug
  110. _PublishArgs: ''
  111. _SignType: test
  112. _Test: -test
  113. - template: /eng/build-pr.yml
  114. parameters:
  115. agentOs: Windows_NT_TestAsTools
  116. pool:
  117. ${{ if eq(variables['System.TeamProject'], 'public') }}:
  118. name: $(DncEngPublicBuildPool)
  119. demands: ImageOverride -equals 1es-windows-2022-open
  120. ${{ if ne(variables['System.TeamProject'], 'public') }}:
  121. name: $(DncEngInternalBuildPool)
  122. demands: ImageOverride -equals 1es-windows-2022
  123. strategy:
  124. matrix:
  125. Build_Debug:
  126. _BuildConfig: Debug
  127. _PublishArgs: ''
  128. _SignType: test
  129. - template: /eng/build-pr.yml
  130. parameters:
  131. agentOs: Ubuntu_22_04
  132. pool:
  133. ${{ if eq(variables['System.TeamProject'], 'public') }}:
  134. vmImage: 'ubuntu-22.04'
  135. ${{ if ne(variables['System.TeamProject'], 'public') }}:
  136. name: $(DncEngInternalBuildPool)
  137. demands: ImageOverride -equals build.ubuntu.2204.amd64
  138. ${{ if eq(variables['System.TeamProject'], 'public') }}:
  139. helixTargetQueue: ubuntu.2204.amd64.open
  140. ${{ if ne(variables['System.TeamProject'], 'public') }}:
  141. helixTargetQueue: Ubuntu.2204.Amd64
  142. strategy:
  143. matrix:
  144. Build_Release:
  145. _BuildConfig: Release
  146. _PublishArgs: ''
  147. _SignType: test
  148. _Test: -test
  149. - template: /eng/build-pr.yml
  150. parameters:
  151. agentOs: Darwin
  152. pool:
  153. vmImage: 'macOS-latest'
  154. ${{ if eq(variables['System.TeamProject'], 'public') }}:
  155. helixTargetQueue: OSX.13.Amd64.Open
  156. ${{ if ne(variables['System.TeamProject'], 'public') }}:
  157. helixTargetQueue: OSX.13.Amd64
  158. strategy:
  159. matrix:
  160. Build_Release:
  161. _BuildConfig: Release
  162. _PublishArgs: ''
  163. _SignType: test
  164. _Test: -test
  165. - template: /eng/template-engine.yml
  166. - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
  167. - template: /eng/common/templates/job/publish-build-assets.yml
  168. parameters:
  169. publishUsingPipelines: true
  170. publishAssetsImmediately: true
  171. dependsOn:
  172. - Windows_NT
  173. - Source_Build_Managed
  174. pool:
  175. name: $(DncEngInternalBuildPool)
  176. demands: ImageOverride -equals windows.vs2019.amd64
  177. - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
  178. - template: /eng/common/templates/post-build/post-build.yml
  179. parameters:
  180. publishingInfraVersion: 3
  181. enableSymbolValidation: false
  182. enableSigningValidation: false
  183. enableNugetValidation: false
  184. enableSourceLinkValidation: false
  185. publishInstallersAndChecksums: true
  186. publishAssetsImmediately: true
  187. SDLValidationParameters:
  188. enable: false
  189. params: ' -SourceToolsList @("policheck","credscan")
  190. -TsaInstanceURL $(_TsaInstanceURL)
  191. -TsaProjectName $(_TsaProjectName)
  192. -TsaNotificationEmail $(_TsaNotificationEmail)
  193. -TsaCodebaseAdmin $(_TsaCodebaseAdmin)
  194. -TsaBugAreaPath $(_TsaBugAreaPath)
  195. -TsaIterationPath $(_TsaIterationPath)
  196. -TsaRepositoryName "dotnet-sdk"
  197. -TsaCodebaseName "dotnet-sdk"
  198. -TsaPublish $True'