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
6 changes: 3 additions & 3 deletions DotnetRuntimeMetadata.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"sdk": {
"channel": "release/5.0.1xx-rc2",
"packageVersionPattern": "5.0.0-rc.2",
"sdkImageVersion": "5.0.100-rc.2",
"channel": "release/5.0.1xx",
"packageVersionPattern": "5.0.0",
"sdkImageVersion": "5.0.100",
"nextChannel": "net5/rc2"
}
}
1 change: 1 addition & 0 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<configuration>
<packageSources>
<clear />
<add key="dotnet5-rtm" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/5.0.100-rtm.20526.5/nuget/v3/index.json" />
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
Expand Down
36 changes: 26 additions & 10 deletions tools/UpdateDotnetRuntime.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ param (
[string]$RuntimeSourceFeedKey,

[Parameter()]
[switch]$InteractiveAuth
[switch]$InteractiveAuth,

[Parameter()]
[switch]$UseRTMFeed
)

<#
Expand Down Expand Up @@ -94,15 +97,21 @@ function Update-PackageVersion {

$versionPattern = (Get-Content "$PSScriptRoot/../DotnetRuntimeMetadata.json" | ConvertFrom-Json).sdk.packageVersionPattern

$source = if ($UseNuGetOrg) { 'nuget.org' } else { 'dotnet5' }
$source = if ($UseNuGetOrg) { 'nuget.org' } elseif ($UseRTMFeed) { 'dotnet5-rtm' } else { 'dotnet5' }
$packages.GetEnumerator() | ForEach-Object {
$pkgs = Find-Package -Name $_.Key -AllVersions -AllowPrereleaseVersions -Source $source

foreach ($v in $_.Value) {
$version = $v.Version

foreach ($p in $pkgs) {
if ($p.Version -like "$versionPattern*") {
if ($UseRTMFeed -and $p.Version -eq $versionPattern) {
if ([System.Management.Automation.SemanticVersion] ($version) -lt [System.Management.Automation.SemanticVersion] ($p.Version)) {
$v.NewVersion = $p.Version
break
}
}
elseif ($p.Version -like "$versionPattern*") {
if ([System.Management.Automation.SemanticVersion] ($version) -lt [System.Management.Automation.SemanticVersion] ($p.Version)) {
$v.NewVersion = $p.Version
break
Expand Down Expand Up @@ -201,19 +210,26 @@ if ($dotnetUpdate.ShouldUpdate) {

Find-Dotnet

$addDotnet5Source = (-not (Get-PackageSource -Name 'dotnet5' -ErrorAction SilentlyContinue))
$addDotnet5InternalSource = (-not (Get-PackageSource -Name 'dotnet5-internal' -ErrorAction SilentlyContinue))
$feedname = if ($UseRTMFeed) {
'dotnet5-rtm'
} elseif ($UseNuGetOrg) {
'dotnet5'
} else {
'dotnet-internal'
}

$addDotnet5Source = (-not (Get-PackageSource -Name $feedname -ErrorAction SilentlyContinue))

if (!$UseNuGetOrg -and ($addDotnet5Source -or $addDotnet5InternalSource)) {
$nugetFileSources = ([xml](Get-Content .\nuget.config -Raw)).Configuration.packagesources.add

if ($addDotnet5Source) {
$dotnet5Feed = $nugetFileSources | Where-Object { $_.Key -eq 'dotnet5' } | Select-Object -ExpandProperty Value
Register-PackageSource -Name 'dotnet5' -Location $dotnet5Feed -ProviderName NuGet
Write-Verbose -Message "Register new package source 'dotnet5'" -verbose
if ($addDotnet5Source -and $feedname -ne 'dotnet-internal') {
$dotnet5Feed = $nugetFileSources | Where-Object { $_.Key -eq $feedname } | Select-Object -ExpandProperty Value
Register-PackageSource -Name $feedname -Location $dotnet5Feed -ProviderName NuGet
Write-Verbose -Message "Register new package source $feedname" -verbose
}

if ($addDotnet5InternalSource -and $InteractiveAuth) {
if ($addDotnet5Source -and $InteractiveAuth -and $feedname -eq 'dotnet-internal') {
# This NuGet feed is for internal to Microsoft use only.
$dotnet5InternalFeed = 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal/nuget/v3/index.json'
$updatedNugetFile = (Get-Content .\nuget.config -Raw) -replace "</packageSources>", " <add key=`"dotnet5-internal`" value=`"$dotnet5InternalFeed`" />`r`n </packageSources>"
Expand Down