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
|
Write-Verbose "OLD_VERSION=$currentVersion" -Verbose
|
||||||
"OLD_VERSION=$currentVersion" | Out-File $env:GITHUB_ENV -Append
|
"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
|
$newVersion = (Get-Content .\global.json | ConvertFrom-Json).sdk.version
|
||||||
Write-Verbose "NEW_VERSION=$newVersion" -Verbose
|
Write-Verbose "NEW_VERSION=$newVersion" -Verbose
|
||||||
"NEW_VERSION=$newVersion" | Out-File $env:GITHUB_ENV -Append
|
"NEW_VERSION=$newVersion" | Out-File $env:GITHUB_ENV -Append
|
||||||
|
@ -48,8 +48,9 @@ jobs:
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
webhook_url: ${{ secrets.PS_BUILD_TEAMS_CHANNEL }}
|
webhook_url: ${{ secrets.PS_BUILD_TEAMS_CHANNEL }}
|
||||||
|
overwrite: "{title: `Failure in updating .NET build. Look at ${workflow_link}`}"
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v2
|
uses: peter-evans/create-pull-request@v3
|
||||||
id: cpr
|
id: cpr
|
||||||
if: env.CREATE_PR == 'true'
|
if: env.CREATE_PR == 'true'
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -187,17 +187,23 @@ function Get-DotnetUpdate {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$latestSDKVersionString = Invoke-RestMethod -Uri "http://aka.ms/dotnet/$channel/$quality/sdk-productVersion.txt" -ErrorAction Stop | ForEach-Object { $_.Trim() }
|
try {
|
||||||
$selectedQuality = $quality
|
$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
|
# 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() }
|
$latestSDKVersionString = Invoke-RestMethod -Uri "http://aka.ms/dotnet/$channel/$qualityFallback/sdk-productVersion.txt" -ErrorAction Stop | ForEach-Object { $_.Trim() }
|
||||||
$selectedQuality = $qualityFallback
|
$selectedQuality = $qualityFallback
|
||||||
|
|
||||||
if (-not $latestSDKVersionString.StartsWith($sdkImageVersion))
|
if (-not $latestSDKVersionString.StartsWith($sdkImageVersion)) {
|
||||||
{
|
|
||||||
throw "No build found!"
|
throw "No build found!"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -272,8 +278,15 @@ if ($dotnetUpdate.ShouldUpdate) {
|
||||||
if ($feedname -eq 'dotnet-internal') {
|
if ($feedname -eq 'dotnet-internal') {
|
||||||
# This NuGet feed is for internal to Microsoft use only.
|
# This NuGet feed is for internal to Microsoft use only.
|
||||||
$dotnetInternalFeed = $dotnetMetadataJson.internalfeed.url
|
$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
|
$updatedNugetFile | Out-File "$PSScriptRoot/../nuget.config" -Force
|
||||||
|
|
||||||
Register-PackageSource -Name 'dotnet-internal' -Location $dotnetInternalFeed -ProviderName NuGet
|
Register-PackageSource -Name 'dotnet-internal' -Location $dotnetInternalFeed -ProviderName NuGet
|
||||||
Write-Verbose -Message "Register new package source 'dotnet-internal'" -verbose
|
Write-Verbose -Message "Register new package source 'dotnet-internal'" -verbose
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue