-
Notifications
You must be signed in to change notification settings - Fork 76
/
.vsts-ci.yml
149 lines (137 loc) · 5.61 KB
/
.vsts-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
resources:
repositories:
- repository: self
clean: true
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
# The variables `_DotNetArtifactsCategory` and `_DotNetValidationArtifactsCategory` are required for proper publishing of build artifacts. See https://github.com/dotnet/roslyn/pull/38259
variables:
- name: _DotNetArtifactsCategory
value: .NETCore
- name: _DotNetValidationArtifactsCategory
value: .NETCoreValidation
- name: Codeql.Enabled
value: true
# $(microsoft-symbol-server-pat) and $(symweb-symbol-server-pat) come from this group
- group: DotNet-Symbol-Server-Pats
- name: BuildConfiguration
value: Release
- name: SignType
value: Real
- name: system.debug
value: false
- name: TeamName
value: Roslyn
# Branches that trigger a build on commit
trigger:
- main
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
sdl:
sourceAnalysisPool:
name: NetCore1ESPool-Svc-Internal
image: 1es-windows-2022
os: windows
pool:
name: NetCore1ESPool-Svc-Internal
image: 1es-windows-2022
os: windows
stages:
- stage: build
displayName: Build and Test
jobs:
- job: OfficialBuild
displayName: Official Build
templateContext:
outputs:
# Note that insertion scripts currently depend on bin directory being uploaded to drops.
- output: buildArtifacts
PathtoPublish: $(Build.SourcesDirectory)\artifacts\bin
displayName: Publish binaries
publishLocation: Container
artifactName: bin
condition: succeededOrFailed()
- output: buildArtifacts
PathtoPublish: $(Build.SourcesDirectory)\artifacts\log\$(BuildConfiguration)
displayName: Publish logs
artifactName: 'Build Diagnostic Files'
publishLocation: Container
continueOnError: true
condition: succeededOrFailed()
- output: buildArtifacts
displayName: Publish test results
PathtoPublish: $(Build.SourcesDirectory)\artifacts\TestResults\$(BuildConfiguration)
artifactName: 'TestResults'
publishLocation: Container
condition: succeededOrFailed()
# Publish our NuPkgs as an artifact. The name of this artifact must be PackageArtifacts as the
# arcade templates depend on the name.
- output: buildArtifacts
PathtoPublish: $(Build.SourcesDirectory)\artifacts\packages\$(BuildConfiguration)
displayName: Publish packages
artifactName: 'PackageArtifacts'
condition: succeededOrFailed()
- output: buildArtifacts
displayName: Publish Asset Manifests
PathtoPublish: $(Build.SourcesDirectory)\artifacts\log\$(BuildConfiguration)\AssetManifest
artifactName: 'AssetManifests'
condition: succeeded()
- output: buildArtifacts
displayName: Publish MicroBuild Artifacts
PathtoPublish: $(Build.ArtifactStagingDirectory)\MicroBuild\Output
artifactName: MicroBuildOutputs
artifactType: Container
condition: succeededOrFailed()
steps:
- task: MicroBuildSigningPlugin@4
displayName: Install Signing Plugin
inputs:
zipSources: false
signType: $(SignType)
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
env:
TeamName: '$(TeamName)'
condition: and(succeeded(), ne(variables['SignType'], ''))
- script: eng\common\CIBuild.cmd
-configuration $(BuildConfiguration)
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:DotNetSignType=$(SignType)
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:DotnetPublishUsingPipelines=true
displayName: Build
- template: /eng/common/templates-official/steps/generate-sbom.yml@self
- task: PublishTestResults@2
displayName: Publish xUnit Test Results
inputs:
testRunner: XUnit
testResultsFiles: '$(Build.SourcesDirectory)\artifacts\TestResults\$(BuildConfiguration)\*.xml'
mergeTestResults: true
testRunTitle: 'Unit Tests'
condition: succeededOrFailed()
- task: MicroBuildCleanup@1
displayName: Cleanup
condition: succeededOrFailed()
# Publish to Build Asset Registry
- template: /eng/common/templates-official/job/publish-build-assets.yml@self
parameters:
publishUsingPipelines: true
pool:
name: netcore1espool-internal
os: 1es-windows-2022-pt
dependsOn:
- OfficialBuild
queue:
name: Hosted VS2017
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: eng\common\templates-official\post-build\post-build.yml@self
parameters:
# Symbol validation is not entirely reliable as of yet, so should be turned off until
# https://github.com/dotnet/arcade/issues/2871 is resolved.
enableSymbolValidation: false
enableSourceLinkValidation: false
publishingInfraVersion: 3