Merged PR 7612: Use pipeline publishing instead of BAR publishing

Publish via pipeline because that is the current approach to use.
This commit is contained in:
Jakub Jares 2020-04-27 12:20:20 +00:00
Родитель aa1a978939
Коммит 53ee00f57b
1 изменённых файлов: 88 добавлений и 79 удалений

Просмотреть файл

@ -13,87 +13,96 @@ trigger:
pr:
- master
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: true
enablePublishBuildAssets: true
enablePublishUsingPipelines: $(_PublishUsingPipelines)
enableTelemetry: true
helixRepo: dotnet/test-templates
jobs:
- job: Windows
pool:
# For public or PR jobs, use the hosted pool. For internal jobs use the internal pool.
# Will eventually change this to two BYOC pools.
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
name: NetCorePublic-Pool
queue: buildpool.windows.10.amd64.vs2019.pre.open
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
name: NetCoreInternal-Pool
queue: buildpool.windows.10.amd64.vs2019.pre
variables:
- _OfficialBuildArgs: ''
# Only enable publishing in official builds.
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
# DotNet-Blob-Feed provides: dotnetfeed-storage-access-key-1
# Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
- group: DotNet-Blob-Feed
- group: DotNet-Symbol-Server-Pats
- group: Publish-Build-Assets
- group: DotNet-VSTS-Infra-Access
- _VisualStudioDropName: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
- _OfficialBuildArgs: /p:DotNetSignType=$(_SignType)
/p:TeamName=$(_TeamName)
/p:VisualStudioDropName=$(_VisualStudioDropName)
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
/p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
strategy:
matrix:
Debug:
_BuildConfig: Debug
_SignType: test
_DotNetPublishToBlobFeed: false
_BuildArgs: ''
Release:
_BuildConfig: Release
# PRs or external builds are not signed.
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
stages:
- stage: build
displayName: Build
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: true
enablePublishBuildAssets: true
enablePublishUsingPipelines: $(_PublishUsingPipelines)
enableTelemetry: true
helixRepo: dotnet/test-templates
jobs:
- job: Windows
pool:
# For public or PR jobs, use the hosted pool. For internal jobs use the internal pool.
# Will eventually change this to two BYOC pools.
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
name: NetCorePublic-Pool
queue: buildpool.windows.10.amd64.vs2019.pre.open
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
name: NetCoreInternal-Pool
queue: buildpool.windows.10.amd64.vs2019.pre
variables:
- _OfficialBuildArgs: ''
# Only enable publishing in official builds.
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
# DotNet-Blob-Feed provides: dotnetfeed-storage-access-key-1
# Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
- group: DotNet-Blob-Feed
- group: DotNet-Symbol-Server-Pats
- group: Publish-Build-Assets
- group: DotNet-VSTS-Infra-Access
- _VisualStudioDropName: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
- _OfficialBuildArgs: /p:DotNetSignType=$(_SignType)
/p:TeamName=$(_TeamName)
/p:VisualStudioDropName=$(_VisualStudioDropName)
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
/p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
strategy:
matrix:
Debug:
_BuildConfig: Debug
_SignType: test
_DotNetPublishToBlobFeed: false
_BuildArgs: ''
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
_SignType: real
_DotNetPublishToBlobFeed: true
_BuildArgs: $(_OfficialBuildArgs)
steps:
- checkout: self
clean: true
- script: eng\common\cibuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_BuildArgs)
displayName: Build and Publish
Release:
_BuildConfig: Release
# PRs or external builds are not signed.
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
_SignType: test
_DotNetPublishToBlobFeed: false
_BuildArgs: ''
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
_SignType: real
_DotNetPublishToBlobFeed: true
publishUsingPipelines: $(_PublishUsingPipelines)
_BuildArgs: $(_OfficialBuildArgs)
steps:
- checkout: self
clean: true
- script: eng\common\cibuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_BuildArgs)
displayName: Build and Publish
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
projects: 'test\Microsoft.TestTemplates.AcceptanceTests.sln'
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1
displayName: Upload Azure DevOps Drop
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
DropName: $(_VisualStudioDropName)
DropFolder: 'artifacts\VSSetup\$(_BuildConfig)\Insertion'
AccessToken: $(dn-bot-devdiv-build-rw-code-rw)
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
command: test
projects: 'test\Microsoft.TestTemplates.AcceptanceTests.sln'
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1
displayName: Upload Azure DevOps Drop
inputs:
DropName: $(_VisualStudioDropName)
DropFolder: 'artifacts\VSSetup\$(_BuildConfig)\Insertion'
AccessToken: $(dn-bot-devdiv-build-rw-code-rw)
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: \eng\common\templates\post-build\post-build.yml
parameters:
enableSourceLinkValidation: false