Merge pull request #25424 from dotnet/darc-master-e048b5ab-4671-4e74-8671-932e8299b22b
authorWilliam Godbe <wigodbe@microsoft.com>
Thu, 27 Jun 2019 20:23:32 +0000 (13:23 -0700)
committerGitHub <noreply@github.com>
Thu, 27 Jun 2019 20:23:32 +0000 (13:23 -0700)
[master] Update dependencies from dotnet/arcade

17 files changed:
eng/Version.Details.xml
eng/Versions.props
eng/common/post-build/promote-build.ps1 [new file with mode: 0644]
eng/common/sdl/extract-artifact-packages.ps1 [new file with mode: 0644]
eng/common/templates/job/execute-sdl.yml
eng/common/templates/job/publish-build-assets.yml
eng/common/templates/post-build/channels/internal-servicing.yml [new file with mode: 0644]
eng/common/templates/post-build/channels/public-dev-release.yml
eng/common/templates/post-build/channels/public-release.yml [new file with mode: 0644]
eng/common/templates/post-build/channels/public-validation-release.yml
eng/common/templates/post-build/common-variables.yml
eng/common/templates/post-build/post-build.yml
eng/common/templates/post-build/promote-build.yml
eng/common/templates/post-build/setup-maestro-vars.yml
global.json
src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs
src/System.Private.CoreLib/shared/System/Threading/Tasks/FutureFactory.cs

index ad2ce5a..140cbd2 100644 (file)
@@ -3,21 +3,21 @@
   <ProductDependencies>
   </ProductDependencies>
   <ToolsetDependencies>
-    <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19324.24">
+    <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19326.44">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>062febd818fa51e82c7192782a6b6e6429cc81c8</Sha>
+      <Sha>d39a62deaf3aa4e03c0b7dadc320a517e0e00187</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.19324.24">
+    <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="2.0.0-beta.19326.44">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>062febd818fa51e82c7192782a6b6e6429cc81c8</Sha>
+      <Sha>d39a62deaf3aa4e03c0b7dadc320a517e0e00187</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="2.2.0-beta.19324.24">
+    <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="2.2.0-beta.19326.44">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>062febd818fa51e82c7192782a6b6e6429cc81c8</Sha>
+      <Sha>d39a62deaf3aa4e03c0b7dadc320a517e0e00187</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="1.0.0-beta.19324.24">
+    <Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="1.0.0-beta.19326.44">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>062febd818fa51e82c7192782a6b6e6429cc81c8</Sha>
+      <Sha>d39a62deaf3aa4e03c0b7dadc320a517e0e00187</Sha>
     </Dependency>
     <Dependency Name="Microsoft.Private.CoreFx.NETCoreApp" Version="4.6.0-preview8.19326.15">
       <Uri>https://github.com/dotnet/corefx</Uri>
index 7243280..a921162 100644 (file)
@@ -14,8 +14,8 @@
     <UsingToolXliff>false</UsingToolXliff>
     <!-- Package versions -->
     <!-- arcade -->
-    <MicrosoftDotNetBuildTasksFeedVersion>2.2.0-beta.19324.24</MicrosoftDotNetBuildTasksFeedVersion>
-    <MicrosoftDotNetBuildTasksPackagingVersion>1.0.0-beta.19324.24</MicrosoftDotNetBuildTasksPackagingVersion>
+    <MicrosoftDotNetBuildTasksFeedVersion>2.2.0-beta.19326.44</MicrosoftDotNetBuildTasksFeedVersion>
+    <MicrosoftDotNetBuildTasksPackagingVersion>1.0.0-beta.19326.44</MicrosoftDotNetBuildTasksPackagingVersion>
     <MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.19278.1</MicrosoftDotNetXUnitConsoleRunnerVersion>
     <!-- corefx -->
     <MicrosoftPrivateCoreFxNETCoreAppVersion>4.6.0-preview8.19326.15</MicrosoftPrivateCoreFxNETCoreAppVersion>
