vmr-build-pr.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # This YAML is used by these PR pipelines:
  2. #
  3. # - sdk-source-build
  4. # https://dev.azure.com/dnceng-public/public/_build?definitionId=286
  5. # - sdk-unified-build
  6. # https://dev.azure.com/dnceng-public/public/_build?definitionId=287
  7. # - sdk-unified-build-full
  8. # https://dev.azure.com/dnceng-public/public/_build?definitionId=288
  9. # - dotnet-sdk-source-build-internal
  10. # https://dev.azure.com/dnceng/internal/_build?definitionId=1378
  11. trigger: none
  12. pr:
  13. branches:
  14. include:
  15. - main
  16. - release/*
  17. exclude:
  18. - release/*.0.2xx
  19. - release/*.0.3xx
  20. - release/*.0.4xx
  21. parameters:
  22. - name: vmrBranch
  23. displayName: dotnet/dotnet branch to push to
  24. type: string
  25. default: ' '
  26. - name: disableBuild
  27. displayName: Skip the VMR Build stage
  28. type: boolean
  29. default: false
  30. variables:
  31. - template: /eng/common/templates/variables/pool-providers.yml@self
  32. - ${{ if ne(parameters.vmrBranch, ' ') }}:
  33. - name: VmrBranch
  34. value: ${{ replace(parameters.vmrBranch, ' ', '') }}
  35. - ${{ else }}:
  36. - name: VmrBranch
  37. value: ${{ replace(replace(variables['System.PullRequest.TargetBranch'], 'refs/heads/', ''), 'refs/pull/', '') }}
  38. # enable source-only build for pipelines with the -source-build suffix
  39. - name: isSourceOnlyBuild
  40. value: ${{ contains(variables['Build.DefinitionName'], '-source-build') }}
  41. resources:
  42. repositories:
  43. - repository: vmr
  44. type: github
  45. name: dotnet/dotnet
  46. endpoint: dotnet
  47. ref: ${{ variables.VmrBranch }}
  48. stages:
  49. # You can temporarily disable the VMR Build stage by setting the disableBuild variable
  50. - ${{ if not(parameters.disableBuild) }}:
  51. - template: templates/stages/vmr-build.yml
  52. parameters:
  53. vmrBranch: ${{ variables.VmrBranch }}
  54. isBuiltFromVmr: false
  55. isSourceOnlyBuild: ${{ variables.isSourceOnlyBuild }}
  56. ${{ if contains(variables['Build.DefinitionName'], '-full') }}:
  57. scope: full
  58. ${{ elseif eq(variables.isSourceOnlyBuild, 'true') }}:
  59. scope: ultralite
  60. ${{ else }}:
  61. scope: lite
  62. # In case the VMR Build stage is temporarily disabled, the VMR synchronization step is run to validate
  63. # that the PR can be merged and later synchronized into the VMR without problems.
  64. - ${{ else }}:
  65. - stage: Synchronize_VMR
  66. displayName: Synchronize VMR
  67. dependsOn: []
  68. jobs:
  69. - template: templates/jobs/vmr-synchronization.yml
  70. parameters:
  71. vmrBranch: ${{ variables.VmrBranch }}
  72. noPush: true