Compare commits
4 commits
master
...
FixDotnetU
Author | SHA1 | Date | |
---|---|---|---|
41d90e60af | |||
7df0c1b0cc | |||
c87f2c2804 | |||
dd6ef97685 |
5
.github/workflows/daily.yml
vendored
5
.github/workflows/daily.yml
vendored
|
@ -34,7 +34,7 @@ jobs:
|
|||
Write-Verbose "OLD_VERSION=$currentVersion" -Verbose
|
||||
"OLD_VERSION=$currentVersion" | Out-File $env:GITHUB_ENV -Append
|
||||
|
||||
./tools/UpdateDotnetRuntime.ps1 -UpdateMSIPackaging
|
||||
./tools/UpdateDotnetRuntime.ps1 -UpdateMSIPackaging -UseInternalFeed
|
||||
$newVersion = (Get-Content .\global.json | ConvertFrom-Json).sdk.version
|
||||
Write-Verbose "NEW_VERSION=$newVersion" -Verbose
|
||||
"NEW_VERSION=$newVersion" | Out-File $env:GITHUB_ENV -Append
|
||||
|
@ -48,8 +48,9 @@ jobs:
|
|||
if: failure()
|
||||
with:
|
||||
webhook_url: ${{ secrets.PS_BUILD_TEAMS_CHANNEL }}
|
||||
overwrite: "{title: `Failure in updating .NET build. Look at ${workflow_link}`}"
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v2
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
id: cpr
|
||||
if: env.CREATE_PR == 'true'
|
||||
with:
|
||||
|
|
|
@ -187,17 +187,23 @@ function Get-DotnetUpdate {
|
|||
|
||||
try {
|
||||
|
||||
$latestSDKVersionString = Invoke-RestMethod -Uri "http://aka.ms/dotnet/$channel/$quality/sdk-productVersion.txt" -ErrorAction Stop | ForEach-Object { $_.Trim() }
|
||||
$selectedQuality = $quality
|
||||
try {
|
||||
$latestSDKVersionString = Invoke-RestMethod -Uri "http://aka.ms/dotnet/$channel/$quality/sdk-productVersion.txt" -ErrorAction Stop | ForEach-Object { $_.Trim() }
|
||||
$selectedQuality = $quality
|
||||
} catch {
|
||||
if ($_.exception.Response.StatusCode -eq 'NotFound') {
|
||||
Write-Verbose "Build not found for Channel: $Channel and Quality: $Quality" -Verbose
|
||||
} else {
|
||||
throw $_
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $latestSDKVersionString.StartsWith($sdkImageVersion))
|
||||
{
|
||||
if (-not $latestSDKVersionString -or -not $latestSDKVersionString.StartsWith($sdkImageVersion)) {
|
||||
# we did not get a version number so fall back to daily
|
||||
$latestSDKVersionString = Invoke-RestMethod -Uri "http://aka.ms/dotnet/$channel/$qualityFallback/sdk-productVersion.txt" -ErrorAction Stop | ForEach-Object { $_.Trim() }
|
||||
$selectedQuality = $qualityFallback
|
||||
|
||||
if (-not $latestSDKVersionString.StartsWith($sdkImageVersion))
|
||||
{
|
||||
if (-not $latestSDKVersionString.StartsWith($sdkImageVersion)) {
|
||||
throw "No build found!"
|
||||
}
|
||||
}
|
||||
|
@ -272,8 +278,15 @@ if ($dotnetUpdate.ShouldUpdate) {
|
|||
if ($feedname -eq 'dotnet-internal') {
|
||||
# This NuGet feed is for internal to Microsoft use only.
|
||||
$dotnetInternalFeed = $dotnetMetadataJson.internalfeed.url
|
||||
$updatedNugetFile = $nugetFileContent -replace "</packageSources>", " <add key=`"dotnet-internal`" value=`"$dotnetInternalFeed`" />`r`n </packageSources>"
|
||||
|
||||
$updatedNugetFile = if ($nugetFileContent.Contains('dotnet-internal')) {
|
||||
$nugetFileContent -replace ".<add key=`"dotnet-internal?.*', ' <add key=`"dotnet-internal`" value=`"$dotnetInternalFeed`" />`r`n </packageSources>"
|
||||
} else {
|
||||
$nugetFileContent -replace "</packageSources>", " <add key=`"dotnet-internal`" value=`"$dotnetInternalFeed`" />`r`n </packageSources>"
|
||||
}
|
||||
|
||||
$updatedNugetFile | Out-File "$PSScriptRoot/../nuget.config" -Force
|
||||
|
||||
Register-PackageSource -Name 'dotnet-internal' -Location $dotnetInternalFeed -ProviderName NuGet
|
||||
Write-Verbose -Message "Register new package source 'dotnet-internal'" -verbose
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue