150 строки
5.6 KiB
YAML
150 строки
5.6 KiB
YAML
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
|