dotnet-installer/eng/build.yml
Matt Mitchell 982a120d0e
Remove VS nupkg push (#14611)
Signing happens at the end of the build now, even with in-build signing. The staging pipeline pushes the nupkgs. This step is not necessary, and pushes unsigned nupkgs.
2022-09-28 15:54:18 -04:00

160 lines
5.7 KiB
YAML

parameters:
# Agent OS identifier and used as job name
agentOs: ''
# Agent pool
pool: {}
# Additional variables
variables: {}
# Build strategy - matrix
strategy: {}
# Job timeout
timeoutInMinutes: 180
# Publish using pipelines
enablePublishUsingPipelines: true
phases:
- template: /eng/common/templates/job/job.yml
parameters:
${{ if parameters.pgoInstrument }}:
name: PGO_${{ parameters.agentOs }}
${{ if not(parameters.pgoInstrument) }}:
name: ${{ parameters.agentOs }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
${{ if eq(parameters.agentOs, 'Windows_NT') }}:
enableMicrobuild: true
enablePublishBuildAssets: true
# Don't use built-in arcade logic for publishing artifacts and test results, as we manually do this and give better names
#enablePublishBuildArtifacts: true
#enablePublishTestResults: true
enablePublishUsingPipelines: ${{parameters.enablePublishUsingPipelines}}
enableTelemetry: true
helixRepo: dotnet/installer
pool: ${{ parameters.pool }}
${{ if ne(parameters.strategy, '') }}:
strategy: ${{ parameters.strategy }}
workspace:
clean: all
variables:
- _PgoInstrument: ''
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- _PackArg: '-pack'
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
- _PackArg: '--pack'
- ${{ if parameters.pgoInstrument }}:
- _PgoInstrument: '/p:PgoInstrument=true'
- _PackArg: ''
- _AgentOSName: ${{ parameters.agentOs }}
- _TeamName: Roslyn-Project-System
- _SignType: test
- _BuildArgs: '/p:DotNetSignType=$(_SignType) $(_PgoInstrument)'
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-Symbol-Server-PATs
- group: DotNet-HelixApi-Access
- group: DotNet-Blob-Feed
- _DotNetPublishToBlobFeed: true
- _PushToVSFeed: true
- _SignType: real
- _BuildArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:DotNetSignType=$(_SignType)
/p:TeamName=$(_TeamName)
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
$(_PgoInstrument)
steps:
- checkout: self
clean: true
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- 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: build.cmd
$(_TestArg) $(_PackArg)
-publish -ci -sign
-Configuration $(_BuildConfig)
-Architecture $(_BuildArchitecture)
$(_BuildArgs)
$(_AdditionalBuildParameters)
$(_InternalRuntimeDownloadArgs)
displayName: Build
env:
DOTNET_CLI_UI_LANGUAGE: $(_DOTNET_CLI_UI_LANGUAGE)
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- task: Bash@3
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- ${{ if eq(parameters.agentOs, 'Linux') }}:
- script: ./build.sh
$(_TestArg) $(_PackArg)
--publish --ci
--noprettyprint
--configuration $(_BuildConfig)
$(_DockerParameter)
--architecture $(_BuildArchitecture)
$(_LinuxPortable)
$(_RuntimeIdentifier)
$(_BuildArgs)
$(_AdditionalBuildParameters)
$(_InternalRuntimeDownloadArgs)
displayName: Build
- ${{ if or(eq(parameters.agentOs, 'Darwin'), eq(parameters.agentOs, 'FreeBSD')) }}:
- script: ./build.sh
$(_TestArg)
--pack --publish --ci
--noprettyprint
--configuration $(_BuildConfig)
--architecture $(_BuildArchitecture)
$(_RuntimeIdentifier)
$(_BuildArgs)
$(_AdditionalBuildParameters)
$(_InternalRuntimeDownloadArgs)
displayName: Build
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testRunner: XUnit
testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml'
testRunTitle: '$(_AgentOSName)_$(Agent.JobName)'
platform: '$(BuildPlatform)'
configuration: '$(_BuildConfig)'
condition: ne(variables['_TestArg'], '')
- task: CopyFiles@2
displayName: Gather Logs
inputs:
SourceFolder: '$(Build.SourcesDirectory)/artifacts'
Contents: |
log/$(_BuildConfig)/**/*
TestResults/$(_BuildConfig)/**/*
TargetFolder: '$(Build.ArtifactStagingDirectory)'
continueOnError: true
condition: always()
- task: PublishBuildArtifacts@1
displayName: Publish Logs to VSTS
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)'
publishLocation: Container
continueOnError: true
condition: always()