Skip to content

Commit

Permalink
Merge pull request #51527 from dotnet/merges/release/dev16.10-to-master
Browse files Browse the repository at this point in the history
Merge release/dev16.10 to master
  • Loading branch information
msftbot[bot] authored Feb 27, 2021
2 parents 833c4e8 + bec4705 commit c5dbbd4
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
18 changes: 15 additions & 3 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,26 @@ variables:
- group: DotNet-GitHub-Versions-Repo-Write
- name: _DevDivDropAccessToken
value: $(System.AccessToken)
# For publishing from devdiv pipeline to devdiv feed, the API key can
# be any non-empty string as authentication is done in the pipeline.
- name: _DevDivNugetFeedAccessToken
value: "AzureArtifacts"
# If the pipeline is running in dnceng:
# Get access token with $dn-bot-devdiv-drop-rw-code-rw from DotNet-VSTS-Infra-Access
# Get access token with $dn-bot-devdiv-drop-rw-code-rw and dn-bot-dnceng-build-rw-code-rw from DotNet-VSTS-Infra-Access
# Get $dotnetfeed-storage-access-key-1 from DotNet-Blob-Feed
# Get $microsoft-symbol-server-pat and $symweb-symbol-server-pat from DotNet-Symbol-Server-Pats
# Get $AccessToken-dotnet-build-bot-public-repo from DotNet-Versions-Publish
# Get $dn-bot-devdiv-packaging-rw from DotNet-DevDiv-Insertion-Workflow-Variables
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group: DotNet-Blob-Feed
- group: DotNet-Symbol-Server-Pats
- group: DotNet-Versions-Publish
- group: DotNet-VSTS-Infra-Access
- group: DotNet-DevDiv-Insertion-Workflow-Variables
- name: _DevDivDropAccessToken
value: $(dn-bot-devdiv-drop-rw-code-rw)
- name: _DevDivNugetFeedAccessToken
value: $(dn-bot-devdiv-packaging-rw)

stages:
- stage: build
Expand Down Expand Up @@ -109,7 +117,11 @@ stages:
- task: PowerShell@2
displayName: Merge master-vs-deps into source branch
inputs:
filePath: 'scripts\merge-vs-deps.ps1'
filePath: 'scripts\merge-vs-deps.ps1'
${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
arguments: '-userName "$(Build.RequestedFor)" -userEmail $(Build.RequestedForEmail)'
${{ if eq(variables['System.TeamProject'], 'internal') }}:
arguments: '-userName "$(Build.RequestedFor)" -userEmail $(Build.RequestedForEmail) -accessToken $(dn-bot-dnceng-build-rw-code-rw)'
condition: and(succeeded(), eq(variables['SourceBranchName'], 'master'))

- powershell: Write-Host "##vso[task.setvariable variable=VisualStudio.DropName]Products/$(System.TeamProject)/$(Build.Repository.Name)/$(SourceBranchName)/$(Build.BuildNumber)"
Expand Down Expand Up @@ -180,7 +192,7 @@ stages:
displayName: Publish Assets
inputs:
filePath: 'eng\publish-assets.ps1'
arguments: '-configuration $(BuildConfiguration) -branchName "$(SourceBranchName)" -gitHubUserName $(Roslyn.GitHubUserName) -gitHubToken $(AccessToken-dotnet-build-bot-public-repo) -gitHubEmail $(Roslyn.GitHubEmail)'
arguments: '-configuration $(BuildConfiguration) -branchName "$(SourceBranchName)" -gitHubUserName $(Roslyn.GitHubUserName) -gitHubToken $(AccessToken-dotnet-build-bot-public-repo) -gitHubEmail $(Roslyn.GitHubEmail) -devdivApiKey $(_DevDivNugetFeedAccessToken)'
condition: and(succeeded(), eq(variables['PRNumber'], 'default'))

# Publish OptProf configuration files
Expand Down
6 changes: 3 additions & 3 deletions eng/publish-assets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Param(
[string]$gitHubUserName = "",
[string]$gitHubToken = "",
[string]$gitHubEmail = "",
[string]$nugetApiKey = ""
[string]$nugetApiKey = "",
[string]$devdivApiKey = ""
)
Set-StrictMode -version 2.0
$ErrorActionPreference="Stop"
Expand All @@ -28,8 +29,7 @@ function Get-PublishKey([string]$uploadUrl) {
$url = New-Object Uri $uploadUrl
switch ($url.Host) {
"api.nuget.org" { return $nugetApiKey }
# For publishing to azure, the API key can be any non-empty string as authentication is done in the pipeline.
"pkgs.dev.azure.com" { return "AzureArtifacts"}
"pkgs.dev.azure.com" { return $devdivApiKey}
default { throw "Cannot determine publish key for $uploadUrl" }
}
}
Expand Down
18 changes: 17 additions & 1 deletion scripts/merge-vs-deps.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
git pull origin master-vs-deps
[CmdletBinding(PositionalBinding=$false)]
Param(
[string]$userName,
[string]$userEmail,
[string]$accessToken = "")

git config user.name $userName
git config user.email $userEmail

if ($accessToken -eq "") {
git pull origin master-vs-deps
}
else {
$base64Pat = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(":$accessToken"))
git -c http.extraheader="AUTHORIZATION: Basic $base64Pat" pull origin master-vs-deps
}

if (-not $?)
{
Write-Host "##vso[task.logissue type=error]Failed to merge master-vs-deps into source branch"
Expand Down

0 comments on commit c5dbbd4

Please sign in to comment.