Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 33 additions & 19 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ parameters:
displayName: "Skip tests"
type: boolean
default: False
- name: codeQLForce
displayName: "Try collecting CodeQL before default CodeQL cadence"
type: boolean
default: False

- name: otherOsPools
type: object
Expand Down Expand Up @@ -85,6 +89,13 @@ variables:
- name: _ReleaseVersionKind
value: release

# Set to 0 to force CodeQL scan without waiting 72 from last attempt (even if it failed).
# This is only a hint for the tool, it might reject to run it if it already has up to date data.
# See the Starting Code QL step for details.
- ${{ if eq(parameters.codeQLForce, True) }}:
- name: Codeql.Cadence
value: 0

# Group gives access to $microsoft-symbol-server-pat and $symweb-symbol-server-pat
- group: DotNet-Symbol-Server-Pats
# Group gives access to $dn-bot-devdiv-drop-rw-code-rw and dn-bot-dnceng-build-rw-code-rw
Expand Down Expand Up @@ -127,8 +138,10 @@ extends:
enabled: true
pool:
name: $(DncEngInternalBuildPool)
image: windows.vs2022preview.amd64
image: windows.vs2026preview.scout.amd64
os: windows
settings:
networkIsolationPolicy: Permissive,CFSClean
customBuildTags:
- ES365AIMigrationTooling
stages:
Expand All @@ -151,7 +164,7 @@ extends:
timeoutInMinutes: 120
pool:
name: $(DncEngInternalBuildPool)
image: windows.vs2022preview.amd64
image: windows.vs2026preview.scout.amd64
os: windows
steps:
# This steps help to understand versions of .NET runtime installed on the machine,
Expand Down Expand Up @@ -252,14 +265,14 @@ extends:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults/Release'
ArtifactName: TestResults
condition: failed()

- job: Publish
dependsOn:
- ${{ each pool in parameters.otherOsPools }}:
- ${{ pool.os }}
pool:
name: $(DncEngInternalBuildPool)
image: windows.vs2022preview.amd64
image: windows.vs2026preview.scout.amd64
os: windows
steps:
# The template job needs a log, otherwise it writes a warning. We can disable log uploading only for
Expand All @@ -279,22 +292,23 @@ extends:
artifactName: VSSetupArtifacts
targetPath: '$(Build.SourcesDirectory)/artifacts/VSSetup/Release'

- task: NuGetAuthenticate@1
displayName: 'NuGet Authenticate to dotnet-tools and test-tools feeds'
- ${{ if eq(parameters.isRTM, False) }}:
- task: NuGetAuthenticate@1
displayName: 'NuGet Authenticate to dotnet-tools and test-tools feeds'

- task: 1ES.PublishNuget@1
displayName: 'Publish NuGet packages to dotnet-tools feed'
inputs:
packageParentPath: '$(Build.SourcesDirectory)/artifacts/packages/Release'
packagesToPush: '$(Build.SourcesDirectory)/artifacts/packages/Release/**/*.nupkg;!$(Build.SourcesDirectory)/artifacts/packages/Release/**/*.symbols.nupkg'
publishVstsFeed: 'public/dotnet-tools'

- task: 1ES.PublishNuget@1
displayName: 'Publish NuGet packages to test-tools feed'
inputs:
packageParentPath: '$(Build.SourcesDirectory)/artifacts/packages/Release'
packagesToPush: '$(Build.SourcesDirectory)/artifacts/packages/Release/**/*.nupkg;!$(Build.SourcesDirectory)/artifacts/packages/Release/**/*.symbols.nupkg'
publishVstsFeed: 'public/test-tools'
- task: 1ES.PublishNuget@1
displayName: 'Publish NuGet packages to dotnet-tools feed'
inputs:
packageParentPath: '$(Build.SourcesDirectory)/artifacts/packages/Release'
packagesToPush: '$(Build.SourcesDirectory)/artifacts/packages/Release/**/*.nupkg;!$(Build.SourcesDirectory)/artifacts/packages/Release/**/*.symbols.nupkg'
publishVstsFeed: 'public/dotnet-tools'
- task: 1ES.PublishNuget@1
displayName: 'Publish NuGet packages to test-tools feed'
inputs:
packageParentPath: '$(Build.SourcesDirectory)/artifacts/packages/Release'
packagesToPush: '$(Build.SourcesDirectory)/artifacts/packages/Release/**/*.nupkg;!$(Build.SourcesDirectory)/artifacts/packages/Release/**/*.symbols.nupkg'
publishVstsFeed: 'public/test-tools'

