Compare commits

...

4 commits

Author SHA1 Message Date
Aditya Patwardhan 41d90e60af Avoid duplicate adds of dotnet-internal feed 2021-09-03 11:00:50 -07:00
Aditya Patwardhan 7df0c1b0cc Fix yaml 2021-09-02 11:28:15 -07:00
Aditya Patwardhan c87f2c2804 Improve Teams notification and update create pull request task version 2021-09-02 11:26:20 -07:00
Aditya Patwardhan dd6ef97685 Make changes to take RC branch SDK 2021-09-02 10:24:55 -07:00
2 changed files with 23 additions and 9 deletions

View file

@ -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:

View file

@ -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
}