Skip to content

Commit e89a778

Browse files
authored
[release/7.0] Migrate to 1ESPT (#8962)
* Migrate to 1ESPT * revert public and internal changes
1 parent 9afded1 commit e89a778

File tree

4 files changed

+268
-100
lines changed

4 files changed

+268
-100
lines changed

azure-pipelines-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ pr:
6363
exclude:
6464
- Documentation/*
6565

66-
# Call the pipeline.yml template, which does the real work
66+
# Call the pipeline-pr.yml template, which does the real work
6767
stages:
6868
- stage: build
6969
displayName: Build
7070
jobs:
71-
- template: /eng/pipeline.yml
71+
- template: /eng/pipeline-pr.yml
7272
parameters:
7373
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
7474
runAsPublic: false

azure-pipelines.yml

Lines changed: 53 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,27 @@
11
# This is a simple wrapper for eng/pipeline.yml to get around the limitation of
22
# user-defined variables not being available in yaml template expressions.
33

4-
# Parameters ARE available in template expressions, and parameters can have default values,
5-
# so they can be used to control yaml flow.
6-
#
7-
4+
# Parameters ARE available in template expressions, and parameters can have default values
85
variables:
9-
# clean the local repo on the build agents
10-
- name: Build.Repository.Clean
6+
# clean the local repo on the build agents
7+
- name: Build.Repository.Clean
8+
value: true
9+
- name: _DotNetArtifactsCategory
10+
value: WINDOWSDESKTOP
11+
- name: _DotNetValidationArtifactsCategory
12+
value: WINDOWSDESKTOP
13+
- ${{ if or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), eq(variables['Build.Reason'], 'Manual')) }}:
14+
- name: PostBuildSign
15+
value: false
16+
- ${{ else }}:
17+
- name: PostBuildSign
1118
value: true
12-
- ${{ if or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/')) }}:
13-
- name: PostBuildSign
14-
value: false
15-
- ${{ else }}:
16-
- name: PostBuildSign
17-
value: true
18-
19-
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
20-
- group: DotNet-Wpf-SDLValidation-Params
21-
22-
23-
# This is set in the pipeline directly
24-
# When set to false, CI tests will not be enabled in builds.
25-
#
26-
# _ContinuousIntegrationTestsEnabled: false
27-
28-
# Setting batch to true, triggers one build at a time.
29-
# if there is a push while a build in progress, it will wait,
30-
# until the running build finishes, and produce a build with all the changes
31-
#
32-
# only trigger ci builds for the master and release branches
19+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
20+
- group: DotNet-Wpf-SDLValidation-Params
3321
trigger:
34-
batch: true
22+
batch: true
3523
branches:
36-
include:
24+
include:
3725
- main
3826
- release/3.*
3927
- release/5.*
@@ -47,50 +35,39 @@ trigger:
4735
paths:
4836
exclude:
4937
- Documentation/*
50-
51-
pr:
52-
autoCancel: true
53-
branches:
54-
include:
55-
- main
56-
- release/3.*
57-
- internal/release/3.*
58-
- release/5.*
59-
- release/6.*
60-
- release/7.*
61-
- experimental/*
62-
paths:
63-
exclude:
64-
- Documentation/*
65-
66-
# Call the pipeline.yml template, which does the real work
67-
stages:
68-
- stage: build
69-
displayName: Build
70-
jobs:
71-
- template: /eng/pipeline.yml
72-
parameters:
73-
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
74-
runAsPublic: false
75-
76-
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
77-
- template: eng\common\templates\post-build\post-build.yml
78-
parameters:
79-
publishingInfraVersion: 3
80-
enableSymbolValidation: false
81-
enableSigningValidation: false
82-
enableNugetValidation: false
83-
enableSourceLinkValidation: false
84-
# This is to enable SDL runs part of Post-Build Validation Stage
85-
SDLValidationParameters:
86-
enable: false
87-
params: ' -SourceToolsList @("policheck","credscan")
88-
-TsaInstanceURL $(_TsaInstanceURL)
89-
-TsaProjectName $(_TsaProjectName)
90-
-TsaNotificationEmail $(_TsaNotificationEmail)
91-
-TsaCodebaseAdmin $(_TsaCodebaseAdmin)
92-
-TsaBugAreaPath $(_TsaBugAreaPath)
93-
-TsaIterationPath $(_TsaIterationPath)
94-
-TsaRepositoryName "wpf"
95-
-TsaCodebaseName "wpf"
96-
-TsaPublish $True'
38+
resources:
39+
repositories:
40+
- repository: 1ESPipelineTemplates
41+
type: git
42+
name: 1ESPipelineTemplates/1ESPipelineTemplates
43+
ref: refs/tags/release
44+
extends:
45+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
46+
parameters:
47+
featureFlags:
48+
autoBaseline: true
49+
pool:
50+
name: NetCore1ESPool-Internal
51+
image: 1es-windows-2022-pt
52+
os: windows
53+
customBuildTags:
54+
- ES365AIMigrationTooling
55+
stages:
56+
- stage: build
57+
displayName: Build
58+
jobs:
59+
- template: /eng/pipeline.yml@self
60+
parameters:
61+
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
62+
runAsPublic: false
63+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
64+
- template: /eng/common/templates-official/post-build/post-build.yml@self
65+
parameters:
66+
publishingInfraVersion: 3
67+
enableSymbolValidation: false
68+
enableSigningValidation: false
69+
enableNugetValidation: false
70+
enableSourceLinkValidation: false
71+
SDLValidationParameters:
72+
enable: false
73+
params: ' -SourceToolsList @("policheck","credscan") -TsaInstanceURL $(_TsaInstanceURL) -TsaProjectName $(_TsaProjectName) -TsaNotificationEmail $(_TsaNotificationEmail) -TsaCodebaseAdmin $(_TsaCodebaseAdmin) -TsaBugAreaPath $(_TsaBugAreaPath) -TsaIterationPath $(_TsaIterationPath) -TsaRepositoryName "wpf" -TsaCodebaseName "wpf" -TsaPublish $True'

eng/pipeline-pr.yml

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
#
2+
# This file should be kept in sync across https://www.github.com/dotnet/wpf and dotnet-wpf-int repos.
3+
#
4+
#
5+
6+
parameters:
7+
# Needed because runAsPublic is used in template expressions, which can't read from user-defined variables
8+
# Defaults to true
9+
runAsPublic: true
10+
repoName: dotnet/wpf
11+
12+
jobs:
13+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}:
14+
- template: /eng/common/templates/job/onelocbuild.yml
15+
parameters:
16+
MirrorRepo: wpf
17+
LclSource: lclFilesfromPackage
18+
LclPackageId: 'LCL-JUNO-PROD-WPF'
19+
- template: /eng/common/templates/jobs/jobs.yml
20+
parameters:
21+
enableMicrobuild: true
22+
enablePublishBuildArtifacts: true
23+
enablePublishTestResults: false # tests run in helix
24+
enablePublishBuildAssets: true
25+
enablePublishUsingPipelines: true
26+
enableTelemetry: true
27+
enableSourceIndex: true
28+
sourceIndexParams:
29+
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
30+
binlogPath: artifacts/log/Debug/x86/Build.binlog
31+
pool:
32+
${{ if eq(variables['System.TeamProject'], 'public') }}:
33+
name: NetCore-Public
34+
demands: ImageOverride -equals windows.vs2022preview.amd64.Open
35+
${{ if eq(variables['System.TeamProject'], 'internal') }}:
36+
name: NetCore1ESPool-Internal
37+
demands: ImageOverride -equals windows.vs2022preview.amd64
38+
helixRepo: $(repoName)
39+
40+
jobs:
41+
- job: Windows_NT
42+
timeoutInMinutes: 120 # how long to run the job before automatically cancelling; see https://github.com/dotnet/wpf/issues/952
43+
pool:
44+
# For public jobs, use the hosted pool. For internal jobs use the internal pool.
45+
# Will eventually change this to two BYOC pools.
46+
# agent pool can't be read from a user-defined variable (Azure DevOps limitation)
47+
${{ if eq(variables['System.TeamProject'], 'public') }}:
48+
name: NetCore-Public
49+
demands: ImageOverride -equals windows.vs2022preview.amd64.Open
50+
${{ if eq(variables['System.TeamProject'], 'internal') }}:
51+
name: NetCore1ESPool-Internal
52+
demands: ImageOverride -equals windows.vs2022preview.amd64
53+
variables:
54+
# needed for signing
55+
- name: _TeamName
56+
value: DotNetCore
57+
- name: _SignType
58+
value: real
59+
- name: _SignArgs
60+
value: ''
61+
- name: _PublishArgs
62+
value: ''
63+
- name: _OfficialBuildIdArgs
64+
value: ''
65+
- name: _Platform
66+
value: x86
67+
- name: _PlatformArgs
68+
value: /p:Platform=$(_Platform)
69+
- name: _PublicBuildPipeline # We will run Helix tests when building in the open, but do not repeat when building and publishing again using the internal build-pipeline
70+
value: true
71+
- name: _TestHelixAgentPool
72+
value: 'Windows.10.Amd64.ClientRS5.Open' # Preferred:'Windows.10.Amd64.Open%3bWindows.7.Amd64.Open%3bWindows.10.Amd64.ClientRS5.Open'; See https://github.com/dotnet/wpf/issues/952
73+
- name: _HelixStagingDir
74+
value: $(BUILD.STAGINGDIRECTORY)\helix\functests
75+
- name: _HelixSource
76+
value: ${{ parameters.repoName }}/$(Build.SourceBranch)
77+
- name: _HelixToken
78+
value: ''
79+
- name: _HelixCreator
80+
value: ${{ parameters.repoName }}
81+
- ${{ if ne(variables['System.TeamProject'], 'internal') }}:
82+
- name: _InternalRuntimeDownloadArgs
83+
value: ''
84+
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
85+
- group: DotNetBuilds storage account read tokens
86+
- group: AzureDevOps-Artifact-Feeds-Pats
87+
- name: _InternalRuntimeDownloadArgs
88+
value: >-
89+
/p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal
90+
/p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
91+
92+
93+
# Override some values if we're building internally
94+
- ${{ if eq(parameters.runAsPublic, 'false') }}:
95+
# note: You have to use list syntax here (- name: value) or you will get errors about declaring the same variable multiple times
96+
- name: _SignType
97+
value: real
98+
- group: DotNet-HelixApi-Access
99+
100+
# note: Even though they are referenced here, user defined variables (like $(_SignType)) are not resolved
101+
# until the agent is running on the machine. They can be overridden any time before they are resolved,
102+
# like in the job matrix below (see Build_Debug)
103+
- name: _SignArgs
104+
value: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
105+
- name: _PublishArgs
106+
value: /p:DotNetPublishUsingPipelines=true
107+
- name: _OfficialBuildIdArgs
108+
value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
109+
- name: _PublicBuildPipeline
110+
value: false
111+
- name: _HelixSource
112+
value: official/${{ parameters.repoName }}/$(Build.SourceBranch)
113+
- name: _HelixToken
114+
value: '$(HelixApiAccessToken)' # from DotNet-HelixApi-Access group
115+
- name: _HelixCreator
116+
value: '' #if _HelixToken is set, Creator must be empty
117+
- name: _TestHelixAgentPool
118+
value: 'Windows.10.Amd64.ClientRS5' # Preferred: 'Windows.10.Amd64%3bWindows.7.Amd64%3bWindows.10.Amd64.ClientRS5'
119+
120+
strategy:
121+
matrix:
122+
${{ if eq(parameters.runAsPublic, 'true') }}:
123+
Build_Debug_x86:
124+
_BuildConfig: Debug
125+
# override some variables for debug
126+
# _SignType has to be real for package publishing to succeed - do not override to test.
127+
Build_Release_x86:
128+
_BuildConfig: Release
129+
${{ if eq(parameters.runAsPublic, 'true') }}:
130+
Build_Debug_x64:
131+
_BuildConfig: Debug
132+
# override some variables for debug
133+
# _SignType has to be real for package publishing to succeed - do not override to test.
134+
_Platform: x64
135+
Build_Release_x64:
136+
_BuildConfig: Release
137+
_Platform: x64
138+
${{ if eq(parameters.runAsPublic, 'true') }}:
139+
Build_Debug_arm64:
140+
_BuildConfig: Debug
141+
# override some variables for debug
142+
# _SignType has to be real for package publishing to succeed - do not override to test.
143+
_Platform: arm64
144+
Build_Release_arm64:
145+
_BuildConfig: Release
146+
_Platform: arm64
147+
steps:
148+
- checkout: self
149+
clean: true
150+
151+
# Set VSO Variable(s)
152+
- powershell: eng\pre-build.ps1
153+
displayName: Pre-Build - Set VSO Variables
154+
155+
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
156+
- task: PowerShell@2
157+
displayName: Setup Private Feeds Credentials
158+
inputs:
159+
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
160+
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
161+
env:
162+
Token: $(dn-bot-dnceng-artifact-feeds-rw)
163+
164+
# Use utility script to run script command dependent on agent OS.
165+
- script: eng\common\cibuild.cmd
166+
-configuration $(_BuildConfig)
167+
-prepareMachine
168+
$(_PublishArgs)
169+
$(_SignArgs)
170+
$(_OfficialBuildIdArgs)
171+
$(_PlatformArgs)
172+
$(_InternalRuntimeDownloadArgs)
173+
displayName: Windows Build / Publish
174+
# This condition should be kept in sync with the condition for 'Run DRTs' step
175+
# When building on a regular pipeline (!_HelixPipeline), build as usual
176+
# When building on a Helix pipeline, only build Release configs
177+
# (!_HelixPipeline) ||
178+
# (_HelixPipeline && _PublicBuildPipeline && _ContinuousIntegrationTestsEnabled && _BuildConfig == Release)
179+
condition: or(ne(variables['_HelixPipeline'], 'true'), and(eq(variables['_HelixPipeline'], 'true') ,eq(variables['_BuildConfig'], 'Release'), eq(variables['_PublicBuildPipeline'], 'true'), eq(variables['_ContinuousIntegrationTestsEnabled'], 'true')))
180+
181+
# Run DRTs
182+
- powershell: eng\common\cibuild.cmd
183+
-configuration $(_BuildConfig)
184+
$(_OfficialBuildIdArgs)
185+
$(_PlatformArgs)
186+
-projects $(Build.SourcesDirectory)\eng\helixpublish.proj
187+
/bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\HelixDrt.binlog
188+
displayName: Run Developer Regression Tests on Helix Machine (Release)
189+
env:
190+
HelixSource: $(_HelixSource)
191+
HelixType: 'tests/drt'
192+
HelixBuild: $(Build.BuildNumber)
193+
HelixTargetQueues: $(_TestHelixAgentPool)
194+
HelixAccessToken: $(_HelixToken) # only defined for internal CI
195+
Creator: $(_HelixCreator)
196+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
197+
# This condition should be kept in sync with the condition for cibuild.cmd step with displayName: "Windows Build / Publish"
198+
# Only run ...
199+
# ...When building on a Helix pipeline, only build Release configs
200+
#
201+
# (_HelixPipeline && _PublicBuildPipeline && _ContinuousIntegrationTestsEnabled && _BuildConfig == Release)
202+
#
203+
condition: and(succeeded(), eq(variables['_HelixPipeline'], 'true') ,eq(variables['_BuildConfig'], 'Release'), eq(variables['_PublicBuildPipeline'], 'true'), eq(variables['_ContinuousIntegrationTestsEnabled'], 'true'))

0 commit comments

Comments
 (0)