# Publishes setup VSIXes to a drop.
# Note: The insertion tool looks for the display name of this task in the logs.
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ stages:
timeoutInMinutes: 120
pool:
name: NetCore-Public
demands: ImageOverride -equals windows.vs2022preview.amd64.open
demands: ImageOverride -equals windows.vs2026preview.scout.amd64.open
strategy:
matrix:
Release:
Expand Down Expand Up @@ -156,10 +156,10 @@ stages:
value: Release
strategy:
matrix:
Ubuntu_22_04:
ubuntu:
vmImage: ubuntu-22.04
pwsh: true
macOS_12:
macOS:
vmImage: macos-14
pwsh: true
pool:
Expand Down
2 changes: 1 addition & 1 deletion eng/Version.Details.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This file should be imported by eng/Versions.props
<!-- dotnet/core-setup dependencies -->
<MicrosoftExtensionsFileSystemGlobbingPackageVersion>2.0.0</MicrosoftExtensionsFileSystemGlobbingPackageVersion>
<!-- dotnet/arcade dependencies -->
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.25408.3</MicrosoftDotNetArcadeSdkPackageVersion>
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.26110.1</MicrosoftDotNetArcadeSdkPackageVersion>
<!-- dotnet/symreader-converter dependencies -->
<MicrosoftDiaSymReaderConverterPackageVersion>1.1.0-beta2-19575-01</MicrosoftDiaSymReaderConverterPackageVersion>
<MicrosoftDiaSymReaderPdb2PdbPackageVersion>1.1.0-beta2-19575-01</MicrosoftDiaSymReaderPdb2PdbPackageVersion>
Expand Down
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25408.3">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.26110.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>d27184f7cb92b4abb4b20e91ecb5c43bc43de65b</Sha>
<Sha>4bf37ce670528cf2aef4d9b1cd892554b1b02d9d</Sha>
</Dependency>
<Dependency Name="Microsoft.DiaSymReader.Pdb2Pdb" Version="1.1.0-beta2-19575-01">
<Uri>https://github.com/dotnet/symreader-converter</Uri>
Expand Down
94 changes: 56 additions & 38 deletions eng/common/SetupNugetSources.ps1
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# This script adds internal feeds required to build commits that depend on internal package sources. For instance,
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables
# disabled internal Maestro (darc-int*) feeds.
# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. Similarly,
# dotnet-eng-internal and dotnet-tools-internal are added if dotnet-eng and dotnet-tools are present.
# In addition, this script also enables disabled internal Maestro (darc-int*) feeds.
#
# Optionally, this script also adds a credential entry for each of the internal feeds if supplied.
#
# See example call for this script below.
#
# - task: PowerShell@2
# displayName: Setup Private Feeds Credentials
# displayName: Setup internal Feeds Credentials
# condition: eq(variables['Agent.OS'], 'Windows_NT')
# inputs:
# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
# filePath: $(System.DefaultWorkingDirectory)/eng/common/SetupNugetSources.ps1
# arguments: -ConfigFile $(System.DefaultWorkingDirectory)/NuGet.config -Password $Env:Token
# env:
# Token: $(dn-bot-dnceng-artifact-feeds-rw)
#
Expand All @@ -34,19 +35,28 @@ Set-StrictMode -Version 2.0

. $PSScriptRoot\tools.ps1

# Adds or enables the package source with the given name
function AddOrEnablePackageSource($sources, $disabledPackageSources, $SourceName, $SourceEndPoint, $creds, $Username, $pwd) {
if ($disabledPackageSources -eq $null -or -not (EnableInternalPackageSource -DisabledPackageSources $disabledPackageSources -Creds $creds -PackageSourceName $SourceName)) {
AddPackageSource -Sources $sources -SourceName $SourceName -SourceEndPoint $SourceEndPoint -Creds $creds -Username $userName -pwd $Password
}
}

# Add source entry to PackageSources
function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $pwd) {
$packageSource = $sources.SelectSingleNode("add[@key='$SourceName']")

if ($packageSource -eq $null)
{
Write-Host "Adding package source $SourceName"

$packageSource = $doc.CreateElement("add")
$packageSource.SetAttribute("key", $SourceName)
$packageSource.SetAttribute("value", $SourceEndPoint)
$sources.AppendChild($packageSource) | Out-Null
}
else {
Write-Host "Package source $SourceName already present."
Write-Host "Package source $SourceName already present and enabled."
}

AddCredential -Creds $creds -Source $SourceName -Username $Username -pwd $pwd
Expand All @@ -59,6 +69,8 @@ function AddCredential($creds, $source, $username, $pwd) {
return;
}

Write-Host "Inserting credential for feed: " $source

# Looks for credential configuration for the given SourceName. Create it if none is found.
$sourceElement = $creds.SelectSingleNode($Source)
if ($sourceElement -eq $null)
Expand Down Expand Up @@ -91,24 +103,27 @@ function AddCredential($creds, $source, $username, $pwd) {
$passwordElement.SetAttribute("value", $pwd)
}

function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $pwd) {
$maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]")

Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds."

