Skip to content

[ci][net10.0] Use variables to control system .NET SDK installs #22704

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 2 commits into from
May 1, 2025
Merged
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 dotnet/package/common.csproj
Original file line number Diff line number Diff line change
@@ -129,9 +129,9 @@
<Error Condition="Exists($(AssetManifestPath))" Text="The manifest file '$(AssetManifestPath)' already exists." />

<ItemGroup>
<ItemsToPush Include="$(NupkgPath)\*.nupkg" />
<ItemsToPush Include="$(NupkgPath)\*.nupkg" Kind="Package" />
<WorkloadArtifacts Include="$(NupkgPath)\*.zip" />
<ItemsToPush Include="@(WorkloadArtifacts)" PublishFlatContainer="true" RelativeBlobPath="macios/$(_PackageVersion)/%(Filename)%(Extension)" />
<ItemsToPush Include="@(WorkloadArtifacts)" PublishFlatContainer="true" RelativeBlobPath="macios/$(_PackageVersion)/%(Filename)%(Extension)" Kind="Blob" />
</ItemGroup>

<Error Condition="'@(ItemsToPush)' == ''" Text="No packages to push." />
15 changes: 3 additions & 12 deletions eng/common/core-templates/steps/install-microbuild.yml
Original file line number Diff line number Diff line change
@@ -12,11 +12,12 @@ steps:
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
- ${{ if eq(parameters.enableMicrobuildForMacAndLinux, 'true') }}:
# Needed to download the MicroBuild plugin nupkgs on Mac and Linux when nuget.exe is unavailable
# Workaround for ESRP CLI on Linux - https://github.com/dotnet/source-build/issues/4964
- task: UseDotNet@2
displayName: Install .NET 8.0 SDK for MicroBuild Plugin
displayName: Install .NET $(DotNetSdkVersion) SDK for MicroBuild Plugin
inputs:
packageType: sdk
version: 8.0.x
version: $(DotNetSdkVersion).x
installationPath: ${{ parameters.microBuildOutputFolder }}/.dotnet
workingDirectory: ${{ parameters.microBuildOutputFolder }}
condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
@@ -49,17 +50,7 @@ steps:
)
))

# Workaround for ESRP CLI on Linux - https://github.com/dotnet/source-build/issues/4964
- ${{ if eq(parameters.enableMicrobuildForMacAndLinux, 'true') }}:
- task: UseDotNet@2
displayName: Install .NET 9.0 SDK for ESRP CLI Workaround
inputs:
packageType: sdk
version: 9.0.x
installationPath: ${{ parameters.microBuildOutputFolder }}/.dotnet
workingDirectory: ${{ parameters.microBuildOutputFolder }}
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))

- task: PowerShell@2
displayName: Workaround for ESRP CLI on Linux
inputs:
Original file line number Diff line number Diff line change
@@ -6,10 +6,10 @@ parameters:

steps:
- task: UseDotNet@2
displayName: "Source Index: 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)

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

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

- template: ../common/install-qa-provisioning-profiles.yml
parameters:
4 changes: 2 additions & 2 deletions tools/devops/automation/templates/main-stage.yml
Original file line number Diff line number Diff line change
@@ -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)
)
Original file line number Diff line number Diff line change
@@ -145,9 +145,9 @@ stages:
displayName: Create credscan dummy ignore file

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

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

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

- bash: |
set -x
5 changes: 5 additions & 0 deletions tools/devops/automation/templates/variables/common.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tools/devops/automation/templates/windows/build.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tools/devops/automation/templates/windows/reserve-mac.yml
Original file line number Diff line number Diff line change
@@ -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'