From a3f034406cfe2ce359ad4337750a41f7ba5b0ad7 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:03:32 +0000 Subject: [PATCH 01/14] Update dependencies from https://github.com/dotnet/diagnostics build 20240621.1 (#6879) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1a1edf98931..e0852c54e7f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - 464e06c9a8602dff44ff5c59e9a0c3777f68e41c + 842c9603a97cf417814cf6c8d96e5c881025bf0e - + https://github.com/dotnet/diagnostics - 464e06c9a8602dff44ff5c59e9a0c3777f68e41c + 842c9603a97cf417814cf6c8d96e5c881025bf0e https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade a95bcc256e9bdf47394e4dab04872811c16daaea - + https://github.com/dotnet/diagnostics - 464e06c9a8602dff44ff5c59e9a0c3777f68e41c + 842c9603a97cf417814cf6c8d96e5c881025bf0e https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 8ed860bff1f..77d9909dd42 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24320.2 - 8.0.0-preview.24320.2 + 8.0.0-preview.24321.1 + 8.0.0-preview.24321.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.532002 + 1.0.532101 $(MicrosoftNETCoreApp31Version) From ccb6d1cf6b5a856c0643f3e63ab8f1e008c03c67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 10:53:23 -0700 Subject: [PATCH 02/14] Bump streetsidesoftware/cspell-action from 6.3.0 to 6.4.0 (#6864) Bumps [streetsidesoftware/cspell-action](https://github.com/streetsidesoftware/cspell-action) from 6.3.0 to 6.4.0. - [Release notes](https://github.com/streetsidesoftware/cspell-action/releases) - [Changelog](https://github.com/streetsidesoftware/cspell-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/streetsidesoftware/cspell-action/compare/104110db58e8c9a11c1c6be025e2082f4dded3bb...542d05c6a8980c81277ec229f9beadf4ab3f5a34) --- updated-dependencies: - dependency-name: streetsidesoftware/cspell-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/spellcheck.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index f959d793362..e43eec26e12 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -17,7 +17,7 @@ jobs: with: persist-credentials: false - - uses: streetsidesoftware/cspell-action@104110db58e8c9a11c1c6be025e2082f4dded3bb + - uses: streetsidesoftware/cspell-action@542d05c6a8980c81277ec229f9beadf4ab3f5a34 name: Documentation spellcheck if: ${{ !cancelled() }} with: @@ -25,7 +25,7 @@ jobs: inline: error incremental_files_only: true - - uses: streetsidesoftware/cspell-action@104110db58e8c9a11c1c6be025e2082f4dded3bb + - uses: streetsidesoftware/cspell-action@542d05c6a8980c81277ec229f9beadf4ab3f5a34 name: Resx spellcheck if: ${{ !cancelled() }} with: @@ -33,7 +33,7 @@ jobs: inline: error incremental_files_only: true - - uses: streetsidesoftware/cspell-action@104110db58e8c9a11c1c6be025e2082f4dded3bb + - uses: streetsidesoftware/cspell-action@542d05c6a8980c81277ec229f9beadf4ab3f5a34 name: Source code spellcheck if: ${{ !cancelled() }} with: From ac63772178bf8e063cd088a8bfdfc9e9425dd930 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:00:43 +0000 Subject: [PATCH 03/14] Update dependencies from https://github.com/dotnet/diagnostics build 20240624.2 (#6882) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e0852c54e7f..59574f5f9fa 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - 842c9603a97cf417814cf6c8d96e5c881025bf0e + f9c76c57cfa222944222cb84f2cd90505a565435 - + https://github.com/dotnet/diagnostics - 842c9603a97cf417814cf6c8d96e5c881025bf0e + f9c76c57cfa222944222cb84f2cd90505a565435 https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade a95bcc256e9bdf47394e4dab04872811c16daaea - + https://github.com/dotnet/diagnostics - 842c9603a97cf417814cf6c8d96e5c881025bf0e + f9c76c57cfa222944222cb84f2cd90505a565435 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 77d9909dd42..b00a7ae3333 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24209.3 - 8.0.0-preview.24321.1 - 8.0.0-preview.24321.1 + 8.0.0-preview.24324.2 + 8.0.0-preview.24324.2 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.532101 + 1.0.532402 $(MicrosoftNETCoreApp31Version) From 011ae25d7e59a9ca9d445a6ffadced3e451b9983 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:02:13 +0000 Subject: [PATCH 04/14] Update dependencies from https://github.com/dotnet/arcade build 20240624.7 (#6883) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++++------- eng/Versions.props | 6 ++-- eng/common/post-build/publish-using-darc.ps1 | 15 +++++----- .../job/publish-build-assets.yml | 12 ++++---- .../post-build/post-build.yml | 8 ++++-- .../templates/job/publish-build-assets.yml | 12 ++++---- .../templates/post-build/post-build.yml | 8 ++++-- .../post-build/setup-maestro-vars.yml | 28 +++++++++---------- global.json | 4 +-- 9 files changed, 60 insertions(+), 53 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 59574f5f9fa..46d27a5f738 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,29 +22,29 @@ https://github.com/dotnet/roslyn-analyzers b4d9a1334d5189172977ba8fddd00bda70161e4a - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 3fe41d9e97519a4e9b48293906dbf58714ea9a0d https://github.com/dotnet/installer 68e8abb1d3e1a240a6e4c29dcd220aae91681676 - + https://github.com/dotnet/arcade - a95bcc256e9bdf47394e4dab04872811c16daaea + 3fe41d9e97519a4e9b48293906dbf58714ea9a0d https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index b00a7ae3333..c1e96617a97 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 8.0.0-beta.24321.3 - 8.0.0-beta.24321.3 - 8.0.0-beta.24321.3 + 8.0.0-beta.24324.7 + 8.0.0-beta.24324.7 + 8.0.0-beta.24324.7 8.0.1 8.0.1-servicing.23580.8 diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1 index 5a3a32ea8d7..238945cb5ab 100644 --- a/eng/common/post-build/publish-using-darc.ps1 +++ b/eng/common/post-build/publish-using-darc.ps1 @@ -2,7 +2,6 @@ param( [Parameter(Mandatory=$true)][int] $BuildId, [Parameter(Mandatory=$true)][int] $PublishingInfraVersion, [Parameter(Mandatory=$true)][string] $AzdoToken, - [Parameter(Mandatory=$true)][string] $MaestroToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net', [Parameter(Mandatory=$true)][string] $WaitPublishingFinish, [Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters, @@ -31,13 +30,13 @@ try { } & $darc add-build-to-channel ` - --id $buildId ` - --publishing-infra-version $PublishingInfraVersion ` - --default-channels ` - --source-branch main ` - --azdev-pat $AzdoToken ` - --bar-uri $MaestroApiEndPoint ` - --password $MaestroToken ` + --id $buildId ` + --publishing-infra-version $PublishingInfraVersion ` + --default-channels ` + --source-branch main ` + --azdev-pat "$AzdoToken" ` + --bar-uri "$MaestroApiEndPoint" ` + --ci ` @optionalParams if ($LastExitCode -ne 0) { diff --git a/eng/common/templates-official/job/publish-build-assets.yml b/eng/common/templates-official/job/publish-build-assets.yml index 589ac80a18b..d01739c1285 100644 --- a/eng/common/templates-official/job/publish-build-assets.yml +++ b/eng/common/templates-official/job/publish-build-assets.yml @@ -76,13 +76,16 @@ jobs: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Build Assets inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 + arguments: > + -task PublishBuildAssets -restore -msbuildEngine dotnet /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:OfficialBuildId=$(Build.BuildNumber) @@ -144,7 +147,6 @@ jobs: arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates-official/post-build/post-build.yml b/eng/common/templates-official/post-build/post-build.yml index da1f40958b4..0dfa387e7b7 100644 --- a/eng/common/templates-official/post-build/post-build.yml +++ b/eng/common/templates-official/post-build/post-build.yml @@ -272,14 +272,16 @@ stages: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index 8ec0151def2..9fd69fa7c9b 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -74,13 +74,16 @@ jobs: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Build Assets inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 + arguments: > + -task PublishBuildAssets -restore -msbuildEngine dotnet /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro.dot.net /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:OfficialBuildId=$(Build.BuildNumber) @@ -140,7 +143,6 @@ jobs: arguments: -BuildId $(BARBuildId) -PublishingInfraVersion 3 -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index aba44a25a33..2db4933468f 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -268,14 +268,16 @@ stages: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 arguments: -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/templates/post-build/setup-maestro-vars.yml b/eng/common/templates/post-build/setup-maestro-vars.yml index 0c87f149a4a..64b9abc6850 100644 --- a/eng/common/templates/post-build/setup-maestro-vars.yml +++ b/eng/common/templates/post-build/setup-maestro-vars.yml @@ -11,13 +11,14 @@ steps: artifactName: ReleaseConfigs checkDownloadedFiles: true - - task: PowerShell@2 + - task: AzureCLI@2 name: setReleaseVars displayName: Set Release Configs Vars inputs: - targetType: inline - pwsh: true - script: | + azureSubscription: "Darc: Maestro Production" + scriptType: pscore + scriptLocation: inlineScript + inlineScript: | try { if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt @@ -31,15 +32,16 @@ steps: $AzureDevOpsBuildId = $Env:Build_BuildId } else { - $buildApiEndpoint = "${Env:MaestroApiEndPoint}/api/builds/${Env:BARBuildId}?api-version=${Env:MaestroApiVersion}" + . $(Build.SourcesDirectory)\eng\common\tools.ps1 + $darc = Get-Darc + $buildInfo = & $darc get-build ` + --id ${{ parameters.BARBuildId }} ` + --extended ` + --output-format json ` + --ci ` + | convertFrom-Json - $apiHeaders = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' - $apiHeaders.Add('Accept', 'application/json') - $apiHeaders.Add('Authorization',"Bearer ${Env:MAESTRO_API_TOKEN}") - - $buildInfo = try { Invoke-WebRequest -Method Get -Uri $buildApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } - - $BarId = $Env:BARBuildId + $BarId = ${{ parameters.BARBuildId }} $Channels = $Env:PromoteToMaestroChannels -split "," $Channels = $Channels -join "][" $Channels = "[$Channels]" @@ -65,6 +67,4 @@ steps: exit 1 } env: - MAESTRO_API_TOKEN: $(MaestroApiAccessToken) - BARBuildId: ${{ parameters.BARBuildId }} PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }} diff --git a/global.json b/global.json index 3c696a7ea05..a01e14d61e2 100644 --- a/global.json +++ b/global.json @@ -26,7 +26,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24321.3", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24321.3" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24324.7", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24324.7" } } From 2eeb20cba5d235d2eed010dce35ab19e3e2df603 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:29:25 +0000 Subject: [PATCH 05/14] Update dependencies from https://github.com/dotnet/command-line-api build 20240624.3 (#6884) [main] Update dependencies from dotnet/command-line-api --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 46d27a5f738..69bb693dc33 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -12,9 +12,9 @@ https://github.com/dotnet/diagnostics f9c76c57cfa222944222cb84f2cd90505a565435 - + https://github.com/dotnet/command-line-api - 963d34b1fb712c673bfb198133d7e988182c9ef4 + 803d8598f98fb4efd94604b32627ee9407f246db diff --git a/eng/Versions.props b/eng/Versions.props index c1e96617a97..96ed14c10f4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -55,7 +55,7 @@ 8.0.1 8.0.1-servicing.23580.8 - 2.0.0-beta4.24209.3 + 2.0.0-beta4.24324.3 8.0.0-preview.24324.2 8.0.0-preview.24324.2 From 04df58bbc8709acd5f985581d6ac32aa398215d1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:11:23 +0000 Subject: [PATCH 06/14] Update dependencies from https://github.com/dotnet/diagnostics build 20240625.1 (#6893) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 69bb693dc33..60632b1c23b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - f9c76c57cfa222944222cb84f2cd90505a565435 + cb11e39fd51a82531457478b52d58d9498903b40 - + https://github.com/dotnet/diagnostics - f9c76c57cfa222944222cb84f2cd90505a565435 + cb11e39fd51a82531457478b52d58d9498903b40 https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/diagnostics - f9c76c57cfa222944222cb84f2cd90505a565435 + cb11e39fd51a82531457478b52d58d9498903b40 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 96ed14c10f4..286df6ea0d5 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24324.3 - 8.0.0-preview.24324.2 - 8.0.0-preview.24324.2 + 8.0.0-preview.24325.1 + 8.0.0-preview.24325.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.532402 + 1.0.532501 $(MicrosoftNETCoreApp31Version) From 8f40541e3ab729d036ea542280cc99c173e553ac Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:00:52 +0000 Subject: [PATCH 07/14] Update dependencies from https://github.com/dotnet/diagnostics build 20240626.1 (#6896) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 60632b1c23b..f59c755ba53 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - cb11e39fd51a82531457478b52d58d9498903b40 + 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 - + https://github.com/dotnet/diagnostics - cb11e39fd51a82531457478b52d58d9498903b40 + 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/diagnostics - cb11e39fd51a82531457478b52d58d9498903b40 + 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 286df6ea0d5..d51ad1d1d68 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24324.3 - 8.0.0-preview.24325.1 - 8.0.0-preview.24325.1 + 8.0.0-preview.24326.1 + 8.0.0-preview.24326.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.532501 + 1.0.532601 $(MicrosoftNETCoreApp31Version) From ee7b2f52917da7a47ae64f24c15d4864171ffcfc Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:05:31 +0000 Subject: [PATCH 08/14] Update dependencies from https://github.com/dotnet/diagnostics build 20240627.1 (#6900) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f59c755ba53..8162694e888 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 + e009bfe09b92ef8d2064c4103f3cac85915b3ceb - + https://github.com/dotnet/diagnostics - 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 + e009bfe09b92ef8d2064c4103f3cac85915b3ceb https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade 3fe41d9e97519a4e9b48293906dbf58714ea9a0d - + https://github.com/dotnet/diagnostics - 24e70219872cf1f46c9e291bf110ee4baf9c9ba8 + e009bfe09b92ef8d2064c4103f3cac85915b3ceb https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index d51ad1d1d68..62967d3f127 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24324.3 - 8.0.0-preview.24326.1 - 8.0.0-preview.24326.1 + 8.0.0-preview.24327.1 + 8.0.0-preview.24327.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.532601 + 1.0.532701 $(MicrosoftNETCoreApp31Version) From eea5e09ab4290bfb1757a194762fd8ce593d1401 Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Fri, 28 Jun 2024 09:18:54 -0700 Subject: [PATCH 09/14] Update build asset staging to use managed identity (#6899) --- eng/pipelines/dotnet-monitor-compliance.yml | 2 - eng/pipelines/stages/preparerelease.yml | 57 +++++++++++------ .../Common/AzureBlobPublisher.cs | 63 +++++-------------- eng/release/DiagnosticsReleaseTool/Config.cs | 11 ++-- .../DiagnosticsReleaseCommandLine.cs | 5 +- .../DiagnosticsReleaseRunner.cs | 2 +- .../DiagnosticsReleaseTool.csproj | 17 ++--- eng/release/Directory.Build.props | 3 +- eng/release/Scripts/AcquireBuild.ps1 | 10 +-- 9 files changed, 71 insertions(+), 99 deletions(-) diff --git a/eng/pipelines/dotnet-monitor-compliance.yml b/eng/pipelines/dotnet-monitor-compliance.yml index e443bd43067..86caff41e50 100644 --- a/eng/pipelines/dotnet-monitor-compliance.yml +++ b/eng/pipelines/dotnet-monitor-compliance.yml @@ -71,8 +71,6 @@ extends: arguments: >- -BarBuildId "$(BuildBarId)" -AzdoToken "$(dn-bot-all-drop-rw-code-rw-release-all)" - -MaestroToken "$(MaestroAccessToken)" - -GitHubToken "$(BotAccount-dotnet-bot-repo-PAT)" -DownloadTargetPath "$(System.ArtifactsDirectory)\BuildAssets" -SasSuffixes "$(dotnetbuilds-internal-checksums-container-read-token),$(dotnetbuilds-internal-container-read-token)" -ReleaseVersion "$(BuildVersion)" diff --git a/eng/pipelines/stages/preparerelease.yml b/eng/pipelines/stages/preparerelease.yml index 6a728d15ebf..743f9aaf2d4 100644 --- a/eng/pipelines/stages/preparerelease.yml +++ b/eng/pipelines/stages/preparerelease.yml @@ -28,14 +28,18 @@ stages: packageType: runtime version: 6.x installationPath: '$(Build.Repository.LocalPath)\.dotnet' + - script: mkdir $(System.ArtifactsDirectory)\StagingToolLogs displayName: Create Staging Tool Logs Directory + - script: '$(Build.SourcesDirectory)\dotnet.cmd build $(Build.Repository.LocalPath)\eng\release\DiagnosticsReleaseTool\DiagnosticsReleaseTool.csproj -c Release /bl' workingDirectory: '$(System.ArtifactsDirectory)\StagingToolLogs' displayName: 'Build Staging Tool' + # Run tool for release and test release branches - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/test/release/'))) }}: - template: /eng/common/templates-official/post-build/setup-maestro-vars.yml@self + - task: PowerShell@2 displayName: Get Build Version inputs: @@ -44,42 +48,53 @@ stages: -BarId $(BARBuildId) -MaestroToken $(MaestroAccessToken) -TaskVariableName 'BuildVersion' - - task: PowerShell@2 + + - task: AzureCLI@2 displayName: 'Download Build Assets' inputs: - targetType: filePath - filePath: '$(Build.Repository.LocalPath)/eng/release/Scripts/AcquireBuild.ps1' + azureSubscription: 'Darc: Maestro Production' + scriptType: ps + scriptPath: '$(Build.Repository.LocalPath)/eng/release/Scripts/AcquireBuild.ps1' arguments: >- -BarBuildId "$(BARBuildId)" -AzdoToken "$(dn-bot-all-drop-rw-code-rw-release-all)" - -MaestroToken "$(MaestroAccessToken)" - -GitHubToken "$(BotAccount-dotnet-bot-repo-PAT)" -DownloadTargetPath "$(System.ArtifactsDirectory)\BuildAssets" -SasSuffixes "$(dotnetbuilds-internal-checksums-container-read-token),$(dotnetbuilds-internal-container-read-token)" -ReleaseVersion "$(Build.BuildNumber)" workingDirectory: '$(Build.Repository.LocalPath)' continueOnError: true - - script: >- - $(Build.SourcesDirectory)\dotnet.cmd run --project $(Build.Repository.LocalPath)\eng\release\DiagnosticsReleaseTool\DiagnosticsReleaseTool.csproj -c Release - -- - prepare-release - --input-drop-path "$(System.ArtifactsDirectory)\BuildAssets" - --tool-manifest "$(Build.Repository.LocalPath)\eng\release\tool-list.json" - --staging-directory "$(System.ArtifactsDirectory)\AssetsLayout" - --release-name "$(Build.BuildNumber)" - --build-version "$(BuildVersion)" - --account-name "$(dotnet-diagnostics-storage-accountname)" - --account-key "$(dotnetstage-storage-key)" - --sas-valid-days "$(dotnet-diagnostics-storage-retentiondays)" - -v True - workingDirectory: '$(System.ArtifactsDirectory)\StagingToolLogs' - displayName: 'Stage Build Assets and Manifest' + + - task: AzureCLI@2 + displayName: 'Manifest Generation and Asset Publishing' + inputs: + workingDirectory: '$(System.ArtifactsDirectory)\StagingToolLogs' + azureSubscription: 'dotnetstage-dotnet-monitor-rw' + scriptType: pscore + scriptLocation: inlineScript + addSpnToEnvironment: true + inlineScript: >- + $(Build.SourcesDirectory)\dotnet.cmd run + --project $(Build.Repository.LocalPath)\eng\release\DiagnosticsReleaseTool\DiagnosticsReleaseTool.csproj + -c Release + -- + prepare-release + --input-drop-path "$(System.ArtifactsDirectory)\BuildAssets" + --tool-manifest "$(Build.Repository.LocalPath)\eng\release\tool-list.json" + --staging-directory "$(System.ArtifactsDirectory)\AssetsLayout" + --release-name "$(Build.BuildNumber)" + --build-version "$(BuildVersion)" + --account-name "$(dotnet-diagnostics-storage-accountname)" + --container-name $(dotnet-monitor-container-name) + --client-id "$env:servicePrincipalId" + -v True + - template: /eng/pipelines/steps/publish-pipeline-artifact.yml@self parameters: displayName: 'Upload Assets Layout' targetPath: '$(System.ArtifactsDirectory)\AssetsLayout' artifact: 'StagingToolAssetsLayout' is1ESPipeline: ${{ parameters.is1ESPipeline }} + # Only tag build from real release branches - ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/test/release/')) }}: - task: Powershell@2 @@ -87,12 +102,14 @@ stages: inputs: targetType: inline script: Write-Host "##vso[build.addbuildtag]MonitorRelease" + - template: /eng/pipelines/steps/publish-pipeline-artifact.yml@self parameters: displayName: 'Upload Staging Tool Logs' targetPath: '$(System.ArtifactsDirectory)\StagingToolLogs' artifact: 'StagingToolLogs' is1ESPipeline: ${{ parameters.is1ESPipeline }} + - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - task: Powershell@2 displayName: 'Tag Build with update-docker' diff --git a/eng/release/DiagnosticsReleaseTool/Common/AzureBlobPublisher.cs b/eng/release/DiagnosticsReleaseTool/Common/AzureBlobPublisher.cs index 04becfb2293..945ac240ed8 100644 --- a/eng/release/DiagnosticsReleaseTool/Common/AzureBlobPublisher.cs +++ b/eng/release/DiagnosticsReleaseTool/Common/AzureBlobPublisher.cs @@ -1,10 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Azure.Storage; +using Azure.Core; +using Azure.Identity; using Azure.Storage.Blobs; using Azure.Storage.Blobs.Models; -using Azure.Storage.Sas; using Microsoft.Extensions.Logging; using System; using System.Buffers; @@ -17,17 +17,14 @@ namespace ReleaseTool.Core { public class AzureBlobBublisher : IPublisher { - private const int ClockSkewSec = 15 * 60; private const int MaxRetries = 15; private const int MaxFullLoopRetries = 5; private readonly TimeSpan FullLoopRetryDelay = TimeSpan.FromSeconds(1); - private const string AccessPolicyDownloadId = "DownloadDrop"; private readonly string _accountName; - private readonly string _accountKey; + private readonly string _clientId; private readonly string _containerName; private readonly string _buildVersion; - private readonly int _sasValidDays; private readonly ILogger _logger; private BlobContainerClient _client; @@ -40,12 +37,17 @@ private Uri AccountBlobUri } } - private StorageSharedKeyCredential AccountCredential + private TokenCredential Credentials { get { - StorageSharedKeyCredential credential = new StorageSharedKeyCredential(_accountName, _accountKey); - return credential; + if (_clientId == null) + { + // Local development scenario. Use the default credential. + return new DefaultAzureCredential(); + } + + return new DefaultAzureCredential(new DefaultAzureCredentialOptions { ManagedIdentityClientId = _clientId }); } } @@ -68,13 +70,12 @@ private BlobClientOptions BlobOptions } } - public AzureBlobBublisher(string accountName, string accountKey, string containerName, string buildVersion, int sasValidDays, ILogger logger) + public AzureBlobBublisher(string accountName, string clientId, string containerName, string buildVersion, ILogger logger) { _accountName = accountName; - _accountKey = accountKey; + _clientId = clientId; _containerName = containerName; _buildVersion = buildVersion; - _sasValidDays = sasValidDays; _logger = logger; } @@ -107,20 +108,11 @@ public async Task PublishFileAsync(FileMapping fileMap, CancellationToke await blobClient.UploadAsync(srcStream, overwrite: true, ct); - BlobSasBuilder sasBuilder = new BlobSasBuilder() - { - BlobContainerName = client.Name, - BlobName = blobClient.Name, - Identifier = AccessPolicyDownloadId, - Protocol = SasProtocol.Https - }; - Uri accessUri = blobClient.GenerateSasUri(sasBuilder); - using BlobDownloadStreamingResult blobStream = (await blobClient.DownloadStreamingAsync(cancellationToken: ct)).Value; srcStream.Position = 0; completed = await VerifyFileStreamsMatchAsync(srcStream, blobStream, ct); - result = accessUri; + result = blobClient.Uri; } catch (IOException ioEx) when (!(ioEx is PathTooLongException)) { @@ -155,7 +147,7 @@ private async Task GetClient(CancellationToken ct) { if (_client == null) { - BlobServiceClient serviceClient = new BlobServiceClient(AccountBlobUri, AccountCredential, BlobOptions); + BlobServiceClient serviceClient = new BlobServiceClient(AccountBlobUri, Credentials, BlobOptions); _logger.LogInformation($"Attempting to connect to {serviceClient.Uri} to store blobs."); BlobContainerClient newClient; @@ -176,31 +168,6 @@ private async Task GetClient(CancellationToken ct) continue; } - try - { - DateTime baseTime = DateTime.UtcNow; - // Add the new (or update existing) "download" policy to the container - // This is used to mint the SAS tokens without an expiration policy - // Expiration can be added later by modifying this policy - BlobSignedIdentifier downloadPolicyIdentifier = new BlobSignedIdentifier() - { - Id = AccessPolicyDownloadId, - AccessPolicy = new BlobAccessPolicy() - { - Permissions = "r", - PolicyStartsOn = new DateTimeOffset(baseTime.AddSeconds(-ClockSkewSec)), - PolicyExpiresOn = new DateTimeOffset(DateTime.UtcNow.AddDays(_sasValidDays).AddSeconds(ClockSkewSec)), - } - }; - _logger.LogInformation($"Writing download access policy: {AccessPolicyDownloadId} to {_containerName}."); - await newClient.SetAccessPolicyAsync(PublicAccessType.None, new BlobSignedIdentifier[] { downloadPolicyIdentifier }, cancellationToken: ct); - } - catch (Exception ex) - { - _logger.LogWarning(ex, $"Failed to write access policy for {_containerName}, retrying."); - continue; - } - _logger.LogInformation($"Container {_containerName} is ready."); _client = newClient; break; diff --git a/eng/release/DiagnosticsReleaseTool/Config.cs b/eng/release/DiagnosticsReleaseTool/Config.cs index 637fda3a393..475b84c8188 100644 --- a/eng/release/DiagnosticsReleaseTool/Config.cs +++ b/eng/release/DiagnosticsReleaseTool/Config.cs @@ -14,9 +14,8 @@ internal class Config public string ReleaseName { get; } public string BuildVersion { get; } public string AccountName { get; } - public string AccountKey { get; } + public string ClientId { get; } public string ContainerName { get; } - public int SasValidDays { get; } public Config( FileInfo toolManifest, @@ -26,9 +25,8 @@ public Config( string releaseName, string buildVersion, string accountName, - string accountKey, - string containerName, - int sasValidDays) + string clientId, + string containerName) { ToolManifest = toolManifest; ShouldVerifyManifest = verifyToolManifest; @@ -37,9 +35,8 @@ public Config( ReleaseName = releaseName; BuildVersion = buildVersion; AccountName = accountName; - AccountKey = accountKey; + ClientId = clientId; ContainerName = containerName; - SasValidDays = sasValidDays; } } } diff --git a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseCommandLine.cs b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseCommandLine.cs index 06072d77a3e..5884f3a3cb6 100644 --- a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseCommandLine.cs +++ b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseCommandLine.cs @@ -107,8 +107,9 @@ private static Option AzureStorageAccountNameOption() => private static Option AzureStorageAccountKeyOption() => new Option( - aliases: new[] { "-k", "--account-key" }, - description: "Storage account key, in base 64 format.") + aliases: new[] { "-k", "--client-id" }, + description: "Identity Client ID. If left blank, ambient identity will be used.", + getDefaultValue: () => null) { IsRequired = true, }; diff --git a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseRunner.cs b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseRunner.cs index 3ecfa62f936..e9024d55d48 100644 --- a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseRunner.cs +++ b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseRunner.cs @@ -49,7 +49,7 @@ internal async static Task PrepareRelease(Config releaseConfig, bool verbos IPublisher releasePublisher = dryRun ? new SkipPublisher() : - new AzureBlobBublisher(releaseConfig.AccountName, releaseConfig.AccountKey, releaseConfig.ContainerName, releaseConfig.BuildVersion, releaseConfig.SasValidDays, logger); + new AzureBlobBublisher(releaseConfig.AccountName, releaseConfig.ClientId, releaseConfig.ContainerName, releaseConfig.BuildVersion, logger); IManifestGenerator manifestGenerator = new DiagnosticsManifestGenerator(releaseMetadata, releaseConfig.ToolManifest, logger); using var diagnosticsRelease = new Release( diff --git a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseTool.csproj b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseTool.csproj index fc0720a3fb5..336e0567bce 100644 --- a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseTool.csproj +++ b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseTool.csproj @@ -13,15 +13,16 @@ - - - - - - + + + + + + - - + + + diff --git a/eng/release/Directory.Build.props b/eng/release/Directory.Build.props index a8133bfcf5e..100d8a4ebf8 100644 --- a/eng/release/Directory.Build.props +++ b/eng/release/Directory.Build.props @@ -1,4 +1,3 @@ - - + \ No newline at end of file diff --git a/eng/release/Scripts/AcquireBuild.ps1 b/eng/release/Scripts/AcquireBuild.ps1 index b76c6279a09..220c6ff13fd 100644 --- a/eng/release/Scripts/AcquireBuild.ps1 +++ b/eng/release/Scripts/AcquireBuild.ps1 @@ -4,9 +4,6 @@ param( [Parameter(Mandatory=$true)][string] $DownloadTargetPath, [Parameter(Mandatory=$true)][string] $SasSuffixes, [Parameter(Mandatory=$true)][string] $AzdoToken, - [Parameter(Mandatory=$true)][string] $MaestroToken, - [Parameter(Mandatory=$true)][string] $GitHubToken, - [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', [Parameter(Mandatory=$false)][string] $DarcVersion = $null, [Parameter(Mandatory=$false)][bool] $Separated = $true, [switch] $help, @@ -19,9 +16,6 @@ function Write-Help() { Write-Host " -DownloadTargetPath Path to download the build to." Write-Host " -SasSuffixes Comma separated list of potential uri suffixes that can be used if anonymous access to a blob uri fails. Appended directly to the end of the URI. Use full SAS syntax with ?." Write-Host " -AzdoToken Azure DevOps token to use for builds queries" - Write-Host " -MaestroToken Maestro token to use for querying BAR" - Write-Host " -GitHubToken GitHub token to use for querying repository information" - Write-Host " -MaestroApiEndPoint BAR endpoint to use for build queries." Write-Host " -Separated <`$true|`$false> Download files to their repo separated locations." Write-Host "" } @@ -62,12 +56,10 @@ try { --output-dir $DownloadTargetPath ` --overwrite ` --sas-suffixes $SasSuffixes ` - --github-pat $GitHubToken ` --azdev-pat $AzdoToken ` - --bar-uri $MaestroApiEndPoint ` - --password $MaestroToken ` --verbose ` --continue-on-error ` + --ci ` $separatedArgs if ($LastExitCode -ne 0) { From 4404dcc5ca400479b7f9501f6ffda22883c48226 Mon Sep 17 00:00:00 2001 From: Joe Schmitt <1146681+schmittjoseph@users.noreply.github.com> Date: Fri, 28 Jun 2024 10:06:48 -0700 Subject: [PATCH 10/14] Use managed identity to publish release assets (#6898) --- eng/pipelines/dotnet-monitor-release.yml | 53 ++++++++----------- eng/release/Scripts/PublishToBlobAccounts.ps1 | 53 ++++--------------- 2 files changed, 31 insertions(+), 75 deletions(-) diff --git a/eng/pipelines/dotnet-monitor-release.yml b/eng/pipelines/dotnet-monitor-release.yml index 4e31668eb9d..2dec67a9cc8 100644 --- a/eng/pipelines/dotnet-monitor-release.yml +++ b/eng/pipelines/dotnet-monitor-release.yml @@ -70,7 +70,7 @@ extends: -BarId $(BarId) -MaestroToken $(MaestroAccessToken) -TaskVariableName 'ReleaseVersion' - + - task: PowerShell@2 displayName: Get Build Version inputs: @@ -107,10 +107,15 @@ extends: variables: - ${{ if eq(parameters.IsTestRun, 'true') }}: - - group: DotNet-Diagnostics-Storage-Test + - name: DestinationAccountName + value: monitortestcli + - name: ChecksumsAccountName + value: monitortestchecksums - ${{ else }}: - - group: DotNetCli storage account tokens - - group: DotNet-DotNetStage-Storage + - name: DestinationAccountName + value: dotnetcli + - name: ChecksumsAccountName + value: dotnetclichecksums workspace: clean: all @@ -164,42 +169,28 @@ extends: - powershell: Install-Module Az.Storage -Force -Scope CurrentUser -AllowClobber -Verbose -RequiredVersion 5.10.1 displayName: Install Az.Storage Module 5.10.1 - - powershell: | - Write-Host "##vso[task.setvariable variable=DestinationAccountName]$env:DESTINATION_ACCOUNT_NAME" - Write-Host "##vso[task.setvariable variable=DestinationSasTokenBase64;issecret=true]$env:DESTINATION_SAS_TOKEN_BASE64" - Write-Host "##vso[task.setvariable variable=ChecksumsAccountName]$env:CHECKSUMS_ACCOUNT_NAME" - Write-Host "##vso[task.setvariable variable=ChecksumsSasTokenBase64;issecret=true]$env:CHECKSUMS_SAS_TOKEN_BASE64" - displayName: Set Storage Accounts - ${{ if eq(parameters.IsTestRun, 'true') }}: - env: - # Variables provided by DotNet-Diagnostics-Storage-Test group - DESTINATION_ACCOUNT_NAME: $(dotnet-monitor-test-storage-accountname) - DESTINATION_SAS_TOKEN_BASE64: $(dotnet-monitor-test-blob-write-token-base64) - CHECKSUMS_ACCOUNT_NAME: $(dotnet-monitor-checksums-test-storage-accountname) - CHECKSUMS_SAS_TOKEN_BASE64: $(dotnet-monitor-checksums-test-blob-write-token-base64) - ${{ else }}: - env: - # Variables provided by "DotNetCli storage account tokens" group - DESTINATION_ACCOUNT_NAME: dotnetcli - DESTINATION_SAS_TOKEN_BASE64: $(dotnetcli-account-blob-write-token-base64) - CHECKSUMS_ACCOUNT_NAME: dotnetclichecksums - CHECKSUMS_SAS_TOKEN_BASE64: $(dotnetclichecksums-account-blob-write-token-base64) - - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Assets inputs: - filePath: $(Build.SourcesDirectory)/eng/release/Scripts/PublishToBlobAccounts.ps1 + # It seems that azureSubscription can't use runtime expressions, so we need to use a compile time expression + # to set it. + ${{ if eq(parameters.IsTestRun, 'true') }}: + azureSubscription: dotnet-monitor-test-publish + ${{ else }}: + azureSubscription: dotnet-monitor-cli-storage-accounts-publish + # Save the service principal details to the environment so that azcopy can use them + addSpnToEnvironment: true + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/release/Scripts/PublishToBlobAccounts.ps1 arguments: >- -AzCopyPath $(AzCopyPath) -BuildVersion $(BuildVersion) -ReleaseVersion $(ReleaseVersion) - -DotnetStageAccountKey $(dotnetstage-storage-key) -DestinationAccountName $(DestinationAccountName) - -DestinationSasTokenBase64 $(DestinationSasTokenBase64) -ChecksumsAccountName $(ChecksumsAccountName) - -ChecksumsSasTokenBase64 $(ChecksumsSasTokenBase64) -WhatIf:${{ format('${0}', parameters.IsDryRun) }} - + - task: 1ES.PublishBuildArtifacts@1 displayName: Publish Logs inputs: diff --git a/eng/release/Scripts/PublishToBlobAccounts.ps1 b/eng/release/Scripts/PublishToBlobAccounts.ps1 index 4e0313a464b..19e418a677f 100644 --- a/eng/release/Scripts/PublishToBlobAccounts.ps1 +++ b/eng/release/Scripts/PublishToBlobAccounts.ps1 @@ -3,23 +3,20 @@ Param( [Parameter(Mandatory=$true)][string]$AzCopyPath, [Parameter(Mandatory=$true)][string]$BuildVersion, [Parameter(Mandatory=$true)][string]$ReleaseVersion, - [Parameter(Mandatory=$true)][string]$DotnetStageAccountKey, [Parameter(Mandatory=$true)][string]$DestinationAccountName, - [Parameter(Mandatory=$true)][string]$DestinationSasTokenBase64, - [Parameter(Mandatory=$true)][string]$ChecksumsAccountName, - [Parameter(Mandatory=$true)][string]$ChecksumsSasTokenBase64 + [Parameter(Mandatory=$true)][string]$ChecksumsAccountName ) $ErrorActionPreference = 'Stop' Set-StrictMode -Version 2.0 +# Use the OAuth token that was obtained by the az cli when it logged in. +$Env:AZCOPY_AUTO_LOGIN_TYPE="AZCLI" + $sourceAccountName = 'dotnetstage' $sourceContainerName = 'dotnet-monitor' $destinationContainerName = 'dotnet' -$destinationSasToken = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($DestinationSasTokenBase64)) -$checksumsSasToken = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($ChecksumsSasTokenBase64)) - function Generate-Source-Uri{ [CmdletBinding()] Param( @@ -38,34 +35,11 @@ function Generate-Destination-Uri{ return "https://$AccountName.blob.core.windows.net/$destinationContainerName/diagnostics/monitor/$ReleaseVersion" } -function Generate-Sas-Token{ - [CmdletBinding()] - Param( - [Parameter(Mandatory=$true)][string]$StorageAccountName, - [Parameter(Mandatory=$true)][string]$ContainerName, - [Parameter(Mandatory=$true)][string]$AccountKey, - [Parameter(Mandatory=$true)][string]$Permissions - ) - - $context = New-AzStorageContext ` - -StorageAccountName $StorageAccountName ` - -StorageAccountKey $AccountKey - - return New-AzStorageContainerSASToken ` - -Container $ContainerName ` - -Context $context ` - -Permission $Permissions ` - -StartTime (Get-Date).AddMinutes(-15.0) ` - -ExpiryTime (Get-Date).AddHours(1.0) -} - function Transfer-File{ [CmdletBinding(SupportsShouldProcess)] Param( [Parameter(Mandatory=$true)][string]$From, - [Parameter(Mandatory=$true)][string]$To, - [Parameter(Mandatory=$true)][string]$FromToken, - [Parameter(Mandatory=$true)][string]$ToToken + [Parameter(Mandatory=$true)][string]$To ) Write-Host "Copy $From -> $To" @@ -73,8 +47,8 @@ function Transfer-File{ if ($From -eq $to) { Write-Host 'Skipping copy because source and destination are the same.' } else { - [array]$azCopyArgs = "$From$FromToken" - $azCopyArgs += "$To$ToToken" + [array]$azCopyArgs = "$From" + $azCopyArgs += "$To" $azCopyArgs += "--s2s-preserve-properties" $azCopyArgs += "--s2s-preserve-access-tier=false" if ($WhatIfPreference) { @@ -84,14 +58,9 @@ function Transfer-File{ } } -# Create source URI and SAS token +# Create source URI $sourceUri = Generate-Source-Uri ` -AssetType 'Blob' -$soureSasToken = Generate-Sas-Token ` - -StorageAccountName $sourceAccountName ` - -ContainerName $sourceContainerName ` - -AccountKey $DotnetStageAccountKey ` - -Permissions 'rl' # Create destination URI $destinationUri = Generate-Destination-Uri ` @@ -100,9 +69,7 @@ $destinationUri = Generate-Destination-Uri ` # Copy files to destination account Transfer-File ` -From $sourceUri ` - -FromToken $soureSasToken ` -To $destinationUri ` - -ToToken $destinationSasToken ` -WhatIf:$WhatIfPreference # Create source checksums URI @@ -116,7 +83,5 @@ $checksumsDestinationUri = Generate-Destination-Uri ` # Copy checksums to checksum account Transfer-File ` -From $checksumsSourceUri ` - -FromToken $soureSasToken ` -To $checksumsDestinationUri ` - -ToToken $checksumsSasToken ` - -WhatIf:$WhatIfPreference \ No newline at end of file + -WhatIf:$WhatIfPreference From 4c0a2ae377050c6573dba06a83bbb98d5584cb00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 18:00:09 +0000 Subject: [PATCH 11/14] [main] Bump Microsoft.Diagnostics.DbgShim in /eng/dependabot/nuget.org (#6905) Bumps [Microsoft.Diagnostics.DbgShim](https://github.com/dotnet/diagnostics) from 8.0.510501 to 8.0.532401. - [Release notes](https://github.com/dotnet/diagnostics/releases) - [Commits](https://github.com/dotnet/diagnostics/compare/v8.0.510501...v8.0.532401) --- updated-dependencies: - dependency-name: Microsoft.Diagnostics.DbgShim dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- eng/dependabot/nuget.org/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/dependabot/nuget.org/Versions.props b/eng/dependabot/nuget.org/Versions.props index 285eba92209..44806cae084 100644 --- a/eng/dependabot/nuget.org/Versions.props +++ b/eng/dependabot/nuget.org/Versions.props @@ -2,6 +2,6 @@ - 8.0.510501 + 8.0.532401 From dc25f21858ea590c459419293f4a1aef6efc8125 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 29 Jun 2024 12:53:35 +0000 Subject: [PATCH 12/14] Update dependencies from https://github.com/dotnet/arcade build 20240626.4 (#6908) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 6 +++--- global.json | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8162694e888..d76270ee5a1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -22,29 +22,29 @@ https://github.com/dotnet/roslyn-analyzers b4d9a1334d5189172977ba8fddd00bda70161e4a - + https://github.com/dotnet/arcade - 3fe41d9e97519a4e9b48293906dbf58714ea9a0d + bee35f3044609d08c40566f8a008baa4d0451a9e - + https://github.com/dotnet/arcade - 3fe41d9e97519a4e9b48293906dbf58714ea9a0d + bee35f3044609d08c40566f8a008baa4d0451a9e - + https://github.com/dotnet/arcade - 3fe41d9e97519a4e9b48293906dbf58714ea9a0d + bee35f3044609d08c40566f8a008baa4d0451a9e - + https://github.com/dotnet/arcade - 3fe41d9e97519a4e9b48293906dbf58714ea9a0d + bee35f3044609d08c40566f8a008baa4d0451a9e https://github.com/dotnet/installer 68e8abb1d3e1a240a6e4c29dcd220aae91681676 - + https://github.com/dotnet/arcade - 3fe41d9e97519a4e9b48293906dbf58714ea9a0d + bee35f3044609d08c40566f8a008baa4d0451a9e https://github.com/dotnet/diagnostics diff --git a/eng/Versions.props b/eng/Versions.props index 62967d3f127..80374cfabbd 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -48,9 +48,9 @@ --> - 8.0.0-beta.24324.7 - 8.0.0-beta.24324.7 - 8.0.0-beta.24324.7 + 8.0.0-beta.24326.4 + 8.0.0-beta.24326.4 + 8.0.0-beta.24326.4 8.0.1 8.0.1-servicing.23580.8 diff --git a/global.json b/global.json index a01e14d61e2..380a28a72cd 100644 --- a/global.json +++ b/global.json @@ -26,7 +26,7 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24324.7", - "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24324.7" + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24326.4", + "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24326.4" } } From b5bf953026d47318e521e5580524866ef0aab764 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 12:57:12 +0000 Subject: [PATCH 13/14] Update dependencies from https://github.com/dotnet/diagnostics build 20240628.1 (#6911) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 12 ++++++------ eng/Versions.props | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d76270ee5a1..a60a5e0ee2b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore 8e941eb42f819adb116b881195158b3887a70a1c - + https://github.com/dotnet/diagnostics - e009bfe09b92ef8d2064c4103f3cac85915b3ceb + 36353b20e53e0c4af482e4fbe1d0a572515f14a2 - + https://github.com/dotnet/diagnostics - e009bfe09b92ef8d2064c4103f3cac85915b3ceb + 36353b20e53e0c4af482e4fbe1d0a572515f14a2 https://github.com/dotnet/command-line-api @@ -46,9 +46,9 @@ https://github.com/dotnet/arcade bee35f3044609d08c40566f8a008baa4d0451a9e - + https://github.com/dotnet/diagnostics - e009bfe09b92ef8d2064c4103f3cac85915b3ceb + 36353b20e53e0c4af482e4fbe1d0a572515f14a2 https://dev.azure.com/dnceng/internal/_git/dotnet-runtime diff --git a/eng/Versions.props b/eng/Versions.props index 80374cfabbd..be88abc4387 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -57,8 +57,8 @@ 2.0.0-beta4.24324.3 - 8.0.0-preview.24327.1 - 8.0.0-preview.24327.1 + 8.0.0-preview.24328.1 + 8.0.0-preview.24328.1 8.0.103-servicing.24114.15 @@ -67,7 +67,7 @@ 8.0.1 8.0.1-servicing.23580.1 - 1.0.532701 + 1.0.532801 $(MicrosoftNETCoreApp31Version) From fd08b35b6ba6079a6082b97bad60acbf1eab8f08 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 00:08:45 +0000 Subject: [PATCH 14/14] Restore branch-specific files --- .../job/publish-build-assets.yml | 124 +------------ .../post-build/post-build.yml | 174 +----------------- .../templates/job/publish-build-assets.yml | 120 +----------- .../templates/post-build/post-build.yml | 173 +---------------- .../post-build/setup-maestro-vars.yml | 59 +----- 5 files changed, 10 insertions(+), 640 deletions(-) diff --git a/eng/common/templates-official/job/publish-build-assets.yml b/eng/common/templates-official/job/publish-build-assets.yml index 9ea50856209..d667a70e8de 100644 --- a/eng/common/templates-official/job/publish-build-assets.yml +++ b/eng/common/templates-official/job/publish-build-assets.yml @@ -3,125 +3,5 @@ jobs: parameters: is1ESPipeline: true - dependsOn: ${{ parameters.dependsOn }} - timeoutInMinutes: 150 - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - displayName: Publish Assets - ${{ else }}: - displayName: Publish to Build Asset Registry - - variables: - - template: /eng/common/templates-official/variables/pool-providers.yml - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - group: Publish-Build-Assets - - group: AzureDevOps-Artifact-Feeds-Pats - - name: runCodesignValidationInjection - value: false - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - - template: /eng/common/templates-official/post-build/common-variables.yml - - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: AzurePipelines-EO - image: 1ESPT-Windows2022 - demands: Cmd - os: windows - # If it's not devdiv, it's dnceng - ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: - name: NetCore1ESPool-Publishing-Internal - image: windows.vs2019.amd64 - os: windows - steps: - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: DownloadBuildArtifacts@0 - displayName: Download artifact - inputs: - artifactName: AssetManifests - downloadPath: '$(Build.StagingDirectory)/Download' - checkDownloadedFiles: true - condition: ${{ parameters.condition }} - continueOnError: ${{ parameters.continueOnError }} - - - task: NuGetAuthenticate@1 - - - task: AzureCLI@2 - displayName: Publish Build Assets - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: ps - scriptLocation: scriptPath - scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 - arguments: > - -task PublishBuildAssets -restore -msbuildEngine dotnet - /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com - /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} - /p:OfficialBuildId=$(Build.BuildNumber) - condition: ${{ parameters.condition }} - continueOnError: ${{ parameters.continueOnError }} - - - task: powershell@2 - displayName: Create ReleaseConfigs Artifact - inputs: - targetType: inline - script: | - New-Item -Path "$(Build.StagingDirectory)/ReleaseConfigs" -ItemType Directory -Force - $filePath = "$(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt" - Add-Content -Path $filePath -Value $(BARBuildId) - Add-Content -Path $filePath -Value "$(DefaultChannels)" - Add-Content -Path $filePath -Value $(IsStableBuild) - - - task: 1ES.PublishBuildArtifacts@1 - displayName: Publish ReleaseConfigs Artifact - inputs: - PathtoPublish: '$(Build.StagingDirectory)/ReleaseConfigs' - PublishLocation: Container - ArtifactName: ReleaseConfigs - - - task: powershell@2 - displayName: Check if SymbolPublishingExclusionsFile.txt exists - inputs: - targetType: inline - script: | - $symbolExclusionfile = "$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt" - if(Test-Path -Path $symbolExclusionfile) - { - Write-Host "SymbolExclusionFile exists" - Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]true" - } - else{ - Write-Host "Symbols Exclusion file does not exists" - Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]false" - } - - - task: 1ES.PublishBuildArtifacts@1 - displayName: Publish SymbolPublishingExclusionsFile Artifact - condition: eq(variables['SymbolExclusionFile'], 'true') - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' - PublishLocation: Container - ArtifactName: ReleaseConfigs - - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - - template: /eng/common/templates-official/post-build/setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: PowerShell@2 - displayName: Publish Using Darc - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) - -PublishingInfraVersion 3 - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -WaitPublishingFinish true - -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' - -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' - - - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: - - template: /eng/common/templates-official/steps/publish-logs.yml - parameters: - JobLabel: 'Publish_Artifacts_Logs' + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates-official/post-build/post-build.yml b/eng/common/templates-official/post-build/post-build.yml index 563484310aa..2364c0fd4a5 100644 --- a/eng/common/templates-official/post-build/post-build.yml +++ b/eng/common/templates-official/post-build/post-build.yml @@ -4,175 +4,5 @@ stages: # Specifies whether to use 1ES is1ESPipeline: true - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true - - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1 - arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ - -ToolDestinationPath $(Agent.BuildDirectory)/Extract/ - - - job: - displayName: Signing Validation - condition: and( eq( ${{ parameters.enableSigningValidation }}, 'true'), ne( variables['PostBuildSign'], 'true')) - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: AzurePipelines-EO - image: 1ESPT-Windows2022 - demands: Cmd - os: windows - # If it's not devdiv, it's dnceng - ${{ else }}: - name: $(DncEngInternalBuildPool) - image: 1es-windows-2022 - os: windows - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true - itemPattern: | - ** - !**/Microsoft.SourceBuild.Intermediate.*.nupkg - - # This is necessary whenever we want to publish/restore to an AzDO private feed - # Since sdk-task.ps1 tries to restore packages we need to do this authentication here - # otherwise it'll complain about accessing a private feed. - - task: NuGetAuthenticate@1 - displayName: 'Authenticate to AzDO Feeds' - - # Signing validation will optionally work with the buildmanifest file which is downloaded from - # Azure DevOps above. - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task SigningValidation -restore -msbuildEngine vs - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' - /p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt' - ${{ parameters.signingValidationAdditionalParameters }} - - - template: ../steps/publish-logs.yml - parameters: - StageLabel: 'Validation' - JobLabel: 'Signing' - BinlogToolVersion: $(BinlogToolVersion) - - - job: - displayName: SourceLink Validation - condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true') - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: AzurePipelines-EO - image: 1ESPT-Windows2022 - demands: Cmd - os: windows - # If it's not devdiv, it's dnceng - ${{ else }}: - name: $(DncEngInternalBuildPool) - image: 1es-windows-2022 - os: windows - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Blob Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: BlobArtifacts - checkDownloadedFiles: true - - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1 - arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/ - -ExtractPath $(Agent.BuildDirectory)/Extract/ - -GHRepoName $(Build.Repository.Name) - -GHCommit $(Build.SourceVersion) - -SourcelinkCliVersion $(SourceLinkCLIVersion) - continueOnError: true - -- ${{ if ne(parameters.publishAssetsImmediately, 'true') }}: - - stage: publish_using_darc - ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: - dependsOn: ${{ parameters.publishDependsOn }} - ${{ else }}: - dependsOn: ${{ parameters.validateDependsOn }} - displayName: Publish using Darc - variables: - - template: common-variables.yml - - template: /eng/common/templates-official/variables/pool-providers.yml - jobs: - - job: - displayName: Publish Using Darc - timeoutInMinutes: 120 - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: AzurePipelines-EO - image: 1ESPT-Windows2022 - demands: Cmd - os: windows - # If it's not devdiv, it's dnceng - ${{ else }}: - name: NetCore1ESPool-Publishing-Internal - image: windows.vs2019.amd64 - os: windows - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: NuGetAuthenticate@1 - - - task: AzureCLI@2 - displayName: Publish Using Darc - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: ps - scriptLocation: scriptPath - scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) - -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -WaitPublishingFinish true - -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' - -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index 604856e2bb5..ab2edec2adb 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -3,121 +3,5 @@ jobs: parameters: is1ESPipeline: false - dependsOn: ${{ parameters.dependsOn }} - timeoutInMinutes: 150 - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - displayName: Publish Assets - ${{ else }}: - displayName: Publish to Build Asset Registry - - variables: - - template: /eng/common/templates/variables/pool-providers.yml - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - group: Publish-Build-Assets - - group: AzureDevOps-Artifact-Feeds-Pats - - name: runCodesignValidationInjection - value: false - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - - template: /eng/common/templates/post-build/common-variables.yml - - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: VSEngSS-MicroBuild2022-1ES - demands: Cmd - # If it's not devdiv, it's dnceng - ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: - name: NetCore1ESPool-Publishing-Internal - demands: ImageOverride -equals windows.vs2019.amd64 - - steps: - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: DownloadBuildArtifacts@0 - displayName: Download artifact - inputs: - artifactName: AssetManifests - downloadPath: '$(Build.StagingDirectory)/Download' - checkDownloadedFiles: true - condition: ${{ parameters.condition }} - continueOnError: ${{ parameters.continueOnError }} - - - task: NuGetAuthenticate@1 - - - task: AzureCLI@2 - displayName: Publish Build Assets - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: ps - scriptLocation: scriptPath - scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 - arguments: > - -task PublishBuildAssets -restore -msbuildEngine dotnet - /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:MaestroApiEndpoint=https://maestro.dot.net - /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} - /p:OfficialBuildId=$(Build.BuildNumber) - condition: ${{ parameters.condition }} - continueOnError: ${{ parameters.continueOnError }} - - - task: powershell@2 - displayName: Create ReleaseConfigs Artifact - inputs: - targetType: inline - 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 $(IsStableBuild) - - - task: PublishBuildArtifacts@1 - displayName: Publish ReleaseConfigs Artifact - inputs: - PathtoPublish: '$(Build.StagingDirectory)/ReleaseConfigs.txt' - PublishLocation: Container - ArtifactName: ReleaseConfigs - - - task: powershell@2 - displayName: Check if SymbolPublishingExclusionsFile.txt exists - inputs: - targetType: inline - script: | - $symbolExclusionfile = "$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt" - if(Test-Path -Path $symbolExclusionfile) - { - Write-Host "SymbolExclusionFile exists" - Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]true" - } - else{ - Write-Host "Symbols Exclusion file does not exists" - Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]false" - } - - - task: PublishBuildArtifacts@1 - displayName: Publish SymbolPublishingExclusionsFile Artifact - condition: eq(variables['SymbolExclusionFile'], 'true') - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' - PublishLocation: Container - ArtifactName: ReleaseConfigs - - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: - - template: /eng/common/templates/post-build/setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: PowerShell@2 - displayName: Publish Using Darc - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) - -PublishingInfraVersion 3 - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -WaitPublishingFinish true - -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' - -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' - - - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: - - template: /eng/common/templates/steps/publish-logs.yml - parameters: - JobLabel: 'Publish_Artifacts_Logs' + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index 732b91b12ae..53ede714bdd 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -4,174 +4,5 @@ stages: # Specifies whether to use 1ES is1ESPipeline: false - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true - - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1 - arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ - -ToolDestinationPath $(Agent.BuildDirectory)/Extract/ - - - job: - displayName: Signing Validation - condition: and( eq( ${{ parameters.enableSigningValidation }}, 'true'), ne( variables['PostBuildSign'], 'true')) - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: VSEngSS-MicroBuild2022-1ES - demands: Cmd - # If it's not devdiv, it's dnceng - ${{ else }}: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2019.amd64 - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Package Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: PackageArtifacts - checkDownloadedFiles: true - itemPattern: | - ** - !**/Microsoft.SourceBuild.Intermediate.*.nupkg - - # This is necessary whenever we want to publish/restore to an AzDO private feed - # Since sdk-task.ps1 tries to restore packages we need to do this authentication here - # otherwise it'll complain about accessing a private feed. - - task: NuGetAuthenticate@1 - displayName: 'Authenticate to AzDO Feeds' - - # Signing validation will optionally work with the buildmanifest file which is downloaded from - # Azure DevOps above. - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: eng\common\sdk-task.ps1 - arguments: -task SigningValidation -restore -msbuildEngine vs - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' - /p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt' - ${{ parameters.signingValidationAdditionalParameters }} - - - template: ../steps/publish-logs.yml - parameters: - StageLabel: 'Validation' - JobLabel: 'Signing' - - - job: - displayName: SourceLink Validation - condition: eq( ${{ parameters.enableSourceLinkValidation }}, 'true') - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: VSEngSS-MicroBuild2022-1ES - demands: Cmd - # If it's not devdiv, it's dnceng - ${{ else }}: - name: $(DncEngInternalBuildPool) - demands: ImageOverride -equals windows.vs2019.amd64 - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: DownloadBuildArtifacts@0 - displayName: Download Blob Artifacts - inputs: - buildType: specific - buildVersionToDownload: specific - project: $(AzDOProjectName) - pipeline: $(AzDOPipelineId) - buildId: $(AzDOBuildId) - artifactName: BlobArtifacts - checkDownloadedFiles: true - - - task: PowerShell@2 - displayName: Validate - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1 - arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/ - -ExtractPath $(Agent.BuildDirectory)/Extract/ - -GHRepoName $(Build.Repository.Name) - -GHCommit $(Build.SourceVersion) - -SourcelinkCliVersion $(SourceLinkCLIVersion) - continueOnError: true - - - template: /eng/common/templates/job/execute-sdl.yml - parameters: - enable: ${{ parameters.SDLValidationParameters.enable }} - publishGuardianDirectoryToPipeline: ${{ parameters.SDLValidationParameters.publishGdn }} - additionalParameters: ${{ parameters.SDLValidationParameters.params }} - continueOnError: ${{ parameters.SDLValidationParameters.continueOnError }} - artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }} - downloadArtifacts: ${{ parameters.SDLValidationParameters.downloadArtifacts }} - -- ${{ if ne(parameters.publishAssetsImmediately, 'true') }}: - - stage: publish_using_darc - ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: - dependsOn: ${{ parameters.publishDependsOn }} - ${{ else }}: - dependsOn: ${{ parameters.validateDependsOn }} - displayName: Publish using Darc - variables: - - template: common-variables.yml - - template: /eng/common/templates/variables/pool-providers.yml - jobs: - - job: - displayName: Publish Using Darc - timeoutInMinutes: 120 - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: VSEngSS-MicroBuild2022-1ES - demands: Cmd - # If it's not devdiv, it's dnceng - ${{ else }}: - name: NetCore1ESPool-Publishing-Internal - demands: ImageOverride -equals windows.vs2019.amd64 - steps: - - template: setup-maestro-vars.yml - parameters: - BARBuildId: ${{ parameters.BARBuildId }} - PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - - task: NuGetAuthenticate@1 - - - task: AzureCLI@2 - displayName: Publish Using Darc - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: ps - scriptLocation: scriptPath - scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) - -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -WaitPublishingFinish true - -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' - -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/eng/common/templates/post-build/setup-maestro-vars.yml b/eng/common/templates/post-build/setup-maestro-vars.yml index df06c91d4e3..a79fab5b441 100644 --- a/eng/common/templates/post-build/setup-maestro-vars.yml +++ b/eng/common/templates/post-build/setup-maestro-vars.yml @@ -4,60 +4,5 @@ steps: # Specifies whether to use 1ES is1ESPipeline: false - - task: AzureCLI@2 - name: setReleaseVars - displayName: Set Release Configs Vars - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: pscore - scriptLocation: inlineScript - inlineScript: | - try { - if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { - $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt - - $BarId = $Content | Select -Index 0 - $Channels = $Content | Select -Index 1 - $IsStableBuild = $Content | Select -Index 2 - - $AzureDevOpsProject = $Env:System_TeamProject - $AzureDevOpsBuildDefinitionId = $Env:System_DefinitionId - $AzureDevOpsBuildId = $Env:Build_BuildId - } - else { - . $(Build.SourcesDirectory)\eng\common\tools.ps1 - $darc = Get-Darc - $buildInfo = & $darc get-build ` - --id ${{ parameters.BARBuildId }} ` - --extended ` - --output-format json ` - --ci ` - | convertFrom-Json - - $BarId = ${{ parameters.BARBuildId }} - $Channels = $Env:PromoteToMaestroChannels -split "," - $Channels = $Channels -join "][" - $Channels = "[$Channels]" - - $IsStableBuild = $buildInfo.stable - $AzureDevOpsProject = $buildInfo.azureDevOpsProject - $AzureDevOpsBuildDefinitionId = $buildInfo.azureDevOpsBuildDefinitionId - $AzureDevOpsBuildId = $buildInfo.azureDevOpsBuildId - } - - Write-Host "##vso[task.setvariable variable=BARBuildId]$BarId" - Write-Host "##vso[task.setvariable variable=TargetChannels]$Channels" - Write-Host "##vso[task.setvariable variable=IsStableBuild]$IsStableBuild" - - Write-Host "##vso[task.setvariable variable=AzDOProjectName]$AzureDevOpsProject" - Write-Host "##vso[task.setvariable variable=AzDOPipelineId]$AzureDevOpsBuildDefinitionId" - Write-Host "##vso[task.setvariable variable=AzDOBuildId]$AzureDevOpsBuildId" - } - catch { - Write-Host $_ - Write-Host $_.Exception - Write-Host $_.ScriptStackTrace - exit 1 - } - env: - PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }} + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file