forked from dotnet/format
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-official.yml
125 lines (124 loc) · 4.99 KB
/
azure-pipelines-official.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
resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
# Branches that trigger a build on commit
trigger:
- main
- release/*
- internal/release/*
variables:
- group: AzureDevOps-Artifact-Feeds-Pats
extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
sdl:
sourceAnalysisPool:
name: NetCore1ESPool-Svc-Internal
image: 1es-windows-2022
os: windows
pool:
name: netcore1espool-internal
image: windows.vs2022preview.amd64
os: windows
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: build
displayName: Build and Test
pool:
name: NetCore1ESPool-Svc-Internal
demands: ImageOverride -equals windows.vs2022preview.amd64
jobs:
- job: OfficialBuild
displayName: Official Build
templateContext:
mb:
signing:
enabled: true
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
signType: $(SignType)
outputs:
- output: pipelineArtifact
displayName: 'Publish Logs'
condition: not(succeeded())
targetPath: '$(Build.SourcesDirectory)\artifacts\log\$(BuildConfiguration)'
artifactName: 'Logs'
publishLocation: Container
- output: pipelineArtifact
displayName: 'Publish Logs'
condition: not(succeeded())
targetPath: '$(Build.SourcesDirectory)\artifacts\TestResults\$(BuildConfiguration)'
artifactName: 'TestResults'
publishLocation: Container
- output: buildArtifacts
displayName: 'Publish Packages'
condition: succeeded()
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\packages\$(BuildConfiguration)'
ArtifactName: 'PackageArtifacts'
- output: buildArtifacts
displayName: 'Publish Asset Manifests'
condition: succeeded()
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(BuildConfiguration)/AssetManifest'
ArtifactName: AssetManifests
- output: pipelineArtifact
displayName: 'Publish MicroBuild Artifacts'
condition: succeededOrFailed()
targetPath: '$(Build.ArtifactStagingDirectory)\MicroBuild\Output'
artifactName: MicroBuildOutputs
publishLocation: Container
steps:
- task: PowerShell@2
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- script: eng\common\CIBuild.cmd -configuration $(BuildConfiguration) /p:OfficialBuildId=$(Build.BuildNumber) /p:VisualStudioDropName=$(VisualStudioDropName) /p:DotNetSignType=$(SignType) /p:DotNetFinalVersionKind=$(_additionalBuildArgs) /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)\*.trx'
mergeTestResults: true
testRunTitle: 'Unit Tests'
condition: always()
- job: codeql
displayName: CodeQL
variables:
- name: skipComponentGovernanceDetection
value: true
- name: Codeql.Enabled
value: true
- name: Codeql.Cadence
value: 0
- name: Codeql.TSAEnabled
value: true
steps:
- task: PowerShell@2
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- script: eng\common\cibuild.cmd -configuration Release -prepareMachine /p:Test=false
displayName: Windows Build
- template: /eng/common/templates-official/jobs/source-build.yml@self
- template: /eng/common/templates-official/job/publish-build-assets.yml@self
parameters:
publishUsingPipelines: true
dependsOn:
- OfficialBuild
- Source_Build_Managed
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: /eng/common/templates-official/post-build/post-build.yml@self
parameters:
publishingInfraVersion: 3
enableSymbolValidation: false
enableSourceLinkValidation: false