Update dependencies from https://github.com/dotnet/arcade build 20240710.5
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.CMake.Sdk From Version 8.0.0-beta.24204.3 -> To Version 8.0.0-beta.24360.5
This commit is contained in:
parent
1b6ea50422
commit
8f2a9ac4f8
22 changed files with 350 additions and 98 deletions
21
NuGet.config
21
NuGet.config
|
@ -7,19 +7,10 @@
|
|||
<clear />
|
||||
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
|
||||
<!-- Begin: Package sources from dotnet-aspnetcore -->
|
||||
<add key="darc-int-dotnet-aspnetcore-8486d31" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-aspnetcore-8486d31e/nuget/v3/index.json" />
|
||||
<add key="darc-int-dotnet-aspnetcore-8486d31-2" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-aspnetcore-8486d31e-2/nuget/v3/index.json" />
|
||||
<add key="darc-int-dotnet-aspnetcore-8486d31-1" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-aspnetcore-8486d31e-1/nuget/v3/index.json" />
|
||||
<!-- End: Package sources from dotnet-aspnetcore -->
|
||||
<!-- Begin: Package sources from dotnet-emsdk -->
|
||||
<add key="darc-pub-dotnet-emsdk-08a90ca" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-08a90ca2/nuget/v3/index.json" />
|
||||
<add key="darc-pub-dotnet-emsdk-08a90ca-2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-08a90ca2-2/nuget/v3/index.json" />
|
||||
<add key="darc-pub-dotnet-emsdk-08a90ca-1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-08a90ca2-1/nuget/v3/index.json" />
|
||||
<!-- End: Package sources from dotnet-emsdk -->
|
||||
<!-- Begin: Package sources from dotnet-windowsdesktop -->
|
||||
<add key="darc-int-dotnet-windowsdesktop-04094d1" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-windowsdesktop-04094d11/nuget/v3/index.json" />
|
||||
<add key="darc-int-dotnet-windowsdesktop-04094d1-2" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-windowsdesktop-04094d11-2/nuget/v3/index.json" />
|
||||
<add key="darc-int-dotnet-windowsdesktop-04094d1-1" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-windowsdesktop-04094d11-1/nuget/v3/index.json" />
|
||||
<!-- End: Package sources from dotnet-windowsdesktop -->
|
||||
<!-- Begin: Package sources from DotNet-msbuild-Trusted -->
|
||||
<add key="darc-pub-DotNet-msbuild-Trusted-b34f758" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-DotNet-msbuild-Trusted-b34f7585/nuget/v3/index.json" />
|
||||
|
@ -27,9 +18,6 @@
|
|||
<!-- Begin: Package sources from dotnet-runtime -->
|
||||
<!-- End: Package sources from dotnet-runtime -->
|
||||
<!-- Begin: Package sources from dotnet-sdk -->
|
||||
<add key="darc-int-dotnet-sdk-ceea228" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-sdk-ceea2287/nuget/v3/index.json" />
|
||||
<add key="darc-int-dotnet-sdk-ceea228-2" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-sdk-ceea2287-2/nuget/v3/index.json" />
|
||||
<add key="darc-int-dotnet-sdk-ceea228-1" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-sdk-ceea2287-1/nuget/v3/index.json" />
|
||||
<!-- End: Package sources from dotnet-sdk -->
|
||||
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
|
||||
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
|
||||
|
@ -48,20 +36,11 @@
|
|||
<disabledPackageSources>
|
||||
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
|
||||
<!-- Begin: Package sources from dotnet-aspnetcore -->
|
||||
<add key="darc-int-dotnet-aspnetcore-8486d31-1" value="true" />
|
||||
<add key="darc-int-dotnet-aspnetcore-8486d31-2" value="true" />
|
||||
<add key="darc-int-dotnet-aspnetcore-8486d31" value="true" />
|
||||
<!-- End: Package sources from dotnet-aspnetcore -->
|
||||
<!-- Begin: Package sources from dotnet-runtime -->
|
||||
<!-- Begin: Package sources from dotnet-sdk -->
|
||||
<add key="darc-int-dotnet-sdk-ceea228-1" value="true" />
|
||||
<add key="darc-int-dotnet-sdk-ceea228-2" value="true" />
|
||||
<add key="darc-int-dotnet-sdk-ceea228" value="true" />
|
||||
<!-- End: Package sources from dotnet-sdk -->
|
||||
<!-- Begin: Package sources from dotnet-windowsdesktop -->
|
||||
<add key="darc-int-dotnet-windowsdesktop-04094d1-1" value="true" />
|
||||
<add key="darc-int-dotnet-windowsdesktop-04094d1-2" value="true" />
|
||||
<add key="darc-int-dotnet-windowsdesktop-04094d1" value="true" />
|
||||
<!-- End: Package sources from dotnet-windowsdesktop -->
|
||||
<!-- End: Package sources from dotnet-runtime -->
|
||||
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
|
||||
|
|
|
@ -214,18 +214,18 @@
|
|||
</Dependency>
|
||||
</ProductDependencies>
|
||||
<ToolsetDependencies>
|
||||
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24204.3">
|
||||
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24360.5">
|
||||
<Uri>https://github.com/dotnet/arcade</Uri>
|
||||
<Sha>188340e12c0a372b1681ad6a5e72c608021efdba</Sha>
|
||||
<Sha>c9efa535175049eb9cba06cae1f8c3d5dbe768a9</Sha>
|
||||
<SourceBuild RepoName="arcade" ManagedOnly="true" />
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.DotNet.CMake.Sdk" Version="8.0.0-beta.24204.3">
|
||||
<Dependency Name="Microsoft.DotNet.CMake.Sdk" Version="8.0.0-beta.24360.5">
|
||||
<Uri>https://github.com/dotnet/arcade</Uri>
|
||||
<Sha>188340e12c0a372b1681ad6a5e72c608021efdba</Sha>
|
||||
<Sha>c9efa535175049eb9cba06cae1f8c3d5dbe768a9</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="8.0.0-beta.24204.3">
|
||||
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="8.0.0-beta.24360.5">
|
||||
<Uri>https://github.com/dotnet/arcade</Uri>
|
||||
<Sha>188340e12c0a372b1681ad6a5e72c608021efdba</Sha>
|
||||
<Sha>c9efa535175049eb9cba06cae1f8c3d5dbe768a9</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.DotNet.Darc" Version="1.1.0-beta.23578.2">
|
||||
<Uri>https://github.com/dotnet/arcade-services</Uri>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Dependency from https://github.com/dotnet/arcade -->
|
||||
<MicrosoftDotNetBuildTasksInstallersPackageVersion>8.0.0-beta.24204.3</MicrosoftDotNetBuildTasksInstallersPackageVersion>
|
||||
<MicrosoftDotNetBuildTasksInstallersPackageVersion>8.0.0-beta.24360.5</MicrosoftDotNetBuildTasksInstallersPackageVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Dependency from https://github.com/dotnet/arcade-services -->
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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)
|
||||
|
@ -137,14 +140,16 @@ jobs:
|
|||
BARBuildId: ${{ parameters.BARBuildId }}
|
||||
PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
|
||||
|
||||
- task: PowerShell@2
|
||||
- task: AzureCLI@2
|
||||
displayName: Publish Using Darc
|
||||
inputs:
|
||||
filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
|
||||
arguments: -BuildId $(BARBuildId)
|
||||
azureSubscription: "Darc: Maestro Production"
|
||||
scriptType: ps
|
||||
scriptLocation: scriptPath
|
||||
scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
|
||||
arguments: -BuildId $(BARBuildId)
|
||||
-PublishingInfraVersion 3
|
||||
-AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)'
|
||||
-MaestroToken '$(MaestroApiAccessToken)'
|
||||
-WaitPublishingFinish true
|
||||
-ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}'
|
||||
-SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'
|
||||
|
|
|
@ -31,6 +31,12 @@ parameters:
|
|||
# container and pool.
|
||||
platform: {}
|
||||
|
||||
# If set to true and running on a non-public project,
|
||||
# Internal blob storage locations will be enabled.
|
||||
# This is not enabled by default because many repositories do not need internal sources
|
||||
# and do not need to have the required service connections approved in the pipeline.
|
||||
enableInternalSources: false
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }}
|
||||
displayName: Source-Build (${{ parameters.platform.name }})
|
||||
|
@ -62,6 +68,8 @@ jobs:
|
|||
clean: all
|
||||
|
||||
steps:
|
||||
- ${{ if eq(parameters.enableInternalSources, true) }}:
|
||||
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
|
||||
- template: /eng/common/templates-official/steps/source-build.yml
|
||||
parameters:
|
||||
platform: ${{ parameters.platform }}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
parameters:
|
||||
runAsPublic: false
|
||||
sourceIndexPackageVersion: 1.0.1-20230228.2
|
||||
sourceIndexUploadPackageVersion: 2.0.0-20240502.12
|
||||
sourceIndexProcessBinlogPackageVersion: 1.0.1-20240129.2
|
||||
sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
|
||||
sourceIndexBuildCommand: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "eng/common/build.ps1 -restore -build -binarylog -ci"
|
||||
preSteps: []
|
||||
|
@ -14,14 +15,14 @@ jobs:
|
|||
dependsOn: ${{ parameters.dependsOn }}
|
||||
condition: ${{ parameters.condition }}
|
||||
variables:
|
||||
- name: SourceIndexPackageVersion
|
||||
value: ${{ parameters.sourceIndexPackageVersion }}
|
||||
- name: SourceIndexUploadPackageVersion
|
||||
value: ${{ parameters.sourceIndexUploadPackageVersion }}
|
||||
- name: SourceIndexProcessBinlogPackageVersion
|
||||
value: ${{ parameters.sourceIndexProcessBinlogPackageVersion }}
|
||||
- name: SourceIndexPackageSource
|
||||
value: ${{ parameters.sourceIndexPackageSource }}
|
||||
- name: BinlogPath
|
||||
value: ${{ parameters.binlogPath }}
|
||||
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- group: source-dot-net stage1 variables
|
||||
- template: /eng/common/templates-official/variables/pool-providers.yml
|
||||
|
||||
${{ if ne(parameters.pool, '') }}:
|
||||
|
@ -41,16 +42,16 @@ jobs:
|
|||
- ${{ preStep }}
|
||||
|
||||
- task: UseDotNet@2
|
||||
displayName: Use .NET Core SDK 6
|
||||
displayName: Use .NET 8 SDK
|
||||
inputs:
|
||||
packageType: sdk
|
||||
version: 6.0.x
|
||||
version: 8.0.x
|
||||
installationPath: $(Agent.TempDirectory)/dotnet
|
||||
workingDirectory: $(Agent.TempDirectory)
|
||||
|
||||
- script: |
|
||||
$(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version $(SourceIndexPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
|
||||
$(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version $(SourceIndexPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
|
||||
$(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version $(sourceIndexProcessBinlogPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
|
||||
$(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version $(sourceIndexUploadPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
|
||||
displayName: Download Tools
|
||||
# Set working directory to temp directory so 'dotnet' doesn't try to use global.json and use the repo's sdk.
|
||||
workingDirectory: $(Agent.TempDirectory)
|
||||
|
@ -62,7 +63,21 @@ jobs:
|
|||
displayName: Process Binlog into indexable sln
|
||||
|
||||
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name)
|
||||
- task: AzureCLI@2
|
||||
displayName: Get stage 1 auth token
|
||||
inputs:
|
||||
azureSubscription: 'SourceDotNet Stage1 Publish'
|
||||
addSpnToEnvironment: true
|
||||
scriptType: 'ps'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
echo "##vso[task.setvariable variable=ARM_CLIENT_ID;issecret=true]$env:servicePrincipalId"
|
||||
echo "##vso[task.setvariable variable=ARM_ID_TOKEN;issecret=true]$env:idToken"
|
||||
echo "##vso[task.setvariable variable=ARM_TENANT_ID;issecret=true]$env:tenantId"
|
||||
|
||||
- script: |
|
||||
az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN)
|
||||
displayName: "Login to Azure"
|
||||
|
||||
- script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1
|
||||
displayName: Upload stage1 artifacts to source index
|
||||
env:
|
||||
BLOB_CONTAINER_URL: $(source-dot-net-stage1-blob-container-url)
|
||||
|
|
|
@ -21,6 +21,12 @@ parameters:
|
|||
# one job runs on 'defaultManagedPlatform'.
|
||||
platforms: []
|
||||
|
||||
# If set to true and running on a non-public project,
|
||||
# Internal nuget and blob storage locations will be enabled.
|
||||
# This is not enabled by default because many repositories do not need internal sources
|
||||
# and do not need to have the required service connections approved in the pipeline.
|
||||
enableInternalSources: false
|
||||
|
||||
jobs:
|
||||
|
||||
- ${{ if ne(parameters.allCompletedJobId, '') }}:
|
||||
|
@ -38,9 +44,11 @@ jobs:
|
|||
parameters:
|
||||
jobNamePrefix: ${{ parameters.jobNamePrefix }}
|
||||
platform: ${{ platform }}
|
||||
enableInternalSources: ${{ parameters.enableInternalSources }}
|
||||
|
||||
- ${{ if eq(length(parameters.platforms), 0) }}:
|
||||
- template: /eng/common/templates-official/job/source-build.yml
|
||||
parameters:
|
||||
jobNamePrefix: ${{ parameters.jobNamePrefix }}
|
||||
platform: ${{ parameters.defaultManagedPlatform }}
|
||||
enableInternalSources: ${{ parameters.enableInternalSources }}
|
||||
|
|
|
@ -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 }}'
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
# Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64'
|
||||
# variable with the base64-encoded SAS token, by default
|
||||
|
||||
parameters:
|
||||
- name: federatedServiceConnection
|
||||
type: string
|
||||
default: 'dotnetbuilds-internal-read'
|
||||
- name: outputVariableName
|
||||
type: string
|
||||
default: 'dotnetbuilds-internal-container-read-token-base64'
|
||||
- name: expiryInHours
|
||||
type: number
|
||||
default: 1
|
||||
- name: base64Encode
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
steps:
|
||||
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
|
||||
- template: /eng/common/templates-official/steps/get-delegation-sas.yml
|
||||
parameters:
|
||||
federatedServiceConnection: ${{ parameters.federatedServiceConnection }}
|
||||
outputVariableName: ${{ parameters.outputVariableName }}
|
||||
expiryInHours: ${{ parameters.expiryInHours }}
|
||||
base64Encode: ${{ parameters.base64Encode }}
|
||||
storageAccount: dotnetbuilds
|
||||
container: internal
|
||||
permissions: rl
|
43
eng/common/templates-official/steps/get-delegation-sas.yml
Normal file
43
eng/common/templates-official/steps/get-delegation-sas.yml
Normal file
|
@ -0,0 +1,43 @@
|
|||
parameters:
|
||||
- name: federatedServiceConnection
|
||||
type: string
|
||||
- name: outputVariableName
|
||||
type: string
|
||||
- name: expiryInHours
|
||||
type: number
|
||||
default: 1
|
||||
- name: base64Encode
|
||||
type: boolean
|
||||
default: false
|
||||
- name: storageAccount
|
||||
type: string
|
||||
- name: container
|
||||
type: string
|
||||
- name: permissions
|
||||
type: string
|
||||
default: 'rl'
|
||||
|
||||
steps:
|
||||
- task: AzureCLI@2
|
||||
displayName: 'Generate delegation SAS Token for ${{ parameters.storageAccount }}/${{ parameters.container }}'
|
||||
inputs:
|
||||
azureSubscription: ${{ parameters.federatedServiceConnection }}
|
||||
scriptType: 'pscore'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
# Calculate the expiration of the SAS token and convert to UTC
|
||||
$expiry = (Get-Date).AddHours(${{ parameters.expiryInHours }}).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
|
||||
|
||||
$sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Failed to generate SAS token."
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ('${{ parameters.base64Encode }}' -eq 'true') {
|
||||
$sas = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($sas))
|
||||
}
|
||||
|
||||
Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value"
|
||||
Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$sas"
|
|
@ -0,0 +1,28 @@
|
|||
parameters:
|
||||
- name: federatedServiceConnection
|
||||
type: string
|
||||
- name: outputVariableName
|
||||
type: string
|
||||
# Resource to get a token for. Common values include:
|
||||
# - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps
|
||||
# - 'https://storage.azure.com/' for storage
|
||||
# Defaults to Azure DevOps
|
||||
- name: resource
|
||||
type: string
|
||||
default: '499b84ac-1321-427f-aa17-267ca6975798'
|
||||
|
||||
steps:
|
||||
- task: AzureCLI@2
|
||||
displayName: 'Getting federated access token for feeds'
|
||||
inputs:
|
||||
azureSubscription: ${{ parameters.federatedServiceConnection }}
|
||||
scriptType: 'pscore'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
$accessToken = az account get-access-token --query accessToken --resource ${{ parameters.resource }} --output tsv
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Failed to get access token for resource '${{ parameters.resource }}'"
|
||||
exit 1
|
||||
}
|
||||
Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value"
|
||||
Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken"
|
|
@ -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)
|
||||
|
@ -133,14 +136,16 @@ jobs:
|
|||
BARBuildId: ${{ parameters.BARBuildId }}
|
||||
PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }}
|
||||
|
||||
- task: PowerShell@2
|
||||
- task: AzureCLI@2
|
||||
displayName: Publish Using Darc
|
||||
inputs:
|
||||
filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
|
||||
arguments: -BuildId $(BARBuildId)
|
||||
azureSubscription: "Darc: Maestro Production"
|
||||
scriptType: ps
|
||||
scriptLocation: scriptPath
|
||||
scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1
|
||||
arguments: -BuildId $(BARBuildId)
|
||||
-PublishingInfraVersion 3
|
||||
-AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)'
|
||||
-MaestroToken '$(MaestroApiAccessToken)'
|
||||
-WaitPublishingFinish true
|
||||
-ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}'
|
||||
-SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'
|
||||
|
|
|
@ -31,6 +31,12 @@ parameters:
|
|||
# container and pool.
|
||||
platform: {}
|
||||
|
||||
# If set to true and running on a non-public project,
|
||||
# Internal blob storage locations will be enabled.
|
||||
# This is not enabled by default because many repositories do not need internal sources
|
||||
# and do not need to have the required service connections approved in the pipeline.
|
||||
enableInternalSources: false
|
||||
|
||||
jobs:
|
||||
- job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }}
|
||||
displayName: Source-Build (${{ parameters.platform.name }})
|
||||
|
@ -61,6 +67,8 @@ jobs:
|
|||
clean: all
|
||||
|
||||
steps:
|
||||
- ${{ if eq(parameters.enableInternalSources, true) }}:
|
||||
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
|
||||
- template: /eng/common/templates/steps/source-build.yml
|
||||
parameters:
|
||||
platform: ${{ parameters.platform }}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
parameters:
|
||||
runAsPublic: false
|
||||
sourceIndexPackageVersion: 1.0.1-20230228.2
|
||||
sourceIndexUploadPackageVersion: 2.0.0-20240502.12
|
||||
sourceIndexProcessBinlogPackageVersion: 1.0.1-20240129.2
|
||||
sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
|
||||
sourceIndexBuildCommand: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "eng/common/build.ps1 -restore -build -binarylog -ci"
|
||||
preSteps: []
|
||||
|
@ -14,14 +15,14 @@ jobs:
|
|||
dependsOn: ${{ parameters.dependsOn }}
|
||||
condition: ${{ parameters.condition }}
|
||||
variables:
|
||||
- name: SourceIndexPackageVersion
|
||||
value: ${{ parameters.sourceIndexPackageVersion }}
|
||||
- name: SourceIndexUploadPackageVersion
|
||||
value: ${{ parameters.sourceIndexUploadPackageVersion }}
|
||||
- name: SourceIndexProcessBinlogPackageVersion
|
||||
value: ${{ parameters.sourceIndexProcessBinlogPackageVersion }}
|
||||
- name: SourceIndexPackageSource
|
||||
value: ${{ parameters.sourceIndexPackageSource }}
|
||||
- name: BinlogPath
|
||||
value: ${{ parameters.binlogPath }}
|
||||
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- group: source-dot-net stage1 variables
|
||||
- template: /eng/common/templates/variables/pool-providers.yml
|
||||
|
||||
${{ if ne(parameters.pool, '') }}:
|
||||
|
@ -40,16 +41,16 @@ jobs:
|
|||
- ${{ preStep }}
|
||||
|
||||
- task: UseDotNet@2
|
||||
displayName: Use .NET Core SDK 6
|
||||
displayName: Use .NET 8 SDK
|
||||
inputs:
|
||||
packageType: sdk
|
||||
version: 6.0.x
|
||||
version: 8.0.x
|
||||
installationPath: $(Agent.TempDirectory)/dotnet
|
||||
workingDirectory: $(Agent.TempDirectory)
|
||||
|
||||
- script: |
|
||||
$(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version $(SourceIndexPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
|
||||
$(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version $(SourceIndexPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
|
||||
$(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version $(sourceIndexProcessBinlogPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
|
||||
$(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version $(sourceIndexUploadPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
|
||||
displayName: Download Tools
|
||||
# Set working directory to temp directory so 'dotnet' doesn't try to use global.json and use the repo's sdk.
|
||||
workingDirectory: $(Agent.TempDirectory)
|
||||
|
@ -61,7 +62,21 @@ jobs:
|
|||
displayName: Process Binlog into indexable sln
|
||||
|
||||
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name)
|
||||
- task: AzureCLI@2
|
||||
displayName: Get stage 1 auth token
|
||||
inputs:
|
||||
azureSubscription: 'SourceDotNet Stage1 Publish'
|
||||
addSpnToEnvironment: true
|
||||
scriptType: 'ps'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
echo "##vso[task.setvariable variable=ARM_CLIENT_ID;issecret=true]$env:servicePrincipalId"
|
||||
echo "##vso[task.setvariable variable=ARM_ID_TOKEN;issecret=true]$env:idToken"
|
||||
echo "##vso[task.setvariable variable=ARM_TENANT_ID;issecret=true]$env:tenantId"
|
||||
|
||||
- script: |
|
||||
az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN)
|
||||
displayName: "Login to Azure"
|
||||
|
||||
- script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1
|
||||
displayName: Upload stage1 artifacts to source index
|
||||
env:
|
||||
BLOB_CONTAINER_URL: $(source-dot-net-stage1-blob-container-url)
|
||||
|
|
|
@ -21,6 +21,12 @@ parameters:
|
|||
# one job runs on 'defaultManagedPlatform'.
|
||||
platforms: []
|
||||
|
||||
# If set to true and running on a non-public project,
|
||||
# Internal nuget and blob storage locations will be enabled.
|
||||
# This is not enabled by default because many repositories do not need internal sources
|
||||
# and do not need to have the required service connections approved in the pipeline.
|
||||
enableInternalSources: false
|
||||
|
||||
jobs:
|
||||
|
||||
- ${{ if ne(parameters.allCompletedJobId, '') }}:
|
||||
|
@ -38,9 +44,11 @@ jobs:
|
|||
parameters:
|
||||
jobNamePrefix: ${{ parameters.jobNamePrefix }}
|
||||
platform: ${{ platform }}
|
||||
enableInternalSources: ${{ parameters.enableInternalSources }}
|
||||
|
||||
- ${{ if eq(length(parameters.platforms), 0) }}:
|
||||
- template: /eng/common/templates/job/source-build.yml
|
||||
parameters:
|
||||
jobNamePrefix: ${{ parameters.jobNamePrefix }}
|
||||
platform: ${{ parameters.defaultManagedPlatform }}
|
||||
enableInternalSources: ${{ parameters.enableInternalSources }}
|
||||
|
|
|
@ -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 }}'
|
||||
|
|
|
@ -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 }}
|
||||
|
|
28
eng/common/templates/steps/enable-internal-runtimes.yml
Normal file
28
eng/common/templates/steps/enable-internal-runtimes.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64'
|
||||
# variable with the base64-encoded SAS token, by default
|
||||
|
||||
parameters:
|
||||
- name: federatedServiceConnection
|
||||
type: string
|
||||
default: 'dotnetbuilds-internal-read'
|
||||
- name: outputVariableName
|
||||
type: string
|
||||
default: 'dotnetbuilds-internal-container-read-token-base64'
|
||||
- name: expiryInHours
|
||||
type: number
|
||||
default: 1
|
||||
- name: base64Encode
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
steps:
|
||||
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
|
||||
- template: /eng/common/templates/steps/get-delegation-sas.yml
|
||||
parameters:
|
||||
federatedServiceConnection: ${{ parameters.federatedServiceConnection }}
|
||||
outputVariableName: ${{ parameters.outputVariableName }}
|
||||
expiryInHours: ${{ parameters.expiryInHours }}
|
||||
base64Encode: ${{ parameters.base64Encode }}
|
||||
storageAccount: dotnetbuilds
|
||||
container: internal
|
||||
permissions: rl
|
43
eng/common/templates/steps/get-delegation-sas.yml
Normal file
43
eng/common/templates/steps/get-delegation-sas.yml
Normal file
|
@ -0,0 +1,43 @@
|
|||
parameters:
|
||||
- name: federatedServiceConnection
|
||||
type: string
|
||||
- name: outputVariableName
|
||||
type: string
|
||||
- name: expiryInHours
|
||||
type: number
|
||||
default: 1
|
||||
- name: base64Encode
|
||||
type: boolean
|
||||
default: false
|
||||
- name: storageAccount
|
||||
type: string
|
||||
- name: container
|
||||
type: string
|
||||
- name: permissions
|
||||
type: string
|
||||
default: 'rl'
|
||||
|
||||
steps:
|
||||
- task: AzureCLI@2
|
||||
displayName: 'Generate delegation SAS Token for ${{ parameters.storageAccount }}/${{ parameters.container }}'
|
||||
inputs:
|
||||
azureSubscription: ${{ parameters.federatedServiceConnection }}
|
||||
scriptType: 'pscore'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
# Calculate the expiration of the SAS token and convert to UTC
|
||||
$expiry = (Get-Date).AddHours(${{ parameters.expiryInHours }}).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
|
||||
|
||||
$sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Failed to generate SAS token."
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ('${{ parameters.base64Encode }}' -eq 'true') {
|
||||
$sas = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($sas))
|
||||
}
|
||||
|
||||
Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value"
|
||||
Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$sas"
|
28
eng/common/templates/steps/get-federated-access-token.yml
Normal file
28
eng/common/templates/steps/get-federated-access-token.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
parameters:
|
||||
- name: federatedServiceConnection
|
||||
type: string
|
||||
- name: outputVariableName
|
||||
type: string
|
||||
# Resource to get a token for. Common values include:
|
||||
# - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps
|
||||
# - 'https://storage.azure.com/' for storage
|
||||
# Defaults to Azure DevOps
|
||||
- name: resource
|
||||
type: string
|
||||
default: '499b84ac-1321-427f-aa17-267ca6975798'
|
||||
|
||||
steps:
|
||||
- task: AzureCLI@2
|
||||
displayName: 'Getting federated access token for feeds'
|
||||
inputs:
|
||||
azureSubscription: ${{ parameters.federatedServiceConnection }}
|
||||
scriptType: 'pscore'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
$accessToken = az account get-access-token --query accessToken --resource ${{ parameters.resource }} --output tsv
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Failed to get access token for resource '${{ parameters.resource }}'"
|
||||
exit 1
|
||||
}
|
||||
Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value"
|
||||
Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken"
|
|
@ -11,7 +11,7 @@
|
|||
"cmake": "3.21.0"
|
||||
},
|
||||
"msbuild-sdks": {
|
||||
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24204.3",
|
||||
"Microsoft.DotNet.CMake.Sdk": "8.0.0-beta.24204.3"
|
||||
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24360.5",
|
||||
"Microsoft.DotNet.CMake.Sdk": "8.0.0-beta.24360.5"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue