Skip to content

Commit 7492fa4

Browse files
committed
[ci] Use variables to control system .NET SDK installs
I noticed the net10.0 branch build was failing during the "generate and publish BAR manifest" step with: D:\a\_work\1\s\dotnet\package\common.csproj(151,5): error MSB4062: The "PushToBuildStorage" task could not be loaded from the assembly D:\a\_work\1\s\packages\microsoft.dotnet.build.tasks.feed\10.0.0-beta.25228.101\build\../tools/net/Microsoft.DotNet.Build.Tasks.Feed.dll. Could not load file or assembly 'System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. The Microsoft.DotNet.Build.Tasks.Feed tasks are seemingly now being built against .NET 10, so we'll need to install .NET 10 to run them. Variables that represent the current stable and preview versions of .NET have been added to be used throughout the pipeline. These will now only need to be updated in one place when a new major release comes around.
1 parent 20bb42b commit 7492fa4

File tree

8 files changed

+15
-10
lines changed

8 files changed

+15
-10
lines changed

eng/common/core-templates/job/source-index-stage1.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ jobs:
4949
- ${{ preStep }}
5050

5151
- task: UseDotNet@2
52-
displayName: Use .NET 8 SDK
52+
displayName: Use .NET $(DotNetSdkVersion) SDK
5353
inputs:
5454
packageType: sdk
55-
version: 8.0.x
55+
version: $(DotNetSdkVersion).x
5656
installationPath: $(Agent.TempDirectory)/dotnet
5757
workingDirectory: $(Agent.TempDirectory)
5858

tools/devops/automation/templates/mac/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ steps:
160160

161161
- task: UseDotNet@2
162162
inputs:
163-
version: 9.x
163+
version: $(DotNetSdkVersion).x
164164

165165
- template: ../common/install-qa-provisioning-profiles.yml
166166
parameters:

tools/devops/automation/templates/main-stage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ stages:
115115
startsWith(variables['Build.SourceBranch'], 'refs/heads/release-test/'),
116116
eq(variables['Build.SourceBranch'], 'refs/heads/net7.0'),
117117
eq(variables['Build.SourceBranch'], 'refs/heads/net8.0'),
118-
eq(variables['Build.SourceBranch'], 'refs/heads/net9.0'),
119-
eq(variables['Build.SourceBranch'], 'refs/heads/net10.0'),
118+
eq(variables['Build.SourceBranch'], 'refs/heads/net$(DotNetSdkVersion)'),
119+
eq(variables['Build.SourceBranch'], 'refs/heads/net$(DotNetPreviewSdkVersion)'),
120120
eq(variables['Build.SourceBranch'], 'refs/heads/xcode16'),
121121
eq(parameters.forceInsertion, true)
122122
)

tools/devops/automation/templates/release/vs-insertion-prep.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ stages:
145145
displayName: Create credscan dummy ignore file
146146
147147
- task: UseDotNet@2
148-
displayName: Install .NET 9.x
148+
displayName: Install .NET $(DotNetPreviewSdkVersion)
149149
inputs:
150-
version: 9.x
150+
version: $(DotNetPreviewSdkVersion).x
151151
includePreviewVersions: true
152152

153153
- task: DownloadPipelineArtifact@2

tools/devops/automation/templates/tests/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ steps:
227227

228228
- task: UseDotNet@2
229229
inputs:
230-
version: 9.x
230+
version: $(DotNetSdkVersion).x
231231

232232
- bash: |
233233
set -x

tools/devops/automation/templates/variables/common.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,8 @@ variables:
6464
- name: VSDropsPrefix
6565
value: 'https://vsdrop.corp.microsoft.com/file/v1/$(BUILD_REPOSITORY_TITLE)/device-tests'
6666

67+
- name: DotNetSdkVersion
68+
value: 9.0
69+
70+
- name: DotNetPreviewSdkVersion
71+
value: 10.0

tools/devops/automation/templates/windows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ steps:
9797

9898
- task: UseDotNet@2
9999
inputs:
100-
version: 9.x
100+
version: $(DotNetSdkVersion).x
101101

102102
- pwsh: '& "$(Build.SourcesDirectory)/$Env:BUILD_REPOSITORY_TITLE/tools/devops/automation/scripts/initialize-test-output-variables.ps1"'
103103
displayName: Set output variables

tools/devops/automation/templates/windows/reserve-mac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ steps:
104104

105105
- task: UseDotNet@2
106106
inputs:
107-
version: 9.x
107+
version: $(DotNetSdkVersion).x
108108

109109
- bash: $(Build.SourcesDirectory)/$(BUILD_REPOSITORY_TITLE)/system-dependencies.sh --ignore-mono --ignore-visual-studio --ignore-mono --ignore-sharpie --ignore-shellcheck --ignore-yamllint --provision-simulators
110110
displayName: 'Provision simulators'

0 commit comments

Comments
 (0)