ForEach ($PackageSource in $maestroPrivateSources) {
Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key
AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -pwd $pwd
# Enable all darc-int package sources.
function EnableMaestroInternalPackageSources($DisabledPackageSources, $Creds) {
$maestroInternalSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]")
ForEach ($DisabledPackageSource in $maestroInternalSources) {
EnableInternalPackageSource -DisabledPackageSources $DisabledPackageSources -Creds $Creds -PackageSourceName $DisabledPackageSource.key
}
}

function EnablePrivatePackageSources($DisabledPackageSources) {
$maestroPrivateSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]")
ForEach ($DisabledPackageSource in $maestroPrivateSources) {
Write-Host "`tEnsuring private source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource"
# Enables an internal package source by name, if found. Returns true if the package source was found and enabled, false otherwise.
function EnableInternalPackageSource($DisabledPackageSources, $Creds, $PackageSourceName) {
$DisabledPackageSource = $DisabledPackageSources.SelectSingleNode("add[@key='$PackageSourceName']")
if ($DisabledPackageSource) {
Write-Host "Enabling internal source '$($DisabledPackageSource.key)'."

# Due to https://github.com/NuGet/Home/issues/10291, we must actually remove the disabled entries
$DisabledPackageSources.RemoveChild($DisabledPackageSource)

AddCredential -Creds $creds -Source $DisabledPackageSource.Key -Username $userName -pwd $Password
return $true
}
return $false
}

if (!(Test-Path $ConfigFile -PathType Leaf)) {
Expand All @@ -121,15 +136,17 @@ $doc = New-Object System.Xml.XmlDocument
$filename = (Get-Item $ConfigFile).FullName
$doc.Load($filename)

# Get reference to <PackageSources> or create one if none exist already
# Get reference to <PackageSources> - fail if none exist
$sources = $doc.DocumentElement.SelectSingleNode("packageSources")
if ($sources -eq $null) {
$sources = $doc.CreateElement("packageSources")
$doc.DocumentElement.AppendChild($sources) | Out-Null
Write-PipelineTelemetryError -Category 'Build' -Message "Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. NuGet config file must contain a packageSources section: $ConfigFile"
ExitWithExitCode 1
}

$creds = $null
$feedSuffix = "v3/index.json"
if ($Password) {
$feedSuffix = "v2"
# Looks for a <PackageSourceCredentials> node. Create it if none is found.
$creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials")
if ($creds -eq $null) {
Expand All @@ -138,34 +155,35 @@ if ($Password) {
}
}

$userName = "dn-bot"

# Check for disabledPackageSources; we'll enable any darc-int ones we find there
$disabledSources = $doc.DocumentElement.SelectSingleNode("disabledPackageSources")
if ($disabledSources -ne $null) {
Write-Host "Checking for any darc-int disabled package sources in the disabledPackageSources node"
EnablePrivatePackageSources -DisabledPackageSources $disabledSources
EnableMaestroInternalPackageSources -DisabledPackageSources $disabledSources -Creds $creds
}

$userName = "dn-bot"

# Insert credential nodes for Maestro's private feeds
InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -pwd $Password

# 3.1 uses a different feed url format so it's handled differently here
$dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']")
if ($dotnet31Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password
}

$dotnetVersions = @('5','6','7','8','9')
$dotnetVersions = @('5','6','7','8','9','10')

foreach ($dotnetVersion in $dotnetVersions) {
$feedPrefix = "dotnet" + $dotnetVersion;
$dotnetSource = $sources.SelectSingleNode("add[@key='$feedPrefix']")
if ($dotnetSource -ne $null) {
AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password
AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password
AddOrEnablePackageSource -Sources $sources -DisabledPackageSources $disabledSources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/$feedSuffix" -Creds $creds -Username $userName -pwd $Password
AddOrEnablePackageSource -Sources $sources -DisabledPackageSources $disabledSources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/$feedSuffix" -Creds $creds -Username $userName -pwd $Password
}
}

# Check for dotnet-eng and add dotnet-eng-internal if present
$dotnetEngSource = $sources.SelectSingleNode("add[@key='dotnet-eng']")
if ($dotnetEngSource -ne $null) {
AddOrEnablePackageSource -Sources $sources -DisabledPackageSources $disabledSources -SourceName "dotnet-eng-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-eng-internal/nuget/$feedSuffix" -Creds $creds -Username $userName -pwd $Password
}

# Check for dotnet-tools and add dotnet-tools-internal if present
$dotnetToolsSource = $sources.SelectSingleNode("add[@key='dotnet-tools']")
if ($dotnetToolsSource -ne $null) {
AddOrEnablePackageSource -Sources $sources -DisabledPackageSources $disabledSources -SourceName "dotnet-tools-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet-tools-internal/nuget/$feedSuffix" -Creds $creds -Username $userName -pwd $Password
}

$doc.Save($filename)
Loading