Skip to content

Commit 76b0cce

Browse files
v-wuzhaidsplaistedmmitche
authored
[release/6.0.4xx] Migrate to 1ES templates for internal builds (#39839)
Co-authored-by: Daniel Plaisted <[email protected]> Co-authored-by: Matt Mitchell (.NET) <[email protected]>
1 parent cc8b20d commit 76b0cce

File tree

4 files changed

+405
-174
lines changed

4 files changed

+405
-174
lines changed

.vsts-ci.yml

Lines changed: 190 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,9 @@ pr:
1313
- release/*
1414
- internal/release/*
1515

16-
1716
variables:
18-
- name: teamName
19-
value: Roslyn-Project-System
20-
- name: _DotNetPublishToBlobFeed
21-
value: false
2217
- name: _CIBuild
2318
value: -restore -build -sign -pack -ci
24-
- name: _DotNetArtifactsCategory
25-
value: .NETCore
26-
- name: _DotNetValidationArtifactsCategory
27-
value: .NETCore
2819
- name: PostBuildSign
2920
value: true
3021
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
@@ -41,160 +32,204 @@ variables:
4132
/p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
4233
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
4334
- group: DotNet-CLI-SDLValidation-Params
35+
# Set the MicroBuild plugin installation directory to the agent temp directory to avoid SDL tool scanning.
36+
- name: MicroBuildOutputFolderOverride
37+
value: $(Agent.TempDirectory)
38+
39+
resources:
40+
repositories:
41+
- repository: 1esPipelines
42+
type: git
43+
name: 1ESPipelineTemplates/1ESPipelineTemplates
44+
ref: refs/tags/release
4445

45-
stages:
46-
- stage: build
47-
displayName: Build
48-
jobs:
49-
- job: Publish_Build_Configuration
50-
pool:
51-
${{ if eq(variables['System.TeamProject'], 'public') }}:
52-
name: NetCore-Svc-Public
53-
demands: ImageOverride -equals windows.vs2019.amd64.open
54-
${{ if eq(variables['System.TeamProject'], 'internal') }}:
46+
extends:
47+
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
48+
parameters:
49+
sdl:
50+
sourceAnalysisPool:
5551
name: NetCore1ESPool-Svc-Internal
56-
demands: ImageOverride -equals windows.vs2019.amd64
57-
steps:
58-
- publish: $(Build.SourcesDirectory)\eng\BuildConfiguration
59-
artifact: BuildConfiguration
60-
displayName: Publish Build Config
61-
- template: /eng/build.yml
62-
parameters:
63-
agentOs: Windows_NT
64-
pool:
65-
${{ if eq(variables['System.TeamProject'], 'public') }}:
66-
name: NetCore-Svc-Public
67-
demands: ImageOverride -equals windows.vs2022preview.amd64.open
68-
${{ if ne(variables['System.TeamProject'], 'public') }}:
69-
name: NetCore1ESPool-Svc-Internal
70-
demands: ImageOverride -equals windows.vs2022preview.amd64
71-
${{ if eq(variables['System.TeamProject'], 'public') }}:
72-
helixTargetQueue: Windows.Amd64.VS2022.Pre.Open
73-
${{ if ne(variables['System.TeamProject'], 'public') }}:
74-
helixTargetQueue: Windows.Amd64.VS2022.Pre
75-
strategy:
76-
matrix:
77-
Build_Release:
78-
_BuildConfig: Release
79-
_PublishArgs: '-publish /p:DotNetPublishUsingPipelines=true'
80-
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
81-
_SignType: test
82-
_Test: -test
83-
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
84-
_SignType: real
85-
_Test: ''
86-
- template: /eng/common/templates/job/source-build.yml
87-
parameters:
88-
platform:
89-
name: 'Managed'
90-
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343'
91-
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
92-
- template: /eng/build.yml
93-
parameters:
94-
agentOs: Windows_NT_FullFramework
52+
image: 1es-windows-2022
53+
os: windows
54+
stages:
55+
- stage: build
56+
displayName: Build
57+
jobs:
58+
- job: Publish_Build_Configuration
9559
pool:
9660
${{ if eq(variables['System.TeamProject'], 'public') }}:
9761
name: NetCore-Svc-Public
98-
demands: ImageOverride -equals windows.vs2022preview.amd64.open
99-
${{ if ne(variables['System.TeamProject'], 'public') }}:
62+
image: 1es-windows-2019-open
63+
os: windows
64+
${{ if eq(variables['System.TeamProject'], 'internal') }}:
10065
name: NetCore1ESPool-Svc-Internal
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-
114-
- template: /eng/build.yml
115-
parameters:
116-
agentOs: Windows_NT_TestAsTools
117-
pool:
66+
image: 1es-windows-2019
67+
os: windows
68+
steps:
69+
- task: 1ES.PublishPipelineArtifact@1
70+
displayName: Publish Build Config
71+
inputs:
72+
targetPath: $(Build.SourcesDirectory)\eng\buildConfiguration
73+
artifactName: buildConfiguration
74+
- template: /eng/build.yml@self
75+
parameters:
76+
agentOs: Windows_NT
77+
pool:
78+
${{ if eq(variables['System.TeamProject'], 'public') }}:
79+
name: NetCore-Svc-Public
80+
image: 1es-windows-2022-open
81+
os: windows
82+
${{ if ne(variables['System.TeamProject'], 'public') }}:
83+
name: NetCore1ESPool-Svc-Internal
84+
image: 1es-windows-2022
85+
os: windows
11886
${{ if eq(variables['System.TeamProject'], 'public') }}:
119-
name: NetCore-Svc-Public
120-
demands: ImageOverride -equals windows.vs2019.amd64.open
87+
helixTargetQueue: Windows.Amd64.VS2022.Pre.Open
12188
${{ if ne(variables['System.TeamProject'], 'public') }}:
122-
name: NetCore1ESPool-Svc-Internal
123-
demands: ImageOverride -equals windows.vs2019.amd64
124-
strategy:
125-
matrix:
126-
Build_Debug:
127-
_BuildConfig: Debug
128-
_PublishArgs: ''
129-
_SignType: test
89+
helixTargetQueue: Windows.Amd64.VS2022.Pre
90+
variables:
91+
- name: _BuildConfig
92+
value: Release
93+
- name: _PublishArgs
94+
value: '-publish /p:DotNetPublishUsingPipelines=true'
95+
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
96+
- name: _SignType
97+
value: test
98+
- name: _Test
99+
value: -test
100+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
101+
- name: _SignType
102+
value: real
103+
- name: _Test
104+
value: ''
105+
- template: /eng/common/templates-official/job/source-build.yml@self
106+
parameters:
107+
platform:
108+
name: 'Managed'
109+
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343'
110+
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
111+
- template: /eng/build.yml@self
112+
parameters:
113+
agentOs: Windows_NT_FullFramework
114+
pool:
115+
${{ if eq(variables['System.TeamProject'], 'public') }}:
116+
name: NetCore-Svc-Public
117+
image: 1es-windows-2022-open
118+
os: windows
119+
${{ if ne(variables['System.TeamProject'], 'public') }}:
120+
name: NetCore1ESPool-Svc-Internal
121+
image: 1es-windows-2022
122+
os: windows
123+
${{ if eq(variables['System.TeamProject'], 'public') }}:
124+
helixTargetQueue: Windows.Amd64.VS2022.Pre.Open
125+
${{ if ne(variables['System.TeamProject'], 'public') }}:
126+
helixTargetQueue: Windows.Amd64.VS2022.Pre
127+
variables:
128+
- name: _BuildConfig
129+
value: Debug
130+
- name: _PublishArgs
131+
value: ''
132+
- name: _SignType
133+
value: test
134+
- name: _Test
135+
value: -test
130136

131-
- template: /eng/build.yml
132-
parameters:
133-
agentOs: Ubuntu_20_04
134-
pool:
135-
${{ if eq(variables['System.TeamProject'], 'public') }}:
136-
name: NetCore-Svc-Public
137-
demands: ImageOverride -equals Build.Ubuntu.2004.Amd64.open
138-
${{ if ne(variables['System.TeamProject'], 'public') }}:
139-
name: NetCore1ESPool-Svc-Internal
140-
demands: ImageOverride -equals Build.Ubuntu.2004.Amd64
141-
${{ if eq(variables['System.TeamProject'], 'public') }}:
142-
helixTargetQueue: Ubuntu.2004.Amd64.Open
143-
${{ if ne(variables['System.TeamProject'], 'public') }}:
144-
helixTargetQueue: Ubuntu.2004.Amd64
145-
strategy:
146-
matrix:
147-
Build_Release:
148-
_BuildConfig: Release
149-
_PublishArgs: ''
150-
_SignType: test
151-
_Test: -test
137+
- template: /eng/build.yml@self
138+
parameters:
139+
agentOs: Windows_NT_TestAsTools
140+
pool:
141+
${{ if eq(variables['System.TeamProject'], 'public') }}:
142+
name: NetCore-Svc-Public
143+
image: 1es-windows-2019-open
144+
os: windows
145+
${{ if ne(variables['System.TeamProject'], 'public') }}:
146+
name: NetCore1ESPool-Svc-Internal
147+
image: 1es-windows-2019
148+
os: windows
149+
variables:
150+
- name: _BuildConfig
151+
value: Debug
152+
- name: _PublishArgs
153+
value: ''
154+
- name: _SignType
155+
value: test
152156

153-
- template: /eng/build.yml
154-
parameters:
155-
agentOs: Darwin
156-
pool:
157-
vmImage: 'macOS-latest'
158-
${{ if eq(variables['System.TeamProject'], 'public') }}:
159-
helixTargetQueue: OSX.1200.Amd64.Open
160-
${{ if ne(variables['System.TeamProject'], 'public') }}:
161-
helixTargetQueue: OSX.1200.Amd64
162-
strategy:
163-
matrix:
164-
Build_Release:
165-
_BuildConfig: Release
166-
_PublishArgs: ''
167-
_SignType: test
168-
_Test: -test
157+
- template: /eng/build.yml@self
158+
parameters:
159+
agentOs: Ubuntu_20_04
160+
pool:
161+
${{ if eq(variables['System.TeamProject'], 'public') }}:
162+
name: NetCore-Svc-Public
163+
image: 1es-ubuntu-2004-open
164+
os: linux
165+
${{ if ne(variables['System.TeamProject'], 'public') }}:
166+
name: NetCore1ESPool-Svc-Internal
167+
image: 1es-ubuntu-2004
168+
os: linux
169+
${{ if eq(variables['System.TeamProject'], 'public') }}:
170+
helixTargetQueue: Ubuntu.2004.Amd64.Open
171+
${{ if ne(variables['System.TeamProject'], 'public') }}:
172+
helixTargetQueue: Ubuntu.2004.Amd64
173+
variables:
174+
- name: _BuildConfig
175+
value: Release
176+
- name: _PublishArgs
177+
value: ''
178+
- name: _SignType
179+
value: test
180+
- name: _Test
181+
value: -test
169182

170-
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
171-
- template: /eng/common/templates/job/publish-build-assets.yml
172-
parameters:
173-
publishUsingPipelines: true
174-
dependsOn:
175-
- Windows_NT
176-
- Source_Build_Managed
177-
pool:
178-
name: NetCore1ESPool-Svc-Internal
179-
demands: ImageOverride -equals windows.vs2019.amd64
180-
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
181-
- template: /eng/common/templates/post-build/post-build.yml
182-
parameters:
183-
publishingInfraVersion: 3
184-
enableSymbolValidation: false
185-
enableSigningValidation: false
186-
enableNugetValidation: false
187-
enableSourceLinkValidation: false
188-
publishInstallersAndChecksums: true
189-
SDLValidationParameters:
190-
enable: false
191-
params: ' -SourceToolsList @("policheck","credscan")
192-
-TsaInstanceURL $(_TsaInstanceURL)
193-
-TsaProjectName $(_TsaProjectName)
194-
-TsaNotificationEmail $(_TsaNotificationEmail)
195-
-TsaCodebaseAdmin $(_TsaCodebaseAdmin)
196-
-TsaBugAreaPath $(_TsaBugAreaPath)
197-
-TsaIterationPath $(_TsaIterationPath)
198-
-TsaRepositoryName "dotnet-sdk"
199-
-TsaCodebaseName "dotnet-sdk"
200-
-TsaPublish $True'
183+
- template: /eng/build.yml@self
184+
parameters:
185+
agentOs: Darwin
186+
pool:
187+
name: Azure Pipelines
188+
image: macOS-latest
189+
os: macOS
190+
${{ if eq(variables['System.TeamProject'], 'public') }}:
191+
helixTargetQueue: OSX.1200.Amd64.Open
192+
${{ if ne(variables['System.TeamProject'], 'public') }}:
193+
helixTargetQueue: OSX.1200.Amd64
194+
variables:
195+
- name: _BuildConfig
196+
value: Release
197+
- name: _PublishArgs
198+
value: ''
199+
- name: _SignType
200+
value: test
201+
- name: _Test
202+
value: -test
203+
204+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
205+
- template: /eng/common/templates-official/job/publish-build-assets.yml@self
206+
parameters:
207+
publishUsingPipelines: true
208+
dependsOn:
209+
- Windows_NT
210+
- Source_Build_Managed
211+
pool:
212+
name: NetCore1ESPool-Svc-Internal
213+
image: 1es-windows-2019
214+
os: windows
215+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
216+
- template: /eng/common/templates-official/post-build/post-build.yml@self
217+
parameters:
218+
publishingInfraVersion: 3
219+
enableSymbolValidation: false
220+
enableSigningValidation: false
221+
enableNugetValidation: false
222+
enableSourceLinkValidation: false
223+
publishInstallersAndChecksums: true
224+
SDLValidationParameters:
225+
enable: false
226+
params: ' -SourceToolsList @("policheck","credscan")
227+
-TsaInstanceURL $(_TsaInstanceURL)
228+
-TsaProjectName $(_TsaProjectName)
229+
-TsaNotificationEmail $(_TsaNotificationEmail)
230+
-TsaCodebaseAdmin $(_TsaCodebaseAdmin)
231+
-TsaBugAreaPath $(_TsaBugAreaPath)
232+
-TsaIterationPath $(_TsaIterationPath)
233+
-TsaRepositoryName "dotnet-sdk"
234+
-TsaCodebaseName "dotnet-sdk"
235+
-TsaPublish $True'

0 commit comments

Comments
 (0)