Skip to content

[ci] Use variables to control system .NET SDK installs #22694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/common/core-templates/job/source-index-stage1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ jobs:
- ${{ preStep }}

- task: UseDotNet@2
displayName: Use .NET 8 SDK
displayName: Use .NET $(DotNetSdkVersion) SDK
inputs:
packageType: sdk
version: 8.0.x
version: $(DotNetSdkVersion).x
installationPath: $(Agent.TempDirectory)/dotnet
workingDirectory: $(Agent.TempDirectory)

Expand Down
2 changes: 1 addition & 1 deletion tools/devops/automation/templates/mac/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ steps:

- task: UseDotNet@2
inputs:
version: 9.x
version: $(DotNetSdkVersion).x

- template: ../common/install-qa-provisioning-profiles.yml
parameters:
Expand Down
4 changes: 2 additions & 2 deletions tools/devops/automation/templates/main-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ stages:
startsWith(variables['Build.SourceBranch'], 'refs/heads/release-test/'),
eq(variables['Build.SourceBranch'], 'refs/heads/net7.0'),
eq(variables['Build.SourceBranch'], 'refs/heads/net8.0'),
eq(variables['Build.SourceBranch'], 'refs/heads/net9.0'),
eq(variables['Build.SourceBranch'], 'refs/heads/net10.0'),
eq(variables['Build.SourceBranch'], 'refs/heads/net$(DotNetSdkVersion)'),
eq(variables['Build.SourceBranch'], 'refs/heads/net$(DotNetPreviewSdkVersion)'),
eq(variables['Build.SourceBranch'], 'refs/heads/xcode16'),
eq(parameters.forceInsertion, true)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ stages:
displayName: Create credscan dummy ignore file

- task: UseDotNet@2
displayName: Install .NET 9.x
displayName: Install .NET $(DotNetSdkVersion)
inputs:
version: 9.x
version: $(DotNetSdkVersion).x
includePreviewVersions: true

- task: DownloadPipelineArtifact@2
Expand Down
2 changes: 1 addition & 1 deletion tools/devops/automation/templates/tests/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ steps:

- task: UseDotNet@2
inputs:
version: 9.x
version: $(DotNetSdkVersion).x

- bash: |
set -x
Expand Down
5 changes: 5 additions & 0 deletions tools/devops/automation/templates/variables/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,8 @@ variables:
- name: VSDropsPrefix
value: 'https://vsdrop.corp.microsoft.com/file/v1/$(BUILD_REPOSITORY_TITLE)/device-tests'

- name: DotNetSdkVersion
value: 9.0

- name: DotNetPreviewSdkVersion
value: 10.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the .NET 10 preview in the stable .NET 9 branch? If not, I think this should be 9.0 in .NET 9 branch(es) and then bumped to .NET 10 in net10.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing explicitly needs it. I kept this at 10.0 so that it can be used in the list of branch triggers in main-stage.yml,
and updated vs-insertion-prep.yml to continue to use the stable version on main instead.

2 changes: 1 addition & 1 deletion tools/devops/automation/templates/windows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ steps:

- task: UseDotNet@2
inputs:
version: 9.x
version: $(DotNetSdkVersion).x

- pwsh: '& "$(Build.SourcesDirectory)/$Env:BUILD_REPOSITORY_TITLE/tools/devops/automation/scripts/initialize-test-output-variables.ps1"'
displayName: Set output variables
Expand Down
2 changes: 1 addition & 1 deletion tools/devops/automation/templates/windows/reserve-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ steps:

- task: UseDotNet@2
inputs:
version: 9.x
version: $(DotNetSdkVersion).x

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