matrix:
debug:
_BuildConfig: Debug
- _PublishType: none
release:
_BuildConfig: Release
- _PublishType: blob
targetArchitecture: x64
jobs:
- - job: ${{ parameters.displayName }}
- displayName: ${{ parameters.displayName }}
+ - job: ${{ parameters.name }}
+ displayName: ${{ parameters.name }}
pool:
- ${{ if and(eq(parameters.displayName, 'Build_FreeBSD_x64'), ne(variables['System.TeamProject'], 'public')) }}:
+ ${{ if and(eq(parameters.name, 'FreeBSD_x64'), ne(variables['System.TeamProject'], 'public')) }}:
name: dnceng-freebsd-internal
- ${{ if ne(parameters.displayName, 'Build_FreeBSD_x64') }}:
+ ${{ if ne(parameters.name, 'FreeBSD_x64') }}:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: NetCorePublic-Pool
queue: buildpool.ubuntu.1604.amd64.open
strategy: ${{ parameters.strategy }}
variables:
- ${{ if ne(parameters.displayName, 'Build_FreeBSD_x64')}}:
+ ${{ if ne(parameters.name, 'FreeBSD_x64')}}:
RunArguments: >-
docker run --privileged --rm
-v "$(Build.SourcesDirectory):/root/coresetup"
${{ parameters.additionalRunArgs }}
${{ parameters.dockerImage }}
- ${{ if eq(parameters.displayName, 'Build_FreeBSD_x64')}}:
+ ${{ if eq(parameters.name, 'FreeBSD_x64')}}:
RunArguments: export DotNetBootstrapCliTarPath=/dotnet-sdk-freebsd-x64.tar &&
CommonMSBuildArgs: >-
/p:OfficialBuildId=$(OfficialBuildId)
/p:TargetArchitecture=${{ parameters.targetArchitecture }}
+ # Don't put additionalMSBuildArgs as the last line. It may or may not have extra args. If the
+ # parameter is empty, AzDO replaces it with empty space without chomping the extra newline.
+ # This causes a newline in the arg string that causes failure.
BuildArguments: >-
--ci --test
/p:CrossBuild=${{ parameters.crossBuild }}
/p:DisableCrossgen=${{ parameters.disableCrossgen }}
/p:PortableBuild=${{ parameters.portableBuild }}
- /p:StripSymbols=true
/p:SkipTests=${{ parameters.skipTests }}
$(CommonMSBuildArgs)
${{ parameters.additionalMSBuildArgs }}
+ /p:StripSymbols=true
PublishArguments: >-
- /p:PublishType=$(_PublishType)
/p:PortableBuild=${{ parameters.portableBuild }}
- /bl:msbuild.publish.binlog
$(CommonMSBuildArgs)
- ${{ parameters.additionalMSBuildArgs }}
+ ${{ parameters.additionalMSBuildArgs }}
+ /bl:msbuild.publish.binlog
# Tell the build to package up the bits from the portable build.
PackagePortableBitsArgs: >-
$(RunArguments) ./build.sh $(BuildArguments)
displayName: Build
- # Publish only if internal and not PR
- - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- - script: |
- set -x
- df -h
- $(RunArguments) \
- ./Tools/msbuild.sh \
- ./publish/publish.proj \
- $(PublishArguments) \
- $(_CommonPublishArgs)
- displayName: Publish
- condition: and(succeeded(), eq(variables._BuildConfig, 'Release'))
-
# Only for glibc leg, here we produce RPMs and Debs
- - ${{ if eq(parameters.displayName, 'Build_Linux_x64_glibc')}}:
+ - ${{ if eq(parameters.name, 'Linux_x64_glibc')}}:
- task: CopyFiles@2
displayName: 'Copy built Portable linux-x64 binaries to staging directory'
inputs:
continueOnError: true
condition: succeededOrFailed()
- - task: PublishTestResults@2
- displayName: Publish Test Results
- inputs:
- testResultsFormat: 'xUnit'
- testResultsFiles: '*.xml'
- searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
- mergeTestResults: true
- testRunTitle: ${{ parameters.displayName }}-$(_BuildConfig)
- continueOnError: true
- condition: always()
-
- - task: CopyFiles@2
- displayName: Copy logs to stage
- inputs:
- SourceFolder: '$(Build.SourcesDirectory)'
- Contents: |
- **/*.log
- **/*.binlog
- TargetFolder: '$(Build.StagingDirectory)\BuildLogs'
- CleanTargetFolder: true
- continueOnError: true
- condition: succeededOrFailed()
-
- - task: PublishBuildArtifacts@1
- displayName: Publish Artifact BuildLogs
- inputs:
- PathtoPublish: '$(Build.StagingDirectory)\BuildLogs'
- ArtifactName: ${{ parameters.displayName }}-$(_BuildConfig)
- continueOnError: true
- condition: succeededOrFailed()
+ - template: steps/upload-job-artifacts.yml
+ parameters:
+ name: ${{ parameters.name }}
- script: df -h
displayName: Check space (df -h)
continueOnError: true
# Force clean up machine in case any docker images are left behind
- - ${{ if ne(parameters.displayName, 'Build_FreeBSD_x64')}}:
+ - ${{ if ne(parameters.name, 'FreeBSD_x64')}}:
- script: docker system prune -af && df -h
displayName: Run Docker clean up
condition: succeededOrFailed()
parameters:
- DependsOn: {}
- _PublishType: {}
+ DependsOn: []
+ PublishRidAgnosticPackagesFromJobName: ''
jobs:
- - job: Finalize_Publish
- displayName: Finalize_Publish
- # Run after all dependent legs are executed
- dependsOn: ${{ parameters.DependsOn }}
- pool:
- # Use a hosted pool when possible.
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
- name: Hosted VS2017
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- name: NetCoreInternal-Int-Pool
- queue: buildpool.windows.10.amd64.vs2017
- # Double the default timeout. Publishing is subject to huge delays due to contention on the dotnet-core blob feed
- timeoutInMinutes: 120
- workspace:
- clean: all
- variables:
- _PublishType: ${{ parameters._PublishType}}
- # Disable MSBuild node reuse in case this build is running on a persistent agent.
- # Use environment variable rather than /nr:false to make sure internal Execs that run MSBuild
- # commands also disable node reuse.
- MSBUILDDISABLENODEREUSE: 1
- steps:
+- job: Finalize_Publish
+ displayName: Finalize_Publish
+ # Run after all dependent legs are executed
+ dependsOn: ${{ parameters.DependsOn }}
+ pool:
+ # Use a hosted pool when possible.
+ ${{ if eq(variables['System.TeamProject'], 'public') }}:
+ name: Hosted VS2017
+ ${{ if ne(variables['System.TeamProject'], 'public') }}:
+ name: NetCoreInternal-Int-Pool
+ queue: buildpool.windows.10.amd64.vs2017
+ # Double the default timeout. Publishing is subject to huge delays due to contention on the dotnet-core blob feed
+ timeoutInMinutes: 120
+ workspace:
+ clean: all
+ variables:
+ # Only get the secret variable groups if the def has the official name. Reduce dev build def risk.
+ - ${{ if eq(variables['Build.DefinitionName'], 'dotnet-core-setup') }}:
+ # Variable groups containing official build publish info.
+ - group: DotNet-Blob-Feed
+ - group: DotNet-Symbol-Server-Pats
+ # Used for publishing individual leg assets to azure blob storage
+ - group: DotNet-DotNetCli-Storage
+ # Used for dotnet/versions update
+ - group: DotNet-Versions-Publish
- # Initialize tooling
- - script: build.cmd
- -- /t:BuildTraversalBuildDependencies
- displayName: Initialize tooling
- condition: succeeded()
+ # Blob storage publish (installers and checksums)
+ - name: _AzureAccountName
+ value: $[ coalesce(variables.AzureAccountName, 'dotnetcli') ]
+ - name: _ContainerName
+ value: $[ coalesce(variables.ContainerName, 'dotnet') ]
+ - name: _AzureAccessToken
+ value: $[ coalesce(variables.AzureAccessToken, '$(dotnetcli-storage-key)') ]
+ - name: _ChecksumAzureAccountName
+ value: $[ coalesce(variables.ChecksumAzureAccountName, 'dotnetclichecksums') ]
+ - name: _ChecksumContainerName
+ value: $[ coalesce(variables.ChecksumContainerName, 'dotnet') ]
+ - name: _ChecksumAzureAccessToken
+ value: $[ coalesce(variables.ChecksumAzureAccessToken, '$(dotnetclichecksums-storage-key)') ]
+ - name: _CommonPublishArgs
+ value: >-
+ /p:AzureAccountName=$(_AzureAccountName)
+ /p:ContainerName=$(_ContainerName)
+ /p:AzureAccessToken=$(_AzureAccessToken)
+ /p:ChecksumAzureAccountName=$(_ChecksumAzureAccountName)
+ /p:ChecksumContainerName=$(_ChecksumContainerName)
+ /p:ChecksumAzureAccessToken=$(_ChecksumAzureAccessToken)
- - task: MicroBuildSigningPlugin@2
- displayName: Install MicroBuild plugin for Signing
- inputs:
- signType: $(SignType)
- zipSources: false
- feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
- continueOnError: false
- condition: and(succeeded(), in(variables['SignType'], 'real', 'test'))
+ # Blob feed publish
+ - name: _PublishBlobFeedUrl
+ value: $[ coalesce(variables.PublishBlobFeedUrl, 'https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json') ]
+ - name: _TransportFeedAccessToken
+ value: $[ coalesce(variables.TransportFeedAccessToken, '$(dotnetfeed-storage-access-key-1)') ]
+ - name: _BlobFeedArgs
+ value: >-
+ /p:PackagesUrl=$(_PublishBlobFeedUrl)
+ /p:SymbolPackagesUrl=$(_PublishBlobFeedUrl)
+ /p:TransportFeedAccessToken=$(_TransportFeedAccessToken)
- - task: MSBuild@1
- displayName: Publish (no PublishType)
- inputs:
- solution: $(Build.SourcesDirectory)\publish\publish.proj
- platform: x64
- configuration: Release
- msbuildVersion: 15.0
- msbuildArchitecture: x64
- msbuildArguments: '/p:Finalize=true
- /p:OfficialPublish=true
- /p:PublishType=nopublishtype
- /p:SignType=$(SignType)
- /p:StabilizePackageVersion=$(IsStable)
- /p:TargetArchitecture=x64
- $(_BlobFeedArgs)
- $(_CommonPublishArgs)
- $(_NugetFeedArgs)
- $(_SymbolServerArgs)
- /bl:$(Build.SourcesDirectory)\finalizepublish.binlog
- /nr:false'
- condition: and(succeeded(), eq(variables._PublishType, 'nopublishtype'))
+ # Symbol Server update
+ - name: _MicrosoftSymbolServerPat
+ value: $[ coalesce(variables.MicrosoftSymbolServerPat, '$(microsoft-symbol-server-pat)') ]
+ - name: _SymwebSymbolServerPat
+ value: $[ coalesce(variables.SymwebSymbolServerPat, '$(symweb-symbol-server-pat)') ]
+ - name: _SymbolServerArgs
+ value: >-
+ /p:MicrosoftSymbolServerPat=$(_MicrosoftSymbolServerPat)
+ /p:SymwebSymbolServerPat=$(_SymwebSymbolServerPat)
- - task: CopyFiles@2
- displayName: Copy Files to $(Build.StagingDirectory)\BuildLogs
- inputs:
- SourceFolder: '$(Build.SourcesDirectory)'
- Contents: |
- *.log
- *.binlog
- TargetFolder: '$(Build.StagingDirectory)\BuildLogs'
- continueOnError: true
- condition: succeededOrFailed()
+ # dotnet/versions update
+ - name: _GitHubUser
+ value: $[ coalesce(variables.GitHubUser, 'dotnet-build-bot') ]
+ - name: _GitHubEmail
+ value: $[ coalesce(variables.GitHubEmail, 'dotnet-build-bot@microsoft.com') ]
+ - name: _GitHubAuthToken
+ value: $[ coalesce(variables.GitHubAuthToken, '$(AccessToken-dotnet-build-bot-public-repo)') ]
+ - name: _VersionsRepoOwner
+ value: $[ coalesce(variables.VersionsRepoOwner, 'dotnet') ]
+ - name: _VersionsRepo
+ value: $[ coalesce(variables.VersionsRepo, 'versions') ]
+ - name: _DotNetVersionsArgs
+ value: >-
+ /p:GitHubUser=$(_GitHubUser)
+ /p:GitHubEmail=$(_GitHubEmail)
+ /p:GitHubAuthToken=$(_GitHubAuthToken)
+ /p:VersionsRepoOwner=$(_VersionsRepoOwner)
+ /p:VersionsRepo=$(_VersionsRepo)
+ /p:VersionsRepoPath=build-info/dotnet/core-setup/$(FullBranchName)
- - task: CopyFiles@2
- displayName: Copy Manifest file
- inputs:
- SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/AssetManifest'
- TargetFolder: '$(Build.StagingDirectory)/AssetManifests'
- continueOnError: true
- condition: succeededOrFailed()
+ steps:
- - task: PublishBuildArtifacts@1
- displayName: Publish Artifact BuildLogs
- inputs:
- PathtoPublish: '$(Build.StagingDirectory)\BuildLogs'
- ArtifactName: Finalize_Publish
- condition: succeededOrFailed()
+ - task: MicroBuildSigningPlugin@2
+ displayName: Install MicroBuild plugin for Signing
+ inputs:
+ signType: $(SignType)
+ zipSources: false
+ feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
+ continueOnError: false
+ condition: and(succeeded(), in(variables['SignType'], 'real', 'test'))
- - task: PublishBuildArtifacts@1
- displayName: Push Asset Manifests
- inputs:
- PathtoPublish: '$(Build.StagingDirectory)/AssetManifests'
- PublishLocation: Container
- ArtifactName: AssetManifests
- continueOnError: true
- condition: succeededOrFailed()
+ - task: DownloadBuildArtifacts@0
+ displayName: Download Artifacts
+ inputs:
+ artifactName: Artifacts
+ downloadPath: $(Build.SourcesDirectory)\artifacts\PackageDownload
- - job: Finalize_Publish_Versions
- displayName: Finalize_Publish_Versions
- dependsOn:
- - Finalize_Publish
- pool:
- name: Hosted VS2017
- steps:
- # Initialize tooling
- - script: build.cmd -- /t:BuildTraversalBuildDependencies
- displayName: Initialize tooling
+ - powershell: |
+ $prefix = "refs/heads/"
+ $branch = "$(Build.SourceBranch)"
+ $branchName = $branch
+ if ($branchName.StartsWith($prefix))
+ {
+ $branchName = $branchName.Substring($prefix.Length)
+ }
+ Write-Host "For Build.SourceBranch $branch, FullBranchName is $branchName"
+ Write-Host "##vso[task.setvariable variable=FullBranchName;]$branchName"
+ displayName: Find true SourceBranchName
+
+ - script: >-
+ build.cmd -ci
+ -projects $(Build.SourcesDirectory)\publish\publish.proj
+ -warnAsError 0
+ /p:Configuration=Release
+ /p:Finalize=true
+ /p:PublishRidAgnosticPackagesFromJobName=${{ parameters.PublishRidAgnosticPackagesFromJobName }}
+ /p:SignType=$(SignType)
+ /p:DotNetSignType=$(SignType)
+ /p:TargetArchitecture=x64
+ $(_BlobFeedArgs)
+ $(_CommonPublishArgs)
+ $(_SymbolServerArgs)
+ $(_DotNetVersionsArgs)
+ /bl:$(Build.SourcesDirectory)\finalizepublish.binlog
+ displayName: Publish
- - powershell: |
- $prefix = "refs/heads/"
- $branch = "$(Build.SourceBranch)"
- $branchName = $branch
- if ($branchName.StartsWith($prefix))
- {
- $branchName = $branchName.Substring($prefix.Length)
- }
- Write-Host "For Build.SourceBranch $branch, FullBranchName is $branchName"
- Write-Host "##vso[task.setvariable variable=FullBranchName;]$branchName"
- displayName: Find true SourceBranchName
+ - task: CopyFiles@2
+ displayName: Copy Files to $(Build.StagingDirectory)\BuildLogs
+ inputs:
+ SourceFolder: '$(Build.SourcesDirectory)'
+ Contents: |
+ **/*.log
+ **/*.binlog
+ TargetFolder: '$(Build.StagingDirectory)\BuildLogs'
+ continueOnError: true
+ condition: succeededOrFailed()
- - task: MSBuild@1
- displayName: Publish (versions)
- inputs:
- solution: $(Build.SourcesDirectory)\publish\publish-type.proj
- platform: x64
- configuration: Release
- msbuildVersion: 15.0
- msbuildArchitecture: x64
- msbuildArguments: >-
- /p:PublishType=versions
- $(_DotNetVersionsArgs)
- $(_CommonPublishArgs)
- /bl:$(Build.SourcesDirectory)\publishversions.binlog
+ - task: CopyFiles@2
+ displayName: Copy Manifest file
+ inputs:
+ SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/AssetManifest'
+ TargetFolder: '$(Build.StagingDirectory)/AssetManifests'
+ continueOnError: true
+ condition: succeededOrFailed()
- - task: CopyFiles@2
- displayName: Copy Files to $(Build.StagingDirectory)\BuildLogs
- inputs:
- SourceFolder: '$(Build.SourcesDirectory)'
- Contents: |
- *.log
- *.binlog
- TargetFolder: '$(Build.StagingDirectory)\BuildLogs'
- continueOnError: true
- condition: succeededOrFailed()
+ - task: PublishBuildArtifacts@1
+ displayName: Publish Artifact BuildLogs
+ inputs:
+ PathtoPublish: '$(Build.StagingDirectory)\BuildLogs'
+ ArtifactName: Logs-Finalize_Publish
+ condition: succeededOrFailed()
- - task: PublishBuildArtifacts@1
- displayName: Publish Artifact BuildLogs
- inputs:
- PathtoPublish: '$(Build.StagingDirectory)\BuildLogs'
- ArtifactName: Finalize_Publish_Versions
- condition: succeededOrFailed()
+ - task: PublishBuildArtifacts@1
+ displayName: Push Asset Manifests
+ inputs:
+ PathtoPublish: '$(Build.StagingDirectory)/AssetManifests'
+ PublishLocation: Container
+ ArtifactName: AssetManifests
+ continueOnError: true
+ condition: succeededOrFailed()
+parameters:
+ name: ''
+
jobs:
-- job: Build_OSX
+- job: ${{ parameters.name }}
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: Hosted macOS
matrix:
debug:
_BuildConfig: Debug
- _PublishType: none
release:
_BuildConfig: Release
- _PublishType: blob
workspace:
clean: all
variables:
displayName: Build
condition: succeeded()
- - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- - script: $(Build.SourcesDirectory)/Tools/msbuild.sh
- $(Build.SourcesDirectory)/publish/publish.proj
- $(_CommonPublishArgs)
- /p:PublishType=$(_PublishType)
- /p:TargetArchitecture=x64
- /p:ConfigurationGroup=$(_BuildConfig)
- /p:PortableBuild=true
- /p:OSGroup=OSX
- /p:StabilizePackageVersion=$(IsStable)
- /bl:$(Build.SourcesDirectory)\publish.binlog
- displayName: Publish
- condition: and(succeeded(), eq(variables._BuildConfig, 'Release'))
-
- - task: PublishTestResults@2
- displayName: Publish Test Results
- inputs:
- testResultsFormat: 'xUnit'
- testResultsFiles: '*.xml'
- searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
- mergeTestResults: true
- testRunTitle: ${{ parameters.displayName }}-$(_BuildConfig)
- continueOnError: true
- condition: always()
-
- - task: CopyFiles@2
- displayName: Copy logs to stage
- inputs:
- SourceFolder: '$(Build.SourcesDirectory)'
- Contents: |
- **/*.log
- **/*.binlog
- TargetFolder: '$(Build.StagingDirectory)/BuildLogs'
- continueOnError: true
- condition: succeededOrFailed()
-
- - task: PublishBuildArtifacts@1
- displayName: Publish Artifact BuildLogs
- inputs:
- PathtoPublish: '$(Build.StagingDirectory)/BuildLogs'
- ArtifactName: Build_OSX-$(_BuildConfig)
- continueOnError: true
- condition: succeededOrFailed()
-
\ No newline at end of file
+ - template: steps/upload-job-artifacts.yml
+ parameters:
+ name: ${{ parameters.name }}
${{ parameters.outputRidArg }} \
/bl:msbuild.${{ parameters.distroRid }}.installers.binlog
displayName: Package ${{ parameters.packageStepDescription }} - ${{ parameters.distroRid }}
-
-- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- - script: |
- set -x
- df -h
- $(DockerRunMSBuild) ${{ parameters.image }} $(MSBuildScript) \
- /root/coresetup/publish/publish.proj \
- /p:PublishType=$(_PublishType) \
- $(PackagePortableBitsArgs) \
- $(CommonMSBuildArgs) \
- $(_CommonPublishArgs) \
- ${{ parameters.outputRidArg }} \
- /bl:msbuild.${{ parameters.distroRid }}.publish.binlog
- displayName: -> Publish ${{ parameters.packageStepDescription }} - ${{ parameters.distroRid }}
- condition: and(succeeded(), eq(variables._BuildConfig, 'Release'))
--- /dev/null
+parameters:
+ name: ''
+
+steps:
+# Upload build outputs as build artifacts only if internal and not PR, to save storage space.
+- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
+ - task: CopyFiles@2
+ displayName: Prepare job-specific Artifacts subdirectory
+ inputs:
+ SourceFolder: '$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)'
+ Contents: '**/*'
+ TargetFolder: '$(Build.StagingDirectory)/Artifacts/${{ parameters.name }}'
+ CleanTargetFolder: true
+ condition: and(succeeded(), eq(variables._BuildConfig, 'Release'))
+
+ - task: PublishBuildArtifacts@1
+ displayName: Publish Artifacts
+ inputs:
+ pathToPublish: '$(Build.StagingDirectory)/Artifacts'
+ artifactName: Artifacts
+ artifactType: container
+ condition: and(succeeded(), eq(variables._BuildConfig, 'Release'))
+
+# Always upload test outputs and build logs.
+- task: PublishTestResults@2
+ displayName: Publish Test Results
+ inputs:
+ testResultsFormat: 'xUnit'
+ testResultsFiles: '*.xml'
+ searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
+ mergeTestResults: true
+ testRunTitle: ${{ parameters.name }}-$(_BuildConfig)
+ continueOnError: true
+ condition: always()
+
+- task: CopyFiles@2
+ displayName: Prepare BuildLogs staging directory
+ inputs:
+ SourceFolder: '$(Build.SourcesDirectory)'
+ Contents: |
+ **/*.log
+ **/*.binlog
+ TargetFolder: '$(Build.StagingDirectory)/BuildLogs'
+ CleanTargetFolder: true
+ continueOnError: true
+ condition: succeededOrFailed()
+
+- task: PublishBuildArtifacts@1
+ displayName: Publish BuildLogs
+ inputs:
+ PathtoPublish: '$(Build.StagingDirectory)/BuildLogs'
+ ArtifactName: Logs-${{ parameters.name }}-$(_BuildConfig)
+ continueOnError: true
+ condition: succeededOrFailed()
targetArchitecture: null
jobs:
- - job: ${{ parameters.displayName }}
- displayName: ${{ parameters.displayName }}
+ - job: ${{ parameters.name }}
+ displayName: ${{ parameters.name }}
pool:
# Use a hosted pool when possible.
${{ if eq(variables['System.TeamProject'], 'public') }}:
matrix:
debug:
_BuildConfig: Debug
- _PublishType: none
release:
_BuildConfig: Release
- _PublishType: blob
workspace:
clean: all
variables:
$(MsbuildSigningArguments)
displayName: Build
- # Publish all build assets
- - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- - script: build.cmd -publishing
- -- '$(CommonMSBuildArgs)
- $(_CommonPublishArgs)
- /p:PublishType=$(_PublishType)
- /p:PublishRidAgnosticPackages=${{ parameters.publishRidAgnosticPackages }}
- /p:BuildFullPlatformManifest=${{ parameters.buildFullPlatformManifest }}
- /bl:$(Build.SourcesDirectory)\publish.binlog'
- displayName: Publish build assets
- condition: and(succeeded(), eq(variables._BuildConfig, 'Release'))
-
- - task: PublishTestResults@2
- displayName: Publish Test Results
- inputs:
- testResultsFormat: 'xUnit'
- testResultsFiles: '*.xml'
- searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
- mergeTestResults: true
- testRunTitle: ${{ parameters.displayName }}-$(_BuildConfig)
- continueOnError: true
- condition: always()
-
- - task: CopyFiles@2
- displayName: Copy Files to $(Build.StagingDirectory)\BuildLogs
- inputs:
- SourceFolder: '$(Build.SourcesDirectory)'
- Contents: |
- **/*.log
- **/*.binlog
- TargetFolder: '$(Build.StagingDirectory)\BuildLogs'
- CleanTargetFolder: true
- continueOnError: true
- condition: succeededOrFailed()
-
- - task: PublishBuildArtifacts@1
- displayName: Publish Artifact BuildLogs
- inputs:
- PathtoPublish: '$(Build.StagingDirectory)\BuildLogs'
- ArtifactName: ${{ parameters.displayName }}-$(_BuildConfig)
- continueOnError: true
- condition: succeededOrFailed()
+ - template: steps/upload-job-artifacts.yml
+ parameters:
+ name: ${{ parameters.name }}
# Skip Running CI tests
- name: SkipTests
value: false
- # Set build as stable to remove build number from package names, used for milestone builds
- - name: IsStable
- value: false
# Set Official Build Id
- name: OfficialBuildId
value: $(Build.BuildNumber)
- # Produce Test build for PR and Public builds
+
+ # Produce test-signed build for PR and Public builds
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- name: SignType
value: test
- # Set variables only for Official build from internal
+
+ # Set up non-PR build from internal project
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- name: SignType
- value: real
- # Variable groups
- - group: DotNet-Blob-Feed
- - group: DotNet-Symbol-Server-Pats
- # Used for publishing individual leg assets to azure blobstorage
- - group: DotNet-DotNetCli-Storage
- # Used for publishing to myget
- - group: DotNet-MyGet-Publish
- # Used for dotnet/versions update
- - group: DotNet-Versions-Publish
-
- # BlobFeed update
- - name: _PublishBlobFeedUrl
- value: https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
- - name: _BlobFeedArgs
- value: /p:PackagesUrl=$(_PublishBlobFeedUrl)
- /p:SymbolPackagesUrl=$(_PublishBlobFeedUrl)
- /p:TransportFeedAccessToken=$(dotnetfeed-storage-access-key-1)
-
- - name: _DotNetVersionsArgs
- value: >-
- /p:GitHubUser=dotnet-build-bot
- /p:GitHubEmail=dotnet-build-bot@microsoft.com
- /p:GitHubAuthToken=$(AccessToken-dotnet-build-bot-public-repo)
- /p:VersionsRepoOwner=dotnet
- /p:VersionsRepo=versions
- /p:VersionsRepoPath=build-info/dotnet/core-setup/$(FullBranchName)
-
- # Symbol Server update
- - name: _SymbolServerArgs
- value: >-
- /p:MicrosoftSymbolServerPat=$(microsoft-symbol-server-pat)
- /p:SymwebSymbolServerPat=$(symweb-symbol-server-pat)
-
- # ******** Official values *****
- - name: _CommonPublishArgs
- value: /p:AzureAccountName=dotnetcli
- /p:ContainerName=dotnet
- /p:AzureAccessToken=$(dotnetcli-storage-key)
- /p:ChecksumAzureAccountName=dotnetclichecksums
- /p:ChecksumContainerName=dotnet
- /p:ChecksumAzureAccessToken=$(dotnetclichecksums-storage-key)
- # Used for publishing to dotnet myget account
- - name: MyGetApiKey
- value: $(dotnet-myget-org-api-key)
- - name: MyGetFeedUrl
- value: https://dotnet.myget.org/F/dotnet-core/api/v2/package
- - name: MyGetSymbolsFeedUrl
- value: https://dotnet.myget.org/F/dotnet-core/symbols/api/v2/package
- - name: _NugetFeedArgs
- value: /p:NuGetFeedUrl=$(MyGetFeedUrl)
- /p:NuGetSymbolsFeedUrl=$(MyGetSymbolsFeedUrl)
- /p:NuGetApiKey=$(MyGetApiKey)
-
-jobs:
- ################################################################################
- # Build Bash legs (Linux and FreeBSD)
- ################################################################################
-- template: /eng/jobs/bash-build.yml
- parameters:
- crossBuild: true
- displayName: Build_Linux_Arm
- dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-14.04-cross-e435274-20180426002420
- additionalRunArgs: -e ROOTFS_DIR=/crossrootfs/arm
- portableBuild: true
- skipTests: true
- targetArchitecture: arm
-
-- template: /eng/jobs/bash-build.yml
- parameters:
- crossBuild: true
- displayName: Build_Linux_Arm64
- dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-a3ae44b-20180316023254
- additionalRunArgs: -e ROOTFS_DIR=/crossrootfs/arm64
- portableBuild: true
- skipTests: true
- targetArchitecture: arm64
-
-# # Tizen build only for PR build
-# - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
-# - template: /eng/jobs/bash-build.yml
-# parameters:
-# additionalMSBuildArgs: /p:OverridePackageSource=https:%2F%2Ftizen.myget.org/F/dotnet-core/api/v3/index.json /p:OutputRid=tizen.5.0.0-armel
-# additionalRunArgs: -e ROOTFS_DIR=/crossrootfs/armel.tizen.build
-# crossBuild: true
-# displayName: Build_Linux_ArmRel_Tizen
-# disableCrossgen: true
-# dockerImage: tizendotnet/dotnet-buildtools-prereqs:ubuntu-16.04-cross-e435274-20180426002255-tizen-rootfs-5.0m1
-# portableBuild: false
-# skipTests: true
-# targetArchitecture: armel
-
-- template: /eng/jobs/bash-build.yml
- parameters:
- additionalMSBuildArgs: /p:OutputRid=linux-musl-arm64
- crossBuild: true
- displayName: Build_Linux_Arm64_Alpine37
- dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine10fcdcf-20190208200917
- additionalRunArgs: -e ROOTFS_DIR=/crossrootfs/arm64
- portableBuild: false
- skipTests: true
- targetArchitecture: arm64
-
-- template: /eng/jobs/bash-build.yml
- parameters:
- additionalMSBuildArgs: /p:OutputRid=linux-musl-x64
- displayName: Build_Linux_x64_Alpine36
- dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.6-3148f11-20171119021156
- portableBuild: false
- targetArchitecture: x64
-
-- template: /eng/jobs/bash-build.yml
- parameters:
- displayName: Build_Linux_x64_glibc
- dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-d485f41-20173404063424
- packageDistroList:
- - image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-14.04-debpkg-e5cf912-20175003025046
- imageRid: ubuntu.14.04
- rids: []
- - image: mcr.microsoft.com/dotnet-buildtools/prereqs:rhel-7-rpmpkg-c982313-20174116044113
- imageRid: rhel.7
- rids:
- - centos.7
- - fedora.27
- - opensuse.42
- - oraclelinux.7
- - sles.12
- portableBuild: true
- targetArchitecture: x64
-
-- template: /eng/jobs/bash-build.yml
- parameters:
- additionalMSBuildArgs: /p:OutputRid=rhel.6-x64
- displayName: Build_Linux_x64_Rhel6
- dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-6-376e1a3-20174311014331
- portableBuild: false
- targetArchitecture: x64
-
- ################################################################################
- # Build Build_OSX leg
- ################################################################################
-- template: /eng/jobs/osx-build.yml
-
- ################################################################################
- # Build Windows legs
- ################################################################################
-
-# Windows Arm
-- template: /eng/jobs/windows-build.yml
- parameters:
- displayName: Build_Windows_Arm
- skipTests: true
- targetArchitecture: arm
-
-# Windows Arm64
-- template: /eng/jobs/windows-build.yml
- parameters:
- displayName: Build_Windows_Arm64
- skipTests: true
- targetArchitecture: arm64
-
-# Windows x64
-- template: /eng/jobs/windows-build.yml
- parameters:
- buildFullPlatformManifest: true
- displayName: Build_Windows_x64
- publishRidAgnosticPackages: true
- targetArchitecture: x64
-
-# Windows x86
-- template: /eng/jobs/windows-build.yml
- parameters:
- buildFullPlatformManifest: true
- displayName: Build_Windows_x86
- targetArchitecture: x86
+ value: $[ coalesce(variables.OfficialSignType, 'real') ]
-- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- ################################################################################
- # Finalize build publish
- # publish nuget packages to blobfeed, symbolserver, and myget
- ################################################################################
- - template: /eng/jobs/finalize-publish.yml
+stages:
+- stage: Build
+ jobs:
+ # -------- Build Bash legs (Linux and FreeBSD) --------
+ - template: /eng/jobs/bash-build.yml
+ parameters:
+ crossBuild: true
+ name: Linux_Arm
+ dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-14.04-cross-e435274-20180426002420
+ additionalRunArgs: -e ROOTFS_DIR=/crossrootfs/arm
+ portableBuild: true
+ skipTests: true
+ targetArchitecture: arm
+
+ - template: /eng/jobs/bash-build.yml
+ parameters:
+ crossBuild: true
+ name: Linux_Arm64
+ dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-a3ae44b-20180316023254
+ additionalRunArgs: -e ROOTFS_DIR=/crossrootfs/arm64
+ portableBuild: true
+ skipTests: true
+ targetArchitecture: arm64
+
+ # # Tizen build only for PR build
+ # - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
+ # - template: /eng/jobs/bash-build.yml
+ # parameters:
+ # additionalMSBuildArgs: /p:OverridePackageSource=https:%2F%2Ftizen.myget.org/F/dotnet-core/api/v3/index.json /p:OutputRid=tizen.5.0.0-armel
+ # additionalRunArgs: -e ROOTFS_DIR=/crossrootfs/armel.tizen.build
+ # crossBuild: true
+ # name: Linux_ArmRel_Tizen
+ # disableCrossgen: true
+ # dockerImage: tizendotnet/dotnet-buildtools-prereqs:ubuntu-16.04-cross-e435274-20180426002255-tizen-rootfs-5.0m1
+ # portableBuild: false
+ # skipTests: true
+ # targetArchitecture: armel
+
+ - template: /eng/jobs/bash-build.yml
+ parameters:
+ additionalMSBuildArgs: /p:OutputRid=linux-musl-arm64
+ crossBuild: true
+ name: Linux_Arm64_Alpine37
+ dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine10fcdcf-20190208200917
+ additionalRunArgs: -e ROOTFS_DIR=/crossrootfs/arm64
+ portableBuild: false
+ skipTests: true
+ targetArchitecture: arm64
+
+ - template: /eng/jobs/bash-build.yml
+ parameters:
+ additionalMSBuildArgs: /p:OutputRid=linux-musl-x64
+ name: Linux_x64_Alpine36
+ dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.6-3148f11-20171119021156
+ portableBuild: false
+ targetArchitecture: x64
+
+ - template: /eng/jobs/bash-build.yml
+ parameters:
+ name: Linux_x64_glibc
+ dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-d485f41-20173404063424
+ packageDistroList:
+ - image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-14.04-debpkg-e5cf912-20175003025046
+ imageRid: ubuntu.14.04
+ rids: []
+ - image: mcr.microsoft.com/dotnet-buildtools/prereqs:rhel-7-rpmpkg-c982313-20174116044113
+ imageRid: rhel.7
+ rids:
+ - centos.7
+ - fedora.27
+ - opensuse.42
+ - oraclelinux.7
+ - sles.12
+ portableBuild: true
+ targetArchitecture: x64
+
+ - template: /eng/jobs/bash-build.yml
parameters:
- DependsOn:
- - Build_Linux_Arm
- - Build_Linux_Arm64
- - Build_Linux_Arm64_Alpine37
- - Build_Linux_x64_Alpine36
- - Build_Linux_x64_glibc
- - Build_Linux_x64_Rhel6
- - Build_OSX
- - Build_Windows_Arm
- - Build_Windows_Arm64
- - Build_Windows_x64
- - Build_Windows_x86
- _PublishType: nopublishtype
-
- ################################################################################
- # Publish to B.A.R
- ################################################################################
- - template: /eng/common/templates/job/publish-build-assets.yml
+ additionalMSBuildArgs: /p:OutputRid=rhel.6-x64
+ name: Linux_x64_Rhel6
+ dockerImage: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-6-376e1a3-20174311014331
+ portableBuild: false
+ targetArchitecture: x64
+
+ # -------- Build OSX (macOS) leg --------
+ - template: /eng/jobs/osx-build.yml
parameters:
- pool:
- name: NetCoreInternal-Int-Pool
- queue: buildpool.windows.10.amd64.vs2017
- dependsOn:
- - Finalize_Publish
+ name: OSX
+
+ # -------- Build Windows legs --------
+ # Windows Arm
+ - template: /eng/jobs/windows-build.yml
+ parameters:
+ name: Windows_Arm
+ skipTests: true
+ targetArchitecture: arm
+
+ # Windows Arm64
+ - template: /eng/jobs/windows-build.yml
+ parameters:
+ name: Windows_Arm64
+ skipTests: true
+ targetArchitecture: arm64
+
+ # Windows x64
+ - template: /eng/jobs/windows-build.yml
+ parameters:
+ buildFullPlatformManifest: true
+ name: Windows_x64
+ publishRidAgnosticPackages: true
+ targetArchitecture: x64
+
+ # Windows x86
+ - template: /eng/jobs/windows-build.yml
+ parameters:
+ buildFullPlatformManifest: true
+ name: Windows_x86
+ targetArchitecture: x86
+
+- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
+ - stage: Publish
+ dependsOn: Build
+ jobs:
+ - template: /eng/jobs/finalize-publish.yml
+ parameters:
+ PublishRidAgnosticPackagesFromJobName: Windows_x64
+
+ # TODO: (arcade) Turn BAR publish back on.
+ # - stage: Publish_BAR
+ # dependsOn: Publish
+ # jobs:
+ # # Publish to Build Asset Registry
+ # - template: /eng/common/templates/job/publish-build-assets.yml
+ # parameters:
+ # pool:
+ # name: NetCoreInternal-Int-Pool
+ # queue: buildpool.windows.10.amd64.vs2017
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
+ <TargetFramework>$(NETCoreAppFramework)</TargetFramework>
+ </PropertyGroup>
+
+ <PropertyGroup>
<BaseUrl Condition="'$(BaseUrl)' == ''">https://dotnetcli.blob.core.windows.net/</BaseUrl>
- <NuGetPushTimeoutSeconds Condition="'$(NuGetPushTimeoutSeconds)' == ''">3600</NuGetPushTimeoutSeconds>
- <ChecksumsRelativePath>Runtime/$(ProductVersion)</ChecksumsRelativePath>
<ChecksumExtension>.sha512</ChecksumExtension>
+ <DownloadDirectory>$(ArtifactsDir)PackageDownload/Artifacts/</DownloadDirectory>
</PropertyGroup>
<ItemGroup>
- <!-- IgnorableErrorMessages applies to the "ExectWithRetriesForNuGetPush" task.
- There's a very special failure scenario that we want to ignore. That scenario is
- when NuGet hits a timeout on one "push" attempt, and then gets a "Forbidden" response
- because the package "already exists" on the next response. This indicates that the
- timeout occurred, but the push was actually successful.
- -->
- <IgnorableErrorMessages Include="Overwriting existing packages is forbidden according to the package retention settings for this feed.">
- <ConditionalErrorMessage>Pushing took too long</ConditionalErrorMessage>
- </IgnorableErrorMessages>
- </ItemGroup>
-
- <ItemGroup>
- <CompressedFile Include="$(AssetOutputPath)**/*$(CompressedFileExtension)">
- <RelativeBlobPath>$(BinariesRelativePath)</RelativeBlobPath>
- </CompressedFile>
-
- <RuntimePackageFile
- Include="
- $(PackageOutputPath)**/runtime.*.nupkg;
- $(PackageOutputPath)**/*.Runtime.*.nupkg;
- $(PackageOutputPath)**/*.App.Host.*.nupkg;
- $(PackageOutputPath)**/VS.Redist.Common.*.nupkg"
- RelativeBlobPath="$(BinariesRelativePath)"/>
-
- <RidAgnosticPackageFile Include="$(PackageOutputPath)**/*.nupkg" Exclude="@(RuntimePackageFile)" >
- <RelativeBlobPath>$(BinariesRelativePath)</RelativeBlobPath>
- </RidAgnosticPackageFile>
- <InstallerFile Include="$(AssetOutputPath)**/*$(InstallerExtension)" Condition="'$(InstallerExtension)' != ''" >
- <RelativeBlobPath>$(InstallersRelativePath)</RelativeBlobPath>
- </InstallerFile>
- <InstallerFile Include="$(AssetOutputPath)**/*$(CombinedInstallerExtension)" Condition="'$(CombinedInstallerExtension)' != ''">
- <RelativeBlobPath>$(InstallersRelativePath)</RelativeBlobPath>
- </InstallerFile>
+ <PackageReference Include="$(MicrosoftDotNetBuildTasksFeedPackage)" Version="$(MicrosoftDotNetBuildTasksFeedPackageVersion)" />
+ <PackageReference Include="$(MicrosoftSymbolUploaderBuildTaskPackage)" Version="$(MicrosoftSymbolUploaderBuildTaskVersion)" />
+ <PackageReference Include="Microsoft.DotNet.VersionTools.Tasks" Version="$(MicrosoftDotNetVersionToolsTasksPackageVersion)" />
</ItemGroup>
- <ItemGroup>
- <PublishRid Include="ubuntu.14.04-x64" />
- <PublishRid Include="linux-x64" />
- <PublishRid Include="win-x86" />
- <PublishRid Include="win-x64" />
- <PublishRid Include="osx-x64" />
- <PublishRid Include="win-arm" />
- <PublishRid Include="win-arm64" />
- <PublishRid Include="linux-arm" />
- <PublishRid Include="linux-musl-arm64" />
- <PublishRid Include="rhel.7-x64" />
- <PublishRid Include="opensuse.42-x64" />
- <PublishRid Include="centos.7-x64" />
- <PublishRid Include="fedora.27-x64" />
- <PublishRid Include="oraclelinux.7-x64" />
- <PublishRid Include="sles.12-x64" />
- </ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <UsingTask TaskName="GenerateDebRepoUploadJsonFile" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll" />
- <UsingTask TaskName="GenerateChecksums" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
- <Target Name="GatherPublishToAzureBinaries">
- <ItemGroup>
- <PublishFile Include="@(CompressedFile)" />
- <PublishFile Include="@(RuntimePackageFile)" />
- <PublishFile Condition="'$(PublishRidAgnosticPackages)' == 'true'" Include="@(RidAgnosticPackageFile)" />
- <Project Include="publish.proj">
- <PublishTarget>UploadToAzure</PublishTarget>
- <AdditionalProperties>%(Project.AdditionalProperties);ItemsToPublish=@(PublishFile);$(OutputVersionBadge);RelativeBlobPath=$(BinariesRelativePath)</AdditionalProperties>
- </Project>
- </ItemGroup>
- </Target>
-
- <Target Name="GatherPublishToAzureInstallers">
- <ItemGroup>
- <Project Include="publish.proj">
- <PublishTarget>UploadToAzure</PublishTarget>
- <AdditionalProperties>%(Project.AdditionalProperties);ItemsToPublish=@(InstallerFile);RelativeBlobPath=$(InstallersRelativePath)</AdditionalProperties>
- </Project>
- </ItemGroup>
- </Target>
-
- <Target Name="GatherPublishToAzureChecksums" DependsOnTargets="CreateChecksums" >
- <ItemGroup>
- <ChecksumItems Include="$(AssetOutputPath)**/*$(ChecksumExtension)" />
- <Project Include="publish.proj">
- <PublishTarget>UploadChecksumsToAzure</PublishTarget>
- <AdditionalProperties>%(Project.AdditionalProperties);ItemsToPublish=@(ChecksumItems);RelativeBlobPath=$(ChecksumsRelativePath)</AdditionalProperties>
- </Project>
- </ItemGroup>
- </Target>
+ <UsingTask TaskName="GenerateDebRepoUploadJsonFile" AssemblyFile="$(LocalBuildToolsTaskFile)" />
- <Target Name="CreateChecksums">
- <ItemGroup>
- <ItemsToChecksum Include="@(CompressedFile)" />
- <ItemsToChecksum Include="@(InstallerFile)" />
- <ArtifactsForGeneratingChecksums Include="@(ItemsToChecksum)">
- <DestinationPath>%(ItemsToChecksum.FullPath)$(ChecksumExtension)</DestinationPath>
- </ArtifactsForGeneratingChecksums>
- </ItemGroup>
- <GenerateChecksums Items="@(ArtifactsForGeneratingChecksums)" />
- </Target>
+ <!-- Required by Common.Targets but not used by publishing projects. -->
+ <Target Name="CreateManifestResourceNames" />
+ <Target Name="CoreCompile" />
<Target Name="GenerateDebRepoFiles"
Condition="('$(TargetsUbuntu)' == 'true' or '$(TargetsDebian)' == 'true') and '$(TargetArchitecture)' == 'x64'">
UploadUrl="$(BaseUrl)$(ContainerName)/$(BinariesRelativePath)%(DebInstallerFile.Filename)%(DebInstallerFile.Extension)" />
</Target>
- <Target Name="CheckIfAllBuildsHavePublished">
- <ListAzureBlobs AccountName="$(AzureAccountName)"
- AccountKey="$(AzureAccessToken)"
- ContainerName="$(ContainerName)"
- FilterBlobNames="$(BinariesRelativePath)">
- <Output TaskParameter="BlobNames" ItemName="_BlobNames" />
- </ListAzureBlobs>
- <ItemGroup>
- <_FoundBlobNames Include="%(_BlobNames.FileName)%(_BlobNames.Extension)" Condition="'%(_BlobNames.Extension)' == '.svg'" />
- <_MissingBlobNames Include="@(PublishRid->'sharedfx_%(Identity)_$(ConfigurationGroup)_version_badge.svg')"
- Exclude="@(_FoundBlobNames)" />
- </ItemGroup>
- <Error Text="Missing publish output from all legs of the build. Missing blobs are '@(_MissingBlobNames)'"
- Condition="'@(_MissingBlobNames)' != ''" />
- </Target>
-
<Import Project="..\Directory.Build.targets" />
</Project>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
- <UsingTask TaskName="DownloadFromAzure" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.CloudTestTasks.dll" />
-
- <Import Project="$(PackagesDir)/$(FeedTasksPackage.ToLower())/$(FeedTasksPackageVersion)/build/$(FeedTasksPackage).targets" />
-
- <PropertyGroup>
- <BuildDependsOn>
- ValidateProperties;
- DownloadFilesFromContainer;
- SignPackages
- </BuildDependsOn>
-
- <BuildDependsOn Condition="$(PublishType.Contains('blob'))">
- $(BuildDependsOn);
- ValidateBlobFeedProperties;
- PublishPackagesToBlobFeed;
- PublishFilesToBlobFeed;
- </BuildDependsOn>
-
- <BuildDependsOn Condition="$(PublishType.Contains('versions'))">
- $(BuildDependsOn);
- UpdateVersionsRepo
- </BuildDependsOn>
- </PropertyGroup>
-
- <Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />
-
- <Target Name="ValidateProperties">
- <Error Condition="'$(AzureAccessToken)' == ''" Text="Missing required property 'AzureAccessToken'" />
- <Error Condition="'$(AzureAccountName)' == ''" Text="Missing required property 'AzureAccountName'" />
- <Error Condition="'$(ContainerName)' == ''" Text="Missing required property 'ContainerName'" />
- <Message Condition="'$(WindowsSdkDir)' == ''" Text="Windows SDK not found. Symbols packages will not be signed." />
- </Target>
-
- <Target Name="ValidateBlobFeedProperties">
- <Error Condition="'$(PublishBlobFeedUrl)' == ''" Text="Missing required property 'PublishBlobFeedUrl'" />
- <Error Condition="'$(PublishBlobFeedKey)' == ''" Text="Missing required property 'PublishBlobFeedKey'" />
-
- <PropertyGroup>
- <!-- map the properties to the values expected by the Feeds.targets file -->
- <ExpectedFeedUrl>$(PublishBlobFeedUrl)</ExpectedFeedUrl>
- <AccountKey>$(PublishBlobFeedKey)</AccountKey>
- </PropertyGroup>
- </Target>
-
- <Target Name="DownloadFilesFromContainer">
- <!-- TODO: We should also think about pulling down the checksums or recomputing them -->
- <PropertyGroup>
- <DownloadDirectory Condition="'$(DownloadDirectory)' == ''">$(BinDir)PackageDownload/</DownloadDirectory>
- <!-- The SignFiles target needs OutDir to be defined -->
- <OutDir>$(DownloadDirectory)</OutDir>
- </PropertyGroup>
-
- <MakeDir Directories="$(DownloadDirectory)" Condition="!Exists('$(DownloadDirectory)')" />
-
- <Message Text="Downloading files from $(AzureAccountName)/$(ContainerName)/$(BinariesRelativePath) into $(DownloadDirectory)" />
-
- <DownloadFromAzure AccountName="$(AzureAccountName)"
- AccountKey="$(AzureAccessToken)"
- ContainerName="$(ContainerName)"
- BlobNamePrefix="$(BinariesRelativePath)"
- DownloadDirectory="$(DownloadDirectory)" />
-
- <ItemGroup>
- <!-- ShippedNugetPackage item is used for updating versions repo -->
- <ShippedNuGetPackage Include="$(DownloadDirectory)**\*.nupkg" Exclude="$(DownloadDirectory)**\*.symbols.nupkg" />
-
- <!-- Setup item groups for PublishPackagesToBlobFeed and PublishFilesToBlobFeed -->
- <PackagesToPublish Include="$(DownloadDirectory)**\*.nupkg" />
- <FilesToPublish Include="$(DownloadDirectory)**\*.*" Exclude="@(PackagesToPublish)" />
-
- <!-- Make the local relative path match what dotnet-install scripts expect -->
- <FilesToPublish>
- <RelativeBlobPath>assets/$(BinariesRelativePath)$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
- <ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData>
- </FilesToPublish>
- </ItemGroup>
- </Target>
-
- <Target Name="GetPackagesToSign" DependsOnTargets="DownloadFilesFromContainer">
- <ItemGroup>
- <FilesToSign Include="@(ShippedNugetPackage)">
- <Authenticode>NuGet</Authenticode>
- </FilesToSign>
- </ItemGroup>
- <Message Importance="High" Text="Attempting to sign package '%(FilesToSign.Identity)'" />
- </Target>
-
- <Target Name="SignPackages"
- Condition="'$(SkipSigning)' != 'true' and '$(SignType)' != 'public'"
- DependsOnTargets="GetPackagesToSign;SignFiles">
- </Target>
-
- <!--
- Target wrapping UpdatePublishedVersions: ensures that ShippedNuGetPackage items are created and
- disables versions repo update if no auth token is defined. Otherwise, not specifying an auth
- token would cause an error.
- -->
- <Target Name="UpdateVersionsRepo"
- Condition="'$(GitHubAuthToken)' != ''"
- DependsOnTargets="UpdatePublishedVersions" />
-
- <Import Project="$(ToolsDir)VersionTools.targets" Condition="Exists('$(ToolsDir)VersionTools.targets')" />
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
-</Project>
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
- <UsingTask TaskName="DownloadFromAzure" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.CloudTestTasks.dll" />
- <UsingTask TaskName="ExecWithRetriesForNuGetPush" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
- <UsingTask TaskName="FinalizeBuild" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll" />
- <UsingTask TaskName="ListAzureBlobs" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.CloudTestTasks.dll" />
- <UsingTask TaskName="UploadToAzure" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.CloudTestTasks.dll" />
-
- <Import Project="$(PackagesDir)/$(FeedTasksPackage.ToLower())/$(FeedTasksPackageVersion)/build/$(FeedTasksPackage).targets" />
- <Import Project="$(PackagesDir)/$(PublishSymbolsPackage.ToLower())/$(PublishSymbolsPackageVersion)/build/PublishSymbols.targets" />
-
- <PropertyGroup>
- <!-- Always push the build assets to azure for final publish -->
- <BuildDependsOn Condition="'$(PublishType)' == 'blob'">
- PublishToAzure;
- </BuildDependsOn>
-
- <!--
- If we are not setting a publish type (i.e. nopublishtype) then do
- the old style publishing otherwise ignore these steps because we are
- running an orchestrated publish.
- -->
- <BuildDependsOn Condition="$(PublishType.Contains('nopublishtype'))">
- $(BuildDependsOn);
- PublishDebFilesToDebianRepo;
- PublishFinalOutput;
- </BuildDependsOn>
- </PropertyGroup>
-
- <Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />
+<Project>
+ <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
+
+ <UsingTask TaskName="DownloadFromAzure" AssemblyFile="$(LocalBuildToolsTaskFile)" />
+ <UsingTask TaskName="FinalizeBuild" AssemblyFile="$(LocalBuildToolsTaskFile)" />
+ <UsingTask TaskName="GenerateChecksums" AssemblyFile="$(LocalBuildToolsTaskFile)" />
+ <UsingTask TaskName="ListAzureBlobs" AssemblyFile="$(LocalBuildToolsTaskFile)" />
+ <UsingTask TaskName="UploadToAzure" AssemblyFile="$(LocalBuildToolsTaskFile)" />
+
+ <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
+
+ <Target Name="Build"
+ DependsOnTargets="
+ PublishDebFilesToDebianRepo;
+ PublishFinalOutput;
+ UpdateVersionsRepo" />
<Target Name="PublishFinalOutput"
- Condition="'$(Finalize)' == 'true'"
- DependsOnTargets="PublishCoreHostPackages;RunPublishSymbols;FinalizeBuildInAzure" />
-
- <Target Name="GetPackagesToSign" DependsOnTargets="GatherShippingPackages">
- <ItemGroup>
- <FilesToSign Include="@(ShippedNugetPackage)">
- <Authenticode>NuGet</Authenticode>
- </FilesToSign>
- </ItemGroup>
- <Message Importance="High" Text="Attempting to sign package '%(FilesToSign.Identity)'" />
- </Target>
-
+ DependsOnTargets="
+ SignPackages;
+ PublishNuGetPackages;
+ PublishToAzure;
+ RunPublishSymbols;
+ FinalizeBuildInAzure" />
+
<Target Name="SignPackages"
- Condition="'$(SkipSigning)' != 'true' and '$(SignType)' != 'public'"
- DependsOnTargets="GetPackagesToSign;SignFiles">
+ Condition="'$(SkipSigning)' != 'true' and '$(SignType)' != 'public'">
+ <MSBuild
+ Projects="$(RepoRoot)signing\SignFinalPackages.proj"
+ Targets="Build"
+ Properties="DownloadDirectory=$(DownloadDirectory)" />
</Target>
<!--
-->
<Target Name="UpdateVersionsRepo"
Condition="'$(GitHubAuthToken)' != ''"
- DependsOnTargets="GatherShippingPackages;
+ DependsOnTargets="FindDownloadedArtifacts;
UpdatePublishedVersions" />
- <Target Name="GatherShippingPackages">
+ <!--
+ Look through the downloaded artifacts to figure out how to ship them. Creates item groups for
+ other types of publishing to use.
+ -->
+ <Target Name="FindDownloadedArtifacts">
<ItemGroup>
- <PackagesToShip Include="$(DownloadDirectory)*.nupkg"
- Exclude="$(DownloadDirectory)*.symbols.nupkg;
- $(DownloadDirectory)VS.Redist.Common.*.nupkg" />
- <PackagesToShip Remove="%(PackagesToShip.Identity)"
- Condition="$([System.String]::Copy('%(PackagesToShip.Identity)').Contains('latest'))" />
- <ShippedNuGetPackage Include="@(PackagesToShip)" />
+ <DownloadedArtifactFile Include="$(DownloadDirectory)**" />
+
+ <DownloadedSymbolNupkgFile Include="$(DownloadDirectory)**\*.symbols.nupkg" />
+ <DownloadedNupkgFile
+ Include="$(DownloadDirectory)**\*.nupkg"
+ Exclude="@(DownloadedSymbolNupkgFile)" />
+
+ <!-- RID-specific nupkg. These are published from every job. -->
+ <RuntimeNupkgFile
+ Include="
+ $(DownloadDirectory)**\runtime.*.nupkg;
+ $(DownloadDirectory)**\*.Runtime.*.nupkg;
+ $(DownloadDirectory)**\*.App.Host.*.nupkg;
+ $(DownloadDirectory)**\VS.Redist.Common.*.nupkg"
+ Exclude="@(DownloadedSymbolNupkgFile)" />
+
+ <!--
+ RID-agnostic nupkg. These are built with the same ID/version by every job, so only one job's
+ results are published.
+ -->
+ <RidAgnosticNupkgToPublishFile
+ Include="$(DownloadDirectory)$(PublishRidAgnosticPackagesFromJobName)\**\*.nupkg"
+ Exclude="@(RuntimeNupkgFile);@(DownloadedSymbolNupkgFile)" />
+
+ <RidAgnosticNupkgToIgnoreFile
+ Include="@(DownloadedNupkgFile)"
+ Exclude="@(RidAgnosticNupkgToPublishFile);@(RuntimeNupkgFile)" />
+
+ <RidAgnosticSymbolNupkgToIgnoreFile
+ Include="@(RidAgnosticNupkgToIgnoreFile -> '%(RootDir)%(Directory)%(Filename).symbols.nupkg')" />
+
+ <NupkgToPublishFile Include="@(RuntimeNupkgFile);@(RidAgnosticNupkgToPublishFile)" />
+ <SymbolNupkgToPublishFile Include="@(DownloadedSymbolNupkgFile)" Exclude="@(RidAgnosticSymbolNupkgToIgnoreFile)" />
+
+ <!-- Filter out duplicate nupkgs/symbols.nupkgs, but other artifacts are fine. -->
+ <UploadToBlobStorageFile
+ Include="@(DownloadedArtifactFile)"
+ Exclude="@(RidAgnosticNupkgToIgnoreFile);@(RidAgnosticSymbolNupkgToIgnoreFile)" />
+
+ <!-- Nupkgs to include in dotnet/versions update. -->
+ <ShippedNuGetPackage Include="@(NupkgToPublishFile)" />
</ItemGroup>
</Target>
- <Target Name="PublishToAzure"
- Condition="'$(Finalize)' != 'true'"
- DependsOnTargets="GatherPublishToAzureBinaries;GatherPublishToAzureInstallers;GatherPublishToAzureChecksums">
- <MSBuild Targets="%(Project.PublishTarget)"
- Projects="%(Project.Identity)"
- Properties="%(Project.AdditionalProperties)"
- BuildInParallel="true" />
- </Target>
-
- <Target Name="EnsureUniqueItemsToUpload">
+ <Target Name="CreateChecksums"
+ DependsOnTargets="FindDownloadedArtifacts">
<ItemGroup>
- <DedupItems Include="@(ItemsToPublish->Distinct())" />
+ <ArtifactsForGeneratingChecksums
+ Include="@(UploadToBlobStorageFile)"
+ DestinationPath="%(FullPath)$(ChecksumExtension)" />
+
+ <GeneratedChecksumFile Include="@(ArtifactsForGeneratingChecksums -> '%(DestinationPath)')" />
</ItemGroup>
- <PropertyGroup>
- <CountOld>@(ItemsToPublish->Count())</CountOld>
- <CountNew>@(DedupItems->Count())</CountNew>
- <_HasDups Condition="'$(CountOld)' != '$(CountNew)'">true</_HasDups>
- </PropertyGroup>
- <Message Importance="High" Condition="'$(_HasDups)' != ''" Text="ItemsToPublish: '@(ItemsToPublish)'"/>
- <Error Condition="'$(_HasDups)' != ''" Text="Duplicate Items Present in ItemsToPublish" />
+
+ <GenerateChecksums Items="@(ArtifactsForGeneratingChecksums)" />
</Target>
+ <!-- Publish to Azure blob storage. -->
+ <Target Name="PublishToAzure"
+ DependsOnTargets="
+ UploadToAzure;
+ UploadChecksumsToAzure" />
+
<Target Name="UploadToAzure"
- DependsOnTargets="EnsureUniqueItemsToUpload"
- Condition="'$(ItemsToPublish)' != ''">
+ DependsOnTargets="
+ FindDownloadedArtifacts;
+ SignPackages;
+ GetProductVersions">
<Error Condition="'$(AzureAccessToken)' == ''" Text="Missing required property 'AzureAccessToken'" />
<Error Condition="'$(AzureAccountName)' == ''" Text="Missing required property 'AzureAccountName'" />
<Error Condition="'$(ContainerName)' == ''" Text="Missing required property 'ContainerName'" />
- <Error Condition="'$(RelativeBlobPath)' == ''" Text="Missing required property 'RelativeBlobPath'" />
- <Error Condition="!HasTrailingSlash('$(RelativeBlobPath)')" Text="RelativeBlobPath is expected to have a trailing '/' - '$(RelativeBlobPath)'" />
<ItemGroup>
- <ItemsToPublish Include="$(ItemsToPublish)" />
- <ItemsToPublish>
- <RelativeBlobPath>$(RelativeBlobPath)%(Filename)%(Extension)</RelativeBlobPath>
- </ItemsToPublish>
+ <FileToPublish
+ Include="@(UploadToBlobStorageFile)"
+ RelativeBlobPath="$(BinariesRelativePath)%(Filename)%(Extension)" />
</ItemGroup>
- <Message Text="Uploading files to $(AzureAccountName)/$(ContainerName)/$(RelativeBlobPath)" />
+ <Message Text="Uploading files to $(AzureAccountName)/$(ContainerName)/$(BinariesRelativePath)" />
<UploadToAzure AccountName="$(AzureAccountName)"
AccountKey="$(AzureAccessToken)"
ContainerName="$(ContainerName)"
- Items="@(ItemsToPublish)"
+ Items="@(FileToPublish)"
Overwrite="false" />
</Target>
<Target Name="UploadChecksumsToAzure"
- Condition="'$(ItemsToPublish)' != ''">
+ DependsOnTargets="
+ FindDownloadedArtifacts;
+ GetProductVersions;
+ CreateChecksums">
<Error Condition="'$(ChecksumAzureAccessToken)' == ''" Text="Missing required property 'ChecksumAzureAccessToken'" />
<Error Condition="'$(ChecksumAzureAccountName)' == ''" Text="Missing required property 'ChecksumAzureAccountName'" />
<Error Condition="'$(ChecksumContainerName)' == ''" Text="Missing required property 'ChecksumContainerName'" />
- <Error Condition="'$(RelativeBlobPath)' == ''" Text="Missing required property 'RelativeBlobPath'" />
<ItemGroup>
- <ItemsToPublish Include="$(ItemsToPublish)" />
- <ItemsToPublish>
- <RelativeBlobPath>$(RelativeBlobPath)/%(Filename)%(Extension)</RelativeBlobPath>
- </ItemsToPublish>
+ <ChecksumToPublish
+ Include="@(GeneratedChecksumFile)"
+ RelativeBlobPath="$(BinariesRelativePath)%(Filename)%(Extension)" />
</ItemGroup>
- <Message Text="Uploading checksum files to $(ChecksumAzureAccountName)/$(ChecksumContainerName)/$(RelativeBlobPath)" />
+ <Message Text="Uploading checksum files to $(ChecksumAzureAccountName)/$(ChecksumContainerName)/$(BinariesRelativePath)" />
<UploadToAzure AccountName="$(ChecksumAzureAccountName)"
AccountKey="$(ChecksumAzureAccessToken)"
ContainerName="$(ChecksumContainerName)"
- Items="@(ItemsToPublish)"
+ Items="@(ChecksumToPublish)"
Overwrite="false" />
</Target>
</Target>
<Target Name="FinalizeBuildInAzure"
- DependsOnTargets="CheckIfAllBuildsHavePublished;
- GetLatestCommitHash">
+ DependsOnTargets="
+ GetProductVersions;
+ GetLatestCommitHash">
<Error Condition="'$(AzureAccessToken)' == ''" Text="Missing required property 'AzureAccessToken'" />
<Error Condition="'$(AzureAccountName)' == ''" Text="Missing required property 'AzureAccountName'" />
<Error Condition="'$(ContainerName)' == ''" Text="Missing required property 'ContainerName'" />
<Error Condition="'$(LatestCommit)' == ''" Text="Missing required property 'LatestCommit'" />
- <Error Condition="'@(PublishRid)' == ''" Text="Missing required item 'PublishRid'" />
<Message Importance="High" Text="Finalizing Build" />
<!-- Ensure all publish pieces are present and then publish to Azure Latest container -->
ForcePublish="true" />
</Target>
- <Target Name="PublishCoreHostPackages"
- DependsOnTargets="CheckIfAllBuildsHavePublished;DownloadCoreHostPackages;SignPackages;DoPushCoreHostPackagesToAzure"
- Condition="'@(_MissingBlobNames)' == '' AND '$(NuGetFeedUrl)' != ''">
- <Error Condition="'$(NuGetFeedUrl)' ==''" Text="Missing required property NuGetFeedUrl" />
- <Error Condition="'$(NuGetApiKey)' == ''" Text="Missing required property NuGetApiKey" />
+ <Target Name="PublishNuGetPackages"
+ DependsOnTargets="
+ FindDownloadedArtifacts;
+ SignPackages;
+ DoPushNuGetPackagesToAzure"
+ Condition="'@(_MissingBlobNames)' == ''">
<Error Condition="'$(AzureAccessToken)' == ''" Text="Missing required property 'AzureAccessToken'" />
<Error Condition="'$(AzureAccountName)' == ''" Text="Missing required property 'AzureAccountName'" />
<Error Condition="'$(ContainerName)' == ''" Text="Missing required property 'ContainerName'" />
<Message Condition="'$(WindowsSdkDir)' == ''" Text="Windows SDK not found. Symbols packages will not be signed." />
</Target>
- <Target Name="DownloadCoreHostPackages">
- <ListAzureBlobs AccountName="$(AzureAccountName)"
- AccountKey="$(AzureAccessToken)"
- ContainerName="$(ContainerName)"
- FilterBlobNames="Runtime/$(SharedFrameworkNugetVersion)/">
- <Output TaskParameter="BlobNames" ItemName="_BlobList" />
- </ListAzureBlobs>
- <ItemGroup>
- <_CoreHostPackages Include="%(_BlobList.Identity)" />
- </ItemGroup>
- <PropertyGroup>
- <DownloadDirectory Condition="'$(DownloadDirectory)' == ''">$(BinDir)PackageDownload/</DownloadDirectory>
- <!-- The SignFiles target needs OutDir to be defined -->
- <OutDir>$(DownloadDirectory)</OutDir>
- </PropertyGroup>
- <MakeDir Directories="$(DownloadDirectory)"
- Condition="!Exists('$(DownloadDirectory)')" />
- <DownloadFromAzure AccountName="$(AzureAccountName)"
- AccountKey="$(AzureAccessToken)"
- ContainerName="$(ContainerName)"
- BlobNames="@(_CoreHostPackages)"
- BlobNamePrefix="Runtime/$(SharedFrameworkNugetVersion)/"
- DownloadDirectory="$(DownloadDirectory)" />
- <ItemGroup>
- <_DownloadedAssets Include="@(_CoreHostPackages->'$(DownloadDirectory)%(Filename)%(Extension)')" />
- <_DownloadedPackages Include="%(_DownloadedAssets.Identity)"
- Condition="$([System.String]::new('%(_DownloadedAssets.Identity)').EndsWith('.nupkg'))" />
- <_DownloadedSymbolsPackages Include="%(_DownloadedPackages.Identity)"
- Condition="$([System.String]::new('%(_DownloadedPackages.Identity)').EndsWith('.symbols.nupkg'))" />
- <_DownloadedStandardPackages Include="@(_DownloadedPackages)"
- Exclude="@(_DownloadedSymbolsPackages)"
- Condition="$([System.String]::new('%(_DownloadedPackages.Identity)').EndsWith('.nupkg'))" />
-
- <!-- Exclude SVG files from BAR manifest: https://github.com/dotnet/arcade/issues/1842. -->
- <_DownloadedAssets Condition="$([System.String]::new('%(_DownloadedAssets.Identity)').EndsWith('.svg'))">
- <ExcludeFromManifest>true</ExcludeFromManifest>
- </_DownloadedAssets>
- </ItemGroup>
- </Target>
-
- <Target Name="RunPublishSymbols">
+ <Target Name="RunPublishSymbols"
+ Condition="'$(SkipPublishSymbols)' != 'true'">
<ItemGroup>
<SymbolServerConfig
Include="msdl"
Properties="DownloadDirectory=$(DownloadDirectory)" />
</Target>
- <Target Name="SetupPublishSymbols">
+ <Target Name="SetupPublishSymbols"
+ DependsOnTargets="FindDownloadedArtifacts">
<PropertyGroup>
<SymbolExpirationInDays>180</SymbolExpirationInDays>
</PropertyGroup>
<ItemGroup>
<SymbolPackagesToPublish
- Include="$(DownloadDirectory)**\*.symbols.nupkg"
- Exclude="$(DownloadDirectory)**\*freebsd*.nupkg" />
+ Include="@(DownloadedSymbolNupkgFile)"
+ Exclude="@(RidAgnosticSymbolNupkgToIgnoreFile)" />
</ItemGroup>
<Message Importance="High" Text="Publishing symbol packages to '$(SymbolServerPath)': @(SymbolPackagesToPublish)"/>
</Target>
- <Target Name="DoPushCoreHostPackagesToFeed">
- <Error Condition="'@(_DownloadedSymbolsPackages)' != '' and '$(NuGetSymbolsFeedUrl)' == ''" Text="Missing required property NuGetSymbolsFeedUrl" />
+ <Target Name="DoPushNuGetPackagesToAzure"
+ DependsOnTargets="
+ PublishToAzureBlobFeed;
+ PublishFilesToAzureBlobFeed" />
- <Message Text="Pushing CoreHost packages to $(NuGetFeedUrl)" />
+ <Target Name="PublishToAzureBlobFeed">
+ <Error Condition="'$(PackagesUrl)'==''" Text="Missing property PackagesUrl" />
+ <Error Condition="'$(TransportFeedAccessToken)'==''" Text="Missing property TransportFeedAccessToken" />
<PropertyGroup>
- <NuGetPushCommand>$(DotnetToolCommand) nuget push --source $(NuGetFeedUrl) --api-key $(NuGetApiKey) --timeout $(NuGetPushTimeoutSeconds)</NuGetPushCommand>
- <NuGetPushSymbolsCommand>$(DotnetToolCommand) nuget push --source $(NuGetSymbolsFeedUrl) --api-key $(NuGetApiKey) --timeout $(NuGetPushTimeoutSeconds)</NuGetPushSymbolsCommand>
+ <ExpectedFeedUrl>$(PackagesUrl)</ExpectedFeedUrl>
+ <AssetManifestFilePath>$(BUILD_SOURCESDIRECTORY)/artifacts/log/AssetManifest/Manifest.xml</AssetManifestFilePath>
</PropertyGroup>
- <ExecWithRetriesForNuGetPush Command="$(NuGetPushCommand) %(_DownloadedStandardPackages.Identity)"
- IgnoredErrorMessagesWithConditional="@(IgnorableErrorMessages)" />
+ <ItemGroup>
+ <ItemsToPush Remove="@(ItemsToPush)" />
+ <ItemsToPush Include="@(NupkgToPublishFile)" />
+ <ItemsToPush Include="@(SymbolNupkgToPublishFile)" />
+ </ItemGroup>
- <Message Condition="'@(_DownloadedSymbolsPackages)' != ''" Text="Pushing CoreHost symbols packages to $(NuGetSymbolsFeedUrl)" />
- <ExecWithRetriesForNuGetPush Condition="'@(_DownloadedSymbolsPackages)' != ''"
- Command="$(NuGetPushSymbolsCommand) %(_DownloadedSymbolsPackages.Identity)"
- IgnoredErrorMessagesWithConditional="@(IgnorableErrorMessages)" />
+ <PushToBlobFeed ExpectedFeedUrl="$(ExpectedFeedUrl)"
+ AccountKey="$(TransportFeedAccessToken)"
+ ItemsToPush="@(ItemsToPush)"
+ Overwrite="$(OverwriteOnPublish)"
+ ManifestBuildData="Location=$(ExpectedFeedUrl)"
+ ManifestRepoUri="$(BUILD_REPOSITORY_URI)"
+ ManifestBranch="$(BUILD_SOURCEBRANCH)"
+ ManifestBuildId="$(BUILD_BUILDNUMBER)"
+ ManifestCommit="$(BUILD_SOURCEVERSION)"
+ AssetManifestPath="$(AssetManifestFilePath)"
+ />
</Target>
- <Target Name="DoPushCoreHostPackagesToAzure"
- DependsOnTargets="PublishToAzureBlobFeed;PublishFilesToAzureBlobFeed"
- Condition="'$(OfficialPublish)' == 'true'"/>
-
- <Target Name="PublishToAzureBlobFeed">
+ <Target Name="PublishFilesToAzureBlobFeed"
+ DependsOnTargets="
+ CreateChecksums;
+ GetProductVersions">
<Error Condition="'$(PackagesUrl)'==''" Text="Missing property PackagesUrl" />
<Error Condition="'$(TransportFeedAccessToken)'==''" Text="Missing property TransportFeedAccessToken" />
<PropertyGroup>
<ExpectedFeedUrl>$(PackagesUrl)</ExpectedFeedUrl>
- <AssetManifestFilePath>$(BUILD_SOURCESDIRECTORY)/artifacts/log/AssetManifest/Manifest.xml</AssetManifestFilePath>
+ <AssetManifestFilePath>$(BUILD_SOURCESDIRECTORY)/artifacts/log/AssetManifest/Manifest_Installers.xml</AssetManifestFilePath>
</PropertyGroup>
+
<ItemGroup>
<ItemsToPush Remove="@(ItemsToPush)" />
- <ItemsToPush Include="@(_DownloadedStandardPackages)"/>
- <ItemsToPush Include="@(_DownloadedSymbolsPackages)"/>
+ <ItemsToPush
+ Include="@(UploadToBlobStorageFile)"
+ Exclude="@(NupkgToPublishFile);@(SymbolNupkgToPublishFile)" />
+ <ItemsToPush>
+ <RelativeBlobPath>assets/core-setup/$(InstallersRelativePath)%(Filename)%(Extension)</RelativeBlobPath>
+ </ItemsToPush>
</ItemGroup>
+
<PushToBlobFeed ExpectedFeedUrl="$(ExpectedFeedUrl)"
AccountKey="$(TransportFeedAccessToken)"
ItemsToPush="@(ItemsToPush)"
+ PublishFlatContainer="true"
Overwrite="$(OverwriteOnPublish)"
ManifestBuildData="Location=$(ExpectedFeedUrl)"
ManifestRepoUri="$(BUILD_REPOSITORY_URI)"
AssetManifestPath="$(AssetManifestFilePath)"
/>
</Target>
-
- <Target Name="PublishFilesToAzureBlobFeed">
- <Error Condition="'$(PackagesUrl)'==''" Text="Missing property PackagesUrl" />
- <Error Condition="'$(TransportFeedAccessToken)'==''" Text="Missing property TransportFeedAccessToken" />
- <PropertyGroup>
- <ExpectedFeedUrl>$(PackagesUrl)</ExpectedFeedUrl>
- <AssetManifestFilePath>$(BUILD_SOURCESDIRECTORY)/artifacts/log/AssetManifest/Manifest_Installers.xml</AssetManifestFilePath>
- </PropertyGroup>
- <ItemGroup>
- <ItemsToPush Remove="@(ItemsToPush)" />
- <ItemsToPush Include="@(_DownloadedAssets)"
- Exclude="@(_DownloadedPackages)" />
- <ItemsToPush>
- <RelativeBlobPath>assets/core-setup/$(InstallersRelativePath)%(Filename)%(Extension)</RelativeBlobPath>
- </ItemsToPush>
- </ItemGroup>
- <PushToBlobFeed ExpectedFeedUrl="$(ExpectedFeedUrl)"
- AccountKey="$(TransportFeedAccessToken)"
- ItemsToPush="@(ItemsToPush)"
- PublishFlatContainer="true"
- Overwrite="$(OverwriteOnPublish)"
- ManifestBuildData="Location=$(ExpectedFeedUrl)"
- ManifestRepoUri="$(BUILD_REPOSITORY_URI)"
- ManifestBranch="$(BUILD_SOURCEBRANCH)"
- ManifestBuildId="$(BUILD_BUILDNUMBER)"
- ManifestCommit="$(BUILD_SOURCEVERSION)"
- AssetManifestPath="$(AssetManifestFilePath)"
- />
-</Target>
-
- <Import Project="$(ToolsDir)VersionTools.targets" Condition="Exists('$(ToolsDir)VersionTools.targets')" />
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
+
</Project>