azure-pipelines.yml 3.2 KB
Newer Older
1
# This is a simple wrapper for eng/pipeline.yml to get around the limitation of
S
Steven Kirbach 已提交
2 3 4 5
# user-defined variables not being available in yaml template expressions.

# Parameters ARE available in template expressions, and parameters can have default values,
# so they can be used to control yaml flow.
6
#
S
Steven Kirbach 已提交
7

D
dotnet-maestro[bot] 已提交
8
variables:
9 10 11 12 13 14 15 16 17
    # clean the local repo on the build agents
  - name: Build.Repository.Clean
    value: true
  - name: _PublishUsingPipelines
    value: true
  - name: _DotNetArtifactsCategory
    value: WINDOWSDESKTOP
  - name: _DotNetValidationArtifactsCategory
    value: WINDOWSDESKTOP
M
Matt Mitchell 已提交
18 19
  - name: PostBuildSign
    value: true
20 21 22
  
  - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
    - group: DotNet-Wpf-SDLValidation-Params
S
Steven Kirbach 已提交
23

S
Steven Kirbach 已提交
24

25 26 27
# This is set in the pipeline directly 
# When set to false, CI tests will not be enabled in builds. 
#
28
# _ContinuousIntegrationTestsEnabled: false
29

V
Vatsan Madhavan 已提交
30 31 32 33
# Setting batch to true, triggers one build at a time.
# if there is a push while a build in progress, it will wait,
# until the running build finishes, and produce a build with all the changes
#
34
# only trigger ci builds for the master and release branches
S
Steven Kirbach 已提交
35
trigger:
V
Vatsan Madhavan 已提交
36 37 38
  batch: true 
  branches:
    include: 
39
    - main
M
Matt Mitchell 已提交
40 41
    - release/3.*
    - release/5.*
42
    - release/6.*
43
    - release/7.*
44
    - internal/release/5.*
45
    - internal/release/6.*
46
    - experimental/*
V
Vatsan Madhavan 已提交
47 48
  paths:
    exclude:
V
Vatsan Madhavan 已提交
49
    - Documentation/*
V
Vatsan Madhavan 已提交
50 51 52 53 54

pr:
  autoCancel: true
  branches:
    include:
55
    - main
M
Matt Mitchell 已提交
56
    - release/3.* 
57
    - internal/release/3.*
M
Matt Mitchell 已提交
58
    - release/5.*
59
    - release/6.*
60
    - release/7.*
61
    - experimental/*
62
  paths:
V
Vatsan Madhavan 已提交
63 64
    exclude:
    - Documentation/*
D
dotnet-maestro[bot] 已提交
65

S
Steven Kirbach 已提交
66
# Call the pipeline.yml template, which does the real work
67 68 69 70 71 72 73 74 75 76
stages:
- stage: build
  displayName: Build 
  jobs:
  - template: /eng/pipeline.yml
    parameters:
      enablePublishUsingPipelines: $(_PublishUsingPipelines)
      ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
        # agent pool can't be read from a user-defined variable (Azure DevOps limitation)
        pool:
J
Jon Fortescue 已提交
77
          name: NetCore1ESPool-Internal
78
          demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre
79 80
        # runAsPublic is used in expressions, which can't read from user-defined variables
        runAsPublic: false
81

82 83 84
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
  - template: eng\common\templates\post-build\post-build.yml
    parameters:
M
Matt Mitchell 已提交
85
      publishingInfraVersion: 3
86
      enableSymbolValidation: false
87 88
      enableSigningValidation: false
      enableNugetValidation: false
89 90 91
      enableSourceLinkValidation: false
      # This is to enable SDL runs part of Post-Build Validation Stage
      SDLValidationParameters:
92
        enable: false
93 94 95 96 97 98 99 100 101 102
        params: ' -SourceToolsList @("policheck","credscan")
        -TsaInstanceURL $(_TsaInstanceURL)
        -TsaProjectName $(_TsaProjectName)
        -TsaNotificationEmail $(_TsaNotificationEmail)
        -TsaCodebaseAdmin $(_TsaCodebaseAdmin)
        -TsaBugAreaPath $(_TsaBugAreaPath)
        -TsaIterationPath $(_TsaIterationPath)
        -TsaRepositoryName "wpf"
        -TsaCodebaseName "wpf"
        -TsaPublish $True'