diff --git a/eng/common/post-build/promote-build.ps1 b/eng/common/post-build/promote-build.ps1
new file mode 100644 (file)
index 0000000..84a608f
--- /dev/null
@@ -0,0 +1,53 @@
+param(
+  [Parameter(Mandatory=$true)][int] $BuildId,
+  [Parameter(Mandatory=$true)][int] $ChannelId,
+  [Parameter(Mandatory=$true)][string] $BarToken,
+  [string] $MaestroEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com",
+  [string] $ApiVersion = "2019-01-16"
+)
+
+$ErrorActionPreference = "Stop"
+Set-StrictMode -Version 2.0
+
+. $PSScriptRoot\..\tools.ps1
+
+function Get-Headers([string]$accept, [string]$barToken) {
+  $headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]'
+  $headers.Add('Accept',$accept)
+  $headers.Add('Authorization',"Bearer $barToken")
+  return $headers
+}
+
+try {
+  $maestroHeaders = Get-Headers 'application/json' $BarToken
+
+  # Get info about which channels the build has already been promoted to
+  $getBuildApiEndpoint = "$MaestroEndpoint/api/builds/${BuildId}?api-version=$ApiVersion"
+  $buildInfo = Invoke-WebRequest -Method Get -Uri $getBuildApiEndpoint -Headers $maestroHeaders | ConvertFrom-Json
+
+  if (!$buildInfo) {
+    Write-Host "Build with BAR ID $BuildId was not found in BAR!"
+    ExitWithExitCode 1
+  }
+
+  # Find whether the build is already assigned to the channel or not
+  if ($buildInfo.channels) {
+    foreach ($channel in $buildInfo.channels) {
+      if ($channel.Id -eq $ChannelId) {
+        Write-Host "The build with BAR ID $BuildId is already on channel $ChannelId!"
+        ExitWithExitCode 0
+      }
+    }
+  }
+
+  Write-Host "Build not present in channel $ChannelId. Promoting build ... "
+
+  $promoteBuildApiEndpoint = "$maestroEndpoint/api/channels/${ChannelId}/builds/${BuildId}?api-version=$ApiVersion"
+  Invoke-WebRequest -Method Post -Uri $promoteBuildApiEndpoint -Headers $maestroHeaders
+  Write-Host "done."
+} 
+catch {
+  Write-Host "There was an error while trying to promote build '$BuildId' to channel '$ChannelId'"
+  Write-Host $_
+  Write-Host $_.ScriptStackTrace
+}
diff --git a/eng/common/sdl/extract-artifact-packages.ps1 b/eng/common/sdl/extract-artifact-packages.ps1
new file mode 100644 (file)
index 0000000..0f6a6e4
--- /dev/null
@@ -0,0 +1,66 @@
+param(
+  [Parameter(Mandatory=$true)][string] $InputPath,              # Full path to directory where artifact packages are stored
+  [Parameter(Mandatory=$true)][string] $ExtractPath            # Full path to directory where the packages will be extracted
+)
+
+$ErrorActionPreference = "Stop"
+Set-StrictMode -Version 2.0
+$ExtractPackage = {
+  param( 
+    [string] $PackagePath                                 # Full path to a NuGet package
+  )
+  
+  if (!(Test-Path $PackagePath)) {
+    Write-PipelineTaskError "Input file does not exist: $PackagePath"
+    ExitWithExitCode 1
+  }
+  
+  $RelevantExtensions = @(".dll", ".exe", ".pdb")
+  Write-Host -NoNewLine "Extracting" ([System.IO.Path]::GetFileName($PackagePath)) "... "
+
+  $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
+  $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId
+
+  Add-Type -AssemblyName System.IO.Compression.FileSystem
+
+  [System.IO.Directory]::CreateDirectory($ExtractPath);
+
+  try {
+    $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath)
+
+    $zip.Entries | 
+    Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} |
+      ForEach-Object {
+          $TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.Name
+
+          [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true)
+        }
+  }
+  catch {
+  
+  }
+  finally {
+    $zip.Dispose() 
+  }
+ }
+ function ExtractArtifacts {
+  $Jobs = @()
+  Get-ChildItem "$InputPath\*.nupkg" |
+    ForEach-Object {
+      $Jobs += Start-Job -ScriptBlock $ExtractPackage -ArgumentList $_.FullName
+    }
+
+  foreach ($Job in $Jobs) {
+    Wait-Job -Id $Job.Id | Receive-Job
+  }
+}
+
+try {
+  Measure-Command { ExtractArtifacts }
+}
+catch {
+  Write-Host $_
+  Write-Host $_.Exception
+  Write-Host $_.ScriptStackTrace
+  ExitWithExitCode 1
+}
index 39a8e80..5837f3d 100644 (file)
@@ -20,6 +20,16 @@ jobs:
       downloadType: specific files
       matchingPattern: "**"
       downloadPath: $(Build.SourcesDirectory)\artifacts
