Skip to content

Commit c96672b

Browse files
authored
Add official pipeline using 1ES template (#2361)
* Add official pipeline using 1ES template * Remove -pt suffix
1 parent 3c29d7e commit c96672b

File tree

1 file changed

+183
-0
lines changed

1 file changed

+183
-0
lines changed

.vsts-ci-official.yml

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
variables:
2+
- name: _TeamName
3+
value: DotNetCore
4+
- name: _DotNetArtifactsCategory
5+
value: .NETCore
6+
- name: Codeql.Enabled
7+
value: true
8+
9+
# CI and PR triggers
10+
trigger:
11+
batch: true
12+
branches:
13+
include:
14+
- main
15+
16+
pr:
17+
autoCancel: false
18+
branches:
19+
include:
20+
- '*'
21+
22+
resources:
23+
repositories:
24+
- repository: 1ESPipelineTemplates
25+
type: git
26+
name: 1ESPipelineTemplates/1ESPipelineTemplates
27+
ref: refs/tags/release
28+
29+
extends:
30+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
31+
parameters:
32+
pool:
33+
name: NetCore1ESPool-Svc-Internal
34+
image: 1es-windows-2022
35+
os: windows
36+
customBuildTags:
37+
- ES365AIMigrationTooling
38+
stages:
39+
- stage: build
40+
displayName: Build and Test
41+
jobs:
42+
- template: /eng/common/templates-official/jobs/jobs.yml@self
43+
parameters:
44+
enableMicrobuild: true
45+
enablePublishBuildArtifacts: true
46+
enablePublishUsingPipelines: true
47+
enablePublishTestResults: true
48+
enablePublishBuildAssets: true
49+
enableTelemetry: true
50+
enableSourceBuild: true
51+
helixRepo: dotnet/command-line-api
52+
timeoutInMinutes: 180 # increase timeout since BAR publishing might wait a long time
53+
jobs:
54+
- job: Windows
55+
pool:
56+
# For public or PR jobs, use the hosted pool. For internal jobs use the internal pool.
57+
# Will eventually change this to two BYOC pools.
58+
${{ if ne(variables['System.TeamProject'], 'internal') }}:
59+
name: NetCore-Public
60+
demands: ImageOverride -equals windows.vs2022.amd64.open
61+
${{ if eq(variables['System.TeamProject'], 'internal') }}:
62+
name: NetCore1ESPool-Internal
63+
demands: ImageOverride -equals windows.vs2022.amd64
64+
variables:
65+
# Only enable publishing in official builds.
66+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
67+
# Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
68+
- group: DotNet-Symbol-Server-Pats
69+
- group: Publish-Build-Assets
70+
- name: _OfficialBuildArgs
71+
value: /p:DotNetSignType=$(_SignType)
72+
/p:TeamName=$(_TeamName)
73+
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
74+
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
75+
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
76+
/p:PublishToSymbolServer=true
77+
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
78+
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
79+
- name: _PublishUsingPipelines
80+
value: true
81+
# else
82+
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
83+
- name: _OfficialBuildArgs
84+
value: ''
85+
strategy:
86+
matrix:
87+
${{ if in(variables['Build.Reason'], 'PullRequest') }}:
88+
Debug:
89+
_BuildConfig: Debug
90+
_SignType: test
91+
_BuildArgs:
92+
93+
Release:
94+
_BuildConfig: Release
95+
# PRs or external builds are not signed.
96+
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
97+
_SignType: test
98+
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
99+
_SignType: real
100+
_BuildArgs: $(_OfficialBuildArgs)
101+
102+
templateContext:
103+
outputs:
104+
- output: pipelineArtifact
105+
displayName: Upload package artifacts
106+
condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
107+
targetPath: artifacts/packages/
108+
artifactName: artifacts
109+
- output: pipelineArtifact
110+
displayName: Publish Artifact Symbols
111+
condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
112+
targetPath: '$(Build.SourcesDirectory)\artifacts\SymStore\$(_BuildConfig)'
113+
artifactName: 'NativeSymbols'
114+
115+
steps:
116+
- checkout: self
117+
clean: true
118+
- script: eng\common\cibuild.cmd
119+
-configuration $(_BuildConfig)
120+
-prepareMachine
121+
$(_BuildArgs)
122+
displayName: Build and Publish
123+
124+
- job: Ubuntu
125+
displayName: Ubuntu
126+
pool:
127+
${{ if eq(variables['System.TeamProject'], 'public') }}:
128+
name: NetCore-Svc-Public
129+
demands: ImageOverride -equals 1es-ubuntu-2004-open
130+
${{ if eq(variables['System.TeamProject'], 'internal') }}:
131+
name: NetCore1ESPool-Svc-Internal
132+
demands: ImageOverride -equals 1es-ubuntu-2004
133+
os: linux
134+
strategy:
135+
matrix:
136+
${{ if in(variables['Build.Reason'], 'PullRequest') }}:
137+
Debug:
138+
_BuildConfig: Debug
139+
_SignType: none
140+
Release:
141+
_BuildConfig: Release
142+
_SignType: none
143+
steps:
144+
- checkout: self
145+
clean: true
146+
- bash: |
147+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
148+
sudo apt-add-repository "deb https://apt.llvm.org/focal/ llvm-toolchain-focal-9 main"
149+
sudo apt-get update
150+
- bash: |
151+
sudo apt-get install cmake clang-9 libicu66 uuid-dev libcurl4-openssl-dev zlib1g-dev libkrb5-dev
152+
- script: eng/common/cibuild.sh
153+
--configuration $(_BuildConfig)
154+
--prepareMachine
155+
displayName: Build
156+
157+
- job: MacOS
158+
displayName: MacOS
159+
pool:
160+
name: Azure Pipelines
161+
image: macOS-latest
162+
os: macOS
163+
strategy:
164+
matrix:
165+
${{ if in(variables['Build.Reason'], 'PullRequest') }}:
166+
Debug:
167+
_BuildConfig: Debug
168+
_SignType: none
169+
_DotNetPublishToBlobFeed: false
170+
Release:
171+
_BuildConfig: Release
172+
_SignType: none
173+
_DotNetPublishToBlobFeed: false
174+
steps:
175+
- checkout: self
176+
clean: true
177+
- script: eng/common/cibuild.sh
178+
--configuration $(_BuildConfig)
179+
--prepareMachine
180+
displayName: Build
181+
182+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
183+
- template: /eng/common/templates-official/post-build/post-build.yml@self

0 commit comments

Comments
 (0)