File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,11 +11,16 @@ Install the .NET Core SDK at the specified path.
1111. PARAMETER InstallPath
1212The path where the .NET Core SDK is to be installed.
1313
14+ . PARAMETER Channel
15+ The version of the .NET Core SDK to be installed.
16+
1417#>
1518[cmdletbinding ()]
1619param (
1720 [string ]
18- $InstallPath
21+ $InstallPath ,
22+ [string ]
23+ $Channel = " 9.0"
1924)
2025
2126Set-StrictMode - Version Latest
@@ -40,7 +45,7 @@ if (!(Test-Path $DotnetInstallScriptPath)) {
4045 & " $PSScriptRoot /Invoke-WithRetry.ps1" " Invoke-WebRequest 'https://builds.dotnet.microsoft.com/dotnet/scripts/v1/$DotnetInstallScript ' -OutFile $DotnetInstallScriptPath "
4146}
4247
43- $DotnetChannel = " 9.0 "
48+ $DotnetChannel = $Channel
4449
4550$InstallFailed = $false
4651if ($IsRunningOnUnix ) {
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ parameters:
77 type : boolean
88 default : false
99 displayName : CG Dry Run
10+ # See https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script#options for possible Channel values
11+ - name : dotnetVersionChannel
12+ type : string
13+ default : ' 9.0'
14+ displayName : .NET Version
1015
1116jobs :
1217- job : BuildProjects
1722 os : linux
1823 steps :
1924 - powershell : >
20- ./eng/common/Install-DotNetSdk.ps1 /usr/share/.dotnet
25+ ./eng/common/Install-DotNetSdk.ps1 -Channel ${{ parameters.dotnetVersionChannel }} -InstallPath " /usr/share/.dotnet"
2126 displayName: Run Dotnet Install Script
2227 - script : >
2328 find . -name '*.csproj' | grep $(cgBuildGrepArgs) | xargs -n 1 /usr/share/.dotnet/dotnet build
2934 - powershell : |
3035 Write-Host "##vso[build.updatebuildnumber]$env:BUILD_BUILDNUMBER (Dry run)"
3136 Write-Host "##vso[build.addbuildtag]dry-run"
32-
37+
3338 if ("$(officialBranches)".Split(',').Contains("$(Build.SourceBranch)"))
3439 {
3540 Write-Host "##vso[task.logissue type=error]Cannot run a CG dry-run build from an official branch ($(officialBranches))."
You can’t perform that action at this time.
0 commit comments