+  - powershell: eng/common/sdl/extract-artifact-packages.ps1
+      -InputPath $(Build.SourcesDirectory)\artifacts\BlobArtifacts
+      -ExtractPath $(Build.SourcesDirectory)\artifacts\BlobArtifacts
+    displayName: Extract Blob Artifacts
+    continueOnError: ${{ parameters.continueOnError }}
+  - powershell: eng/common/sdl/extract-artifact-packages.ps1
+      -InputPath $(Build.SourcesDirectory)\artifacts\PackageArtifacts
+      -ExtractPath $(Build.SourcesDirectory)\artifacts\PackageArtifacts
+    displayName: Extract Package Artifacts
+    continueOnError: ${{ parameters.continueOnError }}
   - task: NuGetToolInstaller@1
     displayName: 'Install NuGet.exe'
   - task: NuGetCommand@2
index ff73461..9e77ef1 100644 (file)
@@ -66,7 +66,6 @@ jobs:
         script: |
           Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(BARBuildId)
           Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value "$(DefaultChannels)"
-          Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(IsInternalBuild)
           Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(IsStableBuild)
     - task: PublishBuildArtifacts@1
       displayName: Publish ReleaseConfigs Artifact
diff --git a/eng/common/templates/post-build/channels/internal-servicing.yml b/eng/common/templates/post-build/channels/internal-servicing.yml
new file mode 100644 (file)
index 0000000..99cd59b
--- /dev/null
@@ -0,0 +1,167 @@
+parameters:
+  enableSymbolValidation: true
+
+stages:
+- stage: IS_Publish
+  dependsOn: validate
+  variables:
+    - template: ../common-variables.yml
+  displayName: Internal Servicing
+  jobs:
+  - template: ../setup-maestro-vars.yml
+
+  - job:
+    displayName: Symbol Publishing
+    dependsOn: setupMaestroVars
+    condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id)
+    variables:
+      - group: DotNet-Symbol-Server-Pats
+    pool:
+      vmImage: 'windows-2019'
+    steps:
+      - task: DownloadBuildArtifacts@0
+        displayName: Download Artifacts
+        inputs:
+          downloadType: specific files
+          matchingPattern: "*Artifacts*"
+
+      - task: PowerShell@2
+        displayName: Publish
+        inputs:
+          filePath: eng\common\sdk-task.ps1
+          arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet
+            /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) 
+            /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) 
+            /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/'
+            /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/'
+            /p:Configuration=Release
+
+  - job:
+    displayName: Publish Assets
+    dependsOn: setupMaestroVars
+    variables:
+      - group: DotNet-Blob-Feed
+      - group: Publish-Build-Assets
+      - group: AzureDevOps-Artifact-Feeds-Pats
+      - name: BARBuildId
+        value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
+      - name: IsStableBuild
+        value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ]
+    condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id)
+    pool:
+      vmImage: 'windows-2019'
+    steps:
+      - task: DownloadBuildArtifacts@0
+        displayName: Download Package Artifacts
+        inputs:
+          buildType: current
+          artifactName: PackageArtifacts
+
+      - task: DownloadBuildArtifacts@0
+        displayName: Download Blob Artifacts
+        inputs:
+          buildType: current
+          artifactName: BlobArtifacts
+
+      - task: DownloadBuildArtifacts@0
+        displayName: Download Asset Manifests
+        inputs:
+          buildType: current
+          artifactName: AssetManifests
+
+      - task: PowerShell@2
+        displayName: Add Assets Location
+        env:
+          AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw)
+        inputs:
+          filePath: eng\common\sdk-task.ps1
+          arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet 
+            /p:ChannelId=$(InternalServicing_30_Channel_Id)
+            /p:IsStableBuild=$(IsStableBuild)
+            /p:IsInternalBuild=$(IsInternalBuild)
+            /p:RepositoryName=$(Build.Repository.Name)
+            /p:CommitSha=$(Build.SourceVersion)
+            /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe
+            /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' 
+            /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' 
+            /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' 
+            /p:BARBuildId=$(BARBuildId) 
+            /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com'
+            /p:BuildAssetRegistryToken='$(MaestroAccessToken)' 
+            /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' 
+            /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' 
+            /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' 
+            /p:Configuration=Release 
+        
+      - task: NuGetCommand@2
+        displayName: Publish Packages to AzDO Feed
+        condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com')
+        inputs:
+          command: push
+          vstsFeed: $(AzDoFeedName)
+          packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg
+          publishVstsFeed: $(AzDoFeedName)
+
+      - task: PowerShell@2
+        displayName: Publish Blobs to AzDO Feed
+        inputs:
+          filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1
+          arguments: -FeedName $(AzDoFeedName) 
+            -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/
+            -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw)
+        enabled: false
+
+
+- stage: IS_PublishValidation
+  displayName: Publish Validation
+  variables:
+    - template: ../common-variables.yml  
+  jobs:
+  - template: ../setup-maestro-vars.yml
+
+  - ${{ if eq(parameters.enableSymbolValidation, 'true') }}:
+    - job:
+      displayName: Symbol Availability
+      dependsOn: setupMaestroVars
+      condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id)
+      pool:
+        vmImage: 'windows-2019'
+      steps:
+        - task: DownloadBuildArtifacts@0
+          displayName: Download Package Artifacts
+          inputs:
+            buildType: current
+            artifactName: PackageArtifacts
+
+        - task: PowerShell@2
+          displayName: Check Symbol Availability
+          inputs:
+            filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1
+            arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion)
+
+  - job:
+    displayName: Gather Drop
+    dependsOn: setupMaestroVars
+    variables:
+      BARBuildId: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
+    condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id)
+    pool:
+      vmImage: 'windows-2019'
+    steps:
+      - task: PowerShell@2
+        displayName: Setup Darc CLI
+        inputs:
+          targetType: filePath
+          filePath: '$(Build.SourcesDirectory)/eng/common/darc-init.ps1'
+
+      - task: PowerShell@2
+        displayName: Run Darc gather-drop
+        inputs:
+          targetType: inline
+          script: |
+            darc gather-drop --non-shipping --continue-on-error --id $(BARBuildId) --output-dir $(Agent.BuildDirectory)/Temp/Drop/ --bar-uri https://maestro-prod.westus2.cloudapp.azure.com/ --password $(MaestroAccessToken) --latest-location
+        enabled: false
+
+  - template: ../promote-build.yml
+    parameters:
+      ChannelId: ${{ variables.InternalServicing_30_Channel_Id }}
index c61eaa9..79c6822 100644 (file)
@@ -20,17 +20,10 @@ stages:
       vmImage: 'windows-2019'
     steps:
       - task: DownloadBuildArtifacts@0
-        displayName: Download PDB Artifacts
+        displayName: Download Artifacts
         inputs:
-          buildType: current
-          artifactName: PDBArtifacts
-        continueOnError: true
-
-      - task: DownloadBuildArtifacts@0
-        displayName: Download Blob Artifacts
-        inputs:
-          buildType: current
-          artifactName: BlobArtifacts
+          downloadType: specific files
+          matchingPattern: "*Artifacts*"
 
       - task: PowerShell@2
         displayName: Publish
@@ -44,13 +37,16 @@ stages:
             /p:Configuration=Release
 
   - job:
-    displayName: Publish to Static Feed
+    displayName: Publish Assets
     dependsOn: setupMaestroVars
     variables:
       - group: DotNet-Blob-Feed
       - group: Publish-Build-Assets
+      - group: AzureDevOps-Artifact-Feeds-Pats
       - name: BARBuildId
         value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
+      - name: IsStableBuild
+        value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ]
     condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicDevRelease_30_Channel_Id)
     pool:
       vmImage: 'windows-2019'
@@ -74,22 +70,47 @@ stages:
           artifactName: AssetManifests
 
       - task: PowerShell@2
-        displayName: Publish
+        displayName: Add Assets Location
+        env:
+          AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw)
         inputs:
           filePath: eng\common\sdk-task.ps1
-          arguments: -task PublishToPackageFeed -restore -msbuildEngine dotnet 
-            /p:AccountKeyToStaticFeed='$(dotnetfeed-storage-access-key-1)' 
+          arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet 
+            /p:ChannelId=$(PublicDevRelease_30_Channel_Id)
+            /p:IsStableBuild=$(IsStableBuild)
+            /p:IsInternalBuild=$(IsInternalBuild)
+            /p:RepositoryName=$(Build.Repository.Name)
+            /p:CommitSha=$(Build.SourceVersion)
+            /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe
+            /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' 
+            /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' 
+            /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' 
             /p:BARBuildId=$(BARBuildId) 
             /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com'
             /p:BuildAssetRegistryToken='$(MaestroAccessToken)' 
             /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' 
             /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' 
             /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' 
-            /p:ArtifactsCategory='$(_DotNetArtifactsCategory)' 
-            /p:OverrideAssetsWithSameName=true 
-            /p:PassIfExistingItemIdentical=true 
             /p:Configuration=Release 
         
+      - task: NuGetCommand@2
+        displayName: Publish Packages to AzDO Feed
+        condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com')
+        inputs:
+          command: push
+          vstsFeed: $(AzDoFeedName)
+          packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg
+          publishVstsFeed: $(AzDoFeedName)
+
+      - task: PowerShell@2
+        displayName: Publish Blobs to AzDO Feed
+        inputs:
+          filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1
+          arguments: -FeedName $(AzDoFeedName) 
+            -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/
+            -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw)
+        enabled: false
+
 
 - stage: PublishValidation
   displayName: Publish Validation
@@ -140,6 +161,6 @@ stages:
           script: |
             darc gather-drop --non-shipping --continue-on-error --id $(BARBuildId) --output-dir $(Agent.BuildDirectory)/Temp/Drop/ --bar-uri https://maestro-prod.westus2.cloudapp.azure.com/ --password $(MaestroAccessToken) --latest-location
 
-  - template: ../promote-build.yml
-    parameters:
+  - template: ../promote-build.yml     
+    parameters:        
       ChannelId: ${{ variables.PublicDevRelease_30_Channel_Id }}
diff --git a/eng/common/templates/post-build/channels/public-release.yml b/eng/common/templates/post-build/channels/public-release.yml
new file mode 100644 (file)
index 0000000..f23eb3f
--- /dev/null
@@ -0,0 +1,167 @@
+parameters:
+  enableSymbolValidation: true
+
+stages:
+- stage: PubRel_Publish
+  dependsOn: validate
+  variables:
+    - template: ../common-variables.yml
+  displayName: Public Release
+  jobs:
+  - template: ../setup-maestro-vars.yml
+
+  - job:
+    displayName: Symbol Publishing
+    dependsOn: setupMaestroVars
+    condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id)
+    variables:
+      - group: DotNet-Symbol-Server-Pats
+    pool:
+      vmImage: 'windows-2019'
+    steps:
+      - task: DownloadBuildArtifacts@0
+        displayName: Download Artifacts
+        inputs:
+          downloadType: specific files
+          matchingPattern: "*Artifacts*"
+
+      - task: PowerShell@2
+        displayName: Publish
+        inputs:
+          filePath: eng\common\sdk-task.ps1
+          arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet
+            /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) 
+            /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) 
+            /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/'
+            /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/'
+            /p:Configuration=Release
+
+  - job:
+    displayName: Publish Assets
+    dependsOn: setupMaestroVars
+    variables:
+      - group: DotNet-Blob-Feed
+      - group: Publish-Build-Assets
+      - group: AzureDevOps-Artifact-Feeds-Pats
+      - name: BARBuildId
+        value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
+      - name: IsStableBuild
+        value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ]
+    condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id)
+    pool:
+      vmImage: 'windows-2019'
+    steps:
+      - task: DownloadBuildArtifacts@0
+        displayName: Download Package Artifacts
+        inputs:
+          buildType: current
+          artifactName: PackageArtifacts
+
+      - task: DownloadBuildArtifacts@0
+        displayName: Download Blob Artifacts
+        inputs:
+          buildType: current
+          artifactName: BlobArtifacts
+
+      - task: DownloadBuildArtifacts@0
+        displayName: Download Asset Manifests
+        inputs:
+          buildType: current
+          artifactName: AssetManifests
+
+      - task: PowerShell@2
+        displayName: Publish
+        env:
+          AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw)
+        inputs:
+          filePath: eng\common\sdk-task.ps1
+          arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet 
+            /p:ChannelId=$(PublicRelease_30_Channel_Id)
+            /p:IsStableBuild=$(IsStableBuild)
+            /p:IsInternalBuild=$(IsInternalBuild)
+            /p:RepositoryName=$(Build.Repository.Name)
+            /p:CommitSha=$(Build.SourceVersion)
+            /p:NugetPath=$(Agent.BuildDirectory)/Nuget/NuGet.exe
+            /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' 
+            /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' 
+            /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' 
+            /p:BARBuildId=$(BARBuildId) 
+            /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com'
+            /p:BuildAssetRegistryToken='$(MaestroAccessToken)' 
+            /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' 
+            /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' 
+            /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' 
+            /p:Configuration=Release 
+        
+      - task: NuGetCommand@2
+        displayName: Publish Packages to AzDO Feed
+        condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com')
+        inputs:
+          command: push
+          vstsFeed: $(AzDoFeedName)
+          packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg
+          publishVstsFeed: $(AzDoFeedName)
+
+      - task: PowerShell@2
+        displayName: Publish Blobs to AzDO Feed
+        inputs:
+          filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1
+          arguments: -FeedName $(AzDoFeedName) 
+            -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/
+            -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw)
+        enabled: false
+
+
+- stage: PubRel_PublishValidation
+  displayName: Publish Validation
+  variables:
+    - template: ../common-variables.yml  
+  jobs:
+  - template: ../setup-maestro-vars.yml
+
+  - ${{ if eq(parameters.enableSymbolValidation, 'true') }}:
+    - job:
+      displayName: Symbol Availability
+      dependsOn: setupMaestroVars
+      condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id)
+      pool:
+        vmImage: 'windows-2019'
+      steps:
+        - task: DownloadBuildArtifacts@0
+          displayName: Download Package Artifacts
+          inputs:
+            buildType: current
+            artifactName: PackageArtifacts
+
+        - task: PowerShell@2
+          displayName: Check Symbol Availability
+          inputs:
+            filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1
+            arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion)
+
+  - job:
+    displayName: Gather Drop
+    dependsOn: setupMaestroVars
+    variables:
+      BARBuildId: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
+    condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id)
+    pool:
+      vmImage: 'windows-2019'
+    steps:
+      - task: PowerShell@2
+        displayName: Setup Darc CLI
+        inputs:
+          targetType: filePath
+          filePath: '$(Build.SourcesDirectory)/eng/common/darc-init.ps1'
+
+      - task: PowerShell@2
+        displayName: Run Darc gather-drop
+        inputs:
+          targetType: inline
+          script: |
+            darc gather-drop --non-shipping --continue-on-error --id $(BARBuildId) --output-dir $(Agent.BuildDirectory)/Temp/Drop/ --bar-uri https://maestro-prod.westus2.cloudapp.azure.com/ --password $(MaestroAccessToken) --latest-location
+        enabled: false
+
+  - template: ../promote-build.yml
+    parameters:
+      ChannelId: ${{ variables.PublicRelease_30_Channel_Id }}
index 23725c6..114477d 100644 (file)
@@ -8,14 +8,17 @@ stages:
   - template: ../setup-maestro-vars.yml
 
   - job:
-    displayName: Publish to Static Feed
+    displayName: Publish Assets
     dependsOn: setupMaestroVars
-    condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicValidationRelease_30_Channel_Id)
     variables:
       - group: DotNet-Blob-Feed
       - group: Publish-Build-Assets
+      - group: AzureDevOps-Artifact-Feeds-Pats
       - name: BARBuildId
         value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ]
+      - name: IsStableBuild
+        value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ]
+    condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicValidationRelease_30_Channel_Id)
     pool:
       vmImage: 'windows-2019'
     steps:
@@ -38,21 +41,46 @@ stages:
           artifactName: AssetManifests
 
       - task: PowerShell@2
-        displayName: Publish
+        displayName: Add Assets Location
+        env:
+          AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw)
         inputs:
           filePath: eng\common\sdk-task.ps1
-          arguments: -task PublishToPackageFeed -restore -msbuildEngine dotnet 
-            /p:AccountKeyToStaticFeed='$(dotnetfeed-storage-access-key-1)' 
+          arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet 
+            /p:ChannelId=$(PublicValidationRelease_30_Channel_Id)
+            /p:IsStableBuild=$(IsStableBuild)
+            /p:IsInternalBuild=$(IsInternalBuild)
+            /p:RepositoryName=$(Build.Repository.Name)
+            /p:CommitSha=$(Build.SourceVersion)
+            /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe
+            /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' 
+            /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' 
+            /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' 
             /p:BARBuildId=$(BARBuildId) 
             /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com'
             /p:BuildAssetRegistryToken='$(MaestroAccessToken)' 
             /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' 
-            /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' 
-            /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' 
-            /p:ArtifactsCategory='$(_DotNetArtifactsCategory)' 
-            /p:OverrideAssetsWithSameName=true 
-            /p:PassIfExistingItemIdentical=true 
+            /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' 
+            /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' 
             /p:Configuration=Release 
+        
+      - task: NuGetCommand@2
+        displayName: Publish Packages to AzDO Feed
+        condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com')
+        inputs:
+          command: push
+          vstsFeed: $(AzDoFeedName)
+          packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg
+          publishVstsFeed: $(AzDoFeedName)
+
+      - task: PowerShell@2
+        displayName: Publish Blobs to AzDO Feed
+        inputs:
+          filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1
+          arguments: -FeedName $(AzDoFeedName) 
+            -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/
+            -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw)
+        enabled: false
 
 
 - stage: PVR_PublishValidation
@@ -86,6 +114,6 @@ stages:
           script: |
             darc gather-drop --non-shipping --continue-on-error --id $(BARBuildId) --output-dir $(Agent.BuildDirectory)/Temp/Drop/ --bar-uri https://maestro-prod.westus2.cloudapp.azure.com --password $(MaestroAccessToken) --latest-location
 
-  - template: ../promote-build.yml
-    parameters:
+  - template: ../promote-build.yml     
+    parameters:        
       ChannelId: ${{ variables.PublicValidationRelease_30_Channel_Id }}
index 97b48d9..8283467 100644 (file)
@@ -5,5 +5,14 @@ variables:
   # .NET Tools - Validation
   PublicValidationRelease_30_Channel_Id: 9
 
+  # .NET Core 3.0 Internal Servicing
+  InternalServicing_30_Channel_Id: 184
+
+  # .NET Core 3.0 Release
+  PublicRelease_30_Channel_Id: 19
+
+  # Whether the build is internal or not
+  IsInternalBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), contains(variables['Build.SourceBranch'], 'internal')) }}
+
   SourceLinkCLIVersion: 3.0.0
   SymbolToolVersion: 1.0.1
index 2c411dd..3d7e677 100644 (file)
@@ -65,3 +65,7 @@ stages:
     enableSymbolValidation: ${{ parameters.enableSymbolValidation }}
 
 - template: \eng\common\templates\post-build\channels\public-validation-release.yml
+
+- template: \eng\common\templates\post-build\channels\public-release.yml
+
+- template: \eng\common\templates\post-build\channels\internal-servicing.yml
index d003170..af48b0b 100644 (file)
@@ -18,11 +18,7 @@ jobs:
     - task: PowerShell@2
       displayName: Add Build to Channel
       inputs:
-        targetType: inline
-        script: |
-          $headers = @{
-            "Accept" = "application/json"
-            "Authorization" = "Bearer $(MaestroAccessToken)"
-          }
-          Invoke-RestMethod -Method Post -Headers $headers -Uri https://maestro-prod.westus2.cloudapp.azure.com/api/channels/$(ChannelId)/builds/$(BARBuildId)?api-version=2019-01-16
-      enabled: false
+        filePath: $(Build.SourcesDirectory)/eng/common/post-build/promote-build.ps1
+        arguments: -BuildId $(BARBuildId) 
+          -ChannelId $(ChannelId) 
+          -BarToken $(MaestroAccessToken)
index 0eddd6c..f6120dc 100644 (file)
@@ -28,10 +28,8 @@ jobs:
           $Channels = ""            
           $Content | Select -Index 1 | ForEach-Object { $Channels += "$_ ," }
             
-          $IsInternalBuild = $Content | Select -Index 2
-          $IsStableBuild = $Content | Select -Index 3
+          $IsStableBuild = $Content | Select -Index 2
 
           Write-PipelineSetVariable -Name 'BARBuildId' -Value $BarId
           Write-PipelineSetVariable -Name 'InitialChannels' -Value "$Channels"
-          Write-PipelineSetVariable -Name 'IsInternalBuild' -Value $IsInternalBuild
           Write-PipelineSetVariable -Name 'IsStableBuild' -Value $IsStableBuild
index 7788bc6..317a723 100644 (file)
@@ -7,8 +7,8 @@
     "python": "2.7.15"
   },
   "msbuild-sdks": {
-    "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19324.24",
-    "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19324.24",
+    "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19326.44",
+    "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19326.44",
     "Microsoft.Build.NoTargets": "1.0.53",
     "Microsoft.Build.Traversal": "2.0.2"
   }
index d08753a..fd66c18 100644 (file)
@@ -570,13 +570,13 @@ namespace System.Runtime.CompilerServices
             {
                 Debug.Assert(s is AsyncStateMachineBox<TStateMachine>);
                 // Only used privately to pass directly to EC.Run
-                Unsafe.As<AsyncStateMachineBox<TStateMachine>>(s).StateMachine.MoveNext();
+                Unsafe.As<AsyncStateMachineBox<TStateMachine>>(s).StateMachine!.MoveNext();
             }
 
             /// <summary>A delegate to the <see cref="MoveNext()"/> method.</summary>
             private Action? _moveNextAction;
             /// <summary>The state machine itself.</summary>
-            [AllowNull, MaybeNull] public TStateMachine StateMachine = default!; // mutable struct; do not make this readonly. SOS DumpAsync command depends on this name.  // TODO-NULLABLE: Remove ! when nullable attributes are respected
+            [AllowNull, MaybeNull] public TStateMachine StateMachine = default; // mutable struct; do not make this readonly. SOS DumpAsync command depends on this name.
             /// <summary>Captured ExecutionContext with which to invoke <see cref="MoveNextAction"/>; may be null.</summary>
             public ExecutionContext? Context;
 
@@ -601,7 +601,8 @@ namespace System.Runtime.CompilerServices
                 ExecutionContext? context = Context;
                 if (context == null)
                 {
-                    StateMachine.MoveNext();
+                    Debug.Assert(StateMachine != null);
+                    StateMachine!.MoveNext(); // TODO-NULLABLE: remove ! when Debug.Assert on fields is respected (https://github.com/dotnet/roslyn/issues/36830)
                 }
                 else
                 {
@@ -620,7 +621,7 @@ namespace System.Runtime.CompilerServices
                     // Clear out state now that the async method has completed.
                     // This avoids keeping arbitrary state referenced by lifted locals
                     // if this Task / state machine box is held onto.
-                    StateMachine = default!; // TODO-NULLABLE: Remove ! when nullable attributes are respected
+                    StateMachine = default;
                     Context = default;
 
 #if !CORERT
@@ -641,7 +642,7 @@ namespace System.Runtime.CompilerServices
             }
 
             /// <summary>Gets the state machine as a boxed object.  This should only be used for debugging purposes.</summary>
-            IAsyncStateMachine IAsyncStateMachineBox.GetStateMachineObject() => StateMachine; // likely boxes, only use for debugging
+            IAsyncStateMachine IAsyncStateMachineBox.GetStateMachineObject() => StateMachine!; // likely boxes, only use for debugging
         }
 
         /// <summary>Gets the <see cref="System.Threading.Tasks.Task{TResult}"/> for this builder.</summary>
index a7de15a..6464676 100644 (file)
@@ -1260,7 +1260,7 @@ namespace System.Threading.Tasks
                 // Grab the relevant state and then null it out so that the task doesn't hold onto the state unnecessarily
                 var thisRef = promise!.m_thisRef; // TODO-NULLABLE: Remove ! when [DoesNotReturn] respected
                 var endMethod = promise.m_endMethod;
-                promise.m_thisRef = default!; // TODO-NULLABLE: Remove ! when nullable attributes are respected
+                promise.m_thisRef = default;
                 promise.m_endMethod = null;
                 if (endMethod == null) ThrowHelper.ThrowArgumentException(ExceptionResource.InvalidOperation_WrongAsyncResultOrEndCalledMultiple, ExceptionArgument.asyncResult);
 
@@ -1268,6 +1268,7 @@ namespace System.Threading.Tasks
                 // we'll instead complete the promise at the call site.
                 if (!asyncResult.CompletedSynchronously)
                 {
+                    Debug.Assert(thisRef != null);
                     promise.Complete(thisRef, endMethod!, asyncResult, requiresSynchronization: true); // TODO-NULLABLE: Remove ! when [DoesNotReturn] respected
                 }
             }