Skip to content

Commit cc61242

Browse files
authored
[release/6.0.4xx] Switch to dSAS for internal runtimes (#41914)
2 parents 902e113 + 9ffffc7 commit cc61242

22 files changed

+298
-53
lines changed

.vsts-ci-richnav.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ pr: none
1010
variables:
1111
- name: teamName
1212
value: Roslyn-Project-System
13-
- name: _DotNetPublishToBlobFeed
14-
value: false
15-
- name: _DotNetArtifactsCategory
16-
value: .NETCore
17-
- name: _DotNetValidationArtifactsCategory
18-
value: .NETCore
1913
- name: _PublishToAzure
2014
value: false
2115
- name: PostBuildSign
@@ -52,6 +46,7 @@ stages:
5246
- _SignArgs: ''
5347
- _InternalRuntimeDownloadArgs: ''
5448
steps:
49+
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
5550
- powershell: eng\common\build.ps1
5651
-restore
5752
-ci
@@ -67,7 +62,6 @@ stages:
6762
displayName: Build
6863
env:
6964
BuildConfig: $(_BuildConfig)
70-
BlobFeedUrl: $(PB_PublishBlobFeedUrl)
7165
PublishType: $(_PublishType)
7266
TestFullMSBuild: 'true'
7367
SYSTEM_ACCESSTOKEN: $(System.AccessToken)

.vsts-ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@ variables:
2222
- name: _InternalRuntimeDownloadArgs
2323
value: ''
2424
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
25-
- name: _DotNetPublishToBlobFeed
26-
value: true
2725
- name: Codeql.Enabled
2826
value: true
29-
- group: DotNetBuilds storage account read tokens
3027
- name: _InternalRuntimeDownloadArgs
3128
value: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal
3229
/p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
@@ -104,6 +101,7 @@ extends:
104101
value: ''
105102
- template: /eng/common/templates-official/job/source-build.yml@self
106103
parameters:
104+
enableInternalSources: true
107105
platform:
108106
name: 'Managed'
109107
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343'

.vsts-pr.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,16 @@ pr:
1717
variables:
1818
- name: teamName
1919
value: Roslyn-Project-System
20-
- name: _DotNetPublishToBlobFeed
21-
value: false
2220
- name: _CIBuild
2321
value: -restore -build -sign -pack -ci
24-
- name: _DotNetArtifactsCategory
25-
value: .NETCore
26-
- name: _DotNetValidationArtifactsCategory
27-
value: .NETCore
2822
- name: PostBuildSign
2923
value: true
3024
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
3125
- name: _InternalRuntimeDownloadArgs
3226
value: ''
3327
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
34-
- name: _DotNetPublishToBlobFeed
35-
value: true
3628
- name: Codeql.Enabled
3729
value: true
38-
- group: DotNetBuilds storage account read tokens
3930
- name: _InternalRuntimeDownloadArgs
4031
value: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal
4132
/p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
@@ -85,6 +76,7 @@ stages:
8576
_Test: ''
8677
- template: /eng/common/templates/job/source-build.yml
8778
parameters:
79+
enableInternalSources: true
8880
platform:
8981
name: 'Managed'
9082
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343'

eng/Version.Details.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,22 +295,22 @@
295295
</Dependency>
296296
</ProductDependencies>
297297
<ToolsetDependencies>
298-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.24266.4">
298+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.24326.2">
299299
<Uri>https://github.com/dotnet/arcade</Uri>
300-
<Sha>2eab07c3d7b78219d10099b19fafeef2ecae1779</Sha>
300+
<Sha>1844d819e6f33f1106083c5066ea01e0310eefa3</Sha>
301301
<SourceBuild RepoName="arcade" ManagedOnly="true" />
302302
</Dependency>
303-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.24266.4">
303+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.24326.2">
304304
<Uri>https://github.com/dotnet/arcade</Uri>
305-
<Sha>2eab07c3d7b78219d10099b19fafeef2ecae1779</Sha>
305+
<Sha>1844d819e6f33f1106083c5066ea01e0310eefa3</Sha>
306306
</Dependency>
307-
<Dependency Name="Microsoft.DotNet.SignTool" Version="6.0.0-beta.24266.4">
307+
<Dependency Name="Microsoft.DotNet.SignTool" Version="6.0.0-beta.24326.2">
308308
<Uri>https://github.com/dotnet/arcade</Uri>
309-
<Sha>2eab07c3d7b78219d10099b19fafeef2ecae1779</Sha>
309+
<Sha>1844d819e6f33f1106083c5066ea01e0310eefa3</Sha>
310310
</Dependency>
311-
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="6.0.0-beta.24266.4">
311+
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="6.0.0-beta.24326.2">
312312
<Uri>https://github.com/dotnet/arcade</Uri>
313-
<Sha>2eab07c3d7b78219d10099b19fafeef2ecae1779</Sha>
313+
<Sha>1844d819e6f33f1106083c5066ea01e0310eefa3</Sha>
314314
</Dependency>
315315
<Dependency Name="System.Reflection.MetadataLoadContext" Version="6.0.0">
316316
<Uri>https://github.com/dotnet/runtime</Uri>

eng/Versions.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<SystemDiagnosticsFileVersionInfoVersion>4.0.0</SystemDiagnosticsFileVersionInfoVersion>
3131
<SystemReflectionMetadataVersion>6.0.0</SystemReflectionMetadataVersion>
3232
<SystemSecurityCryptographyPkcsPackageVersion>6.0.4</SystemSecurityCryptographyPkcsPackageVersion>
33-
<MicrosoftDotNetSignToolVersion>6.0.0-beta.24266.4</MicrosoftDotNetSignToolVersion>
33+
<MicrosoftDotNetSignToolVersion>6.0.0-beta.24326.2</MicrosoftDotNetSignToolVersion>
3434
<MicrosoftWebXdtPackageVersion>3.1.0</MicrosoftWebXdtPackageVersion>
3535
<SystemCollectionsSpecializedPackageVersion>4.3.0</SystemCollectionsSpecializedPackageVersion>
3636
<SystemXmlXmlDocumentPackageVersion>4.3.0</SystemXmlXmlDocumentPackageVersion>
@@ -174,7 +174,7 @@
174174
<PropertyGroup>
175175
<FluentAssertionsVersion>4.19.2</FluentAssertionsVersion>
176176
<FluentAssertionsJsonVersion>4.19.0</FluentAssertionsJsonVersion>
177-
<MicrosoftDotNetXUnitExtensionsVersion>6.0.0-beta.24266.4</MicrosoftDotNetXUnitExtensionsVersion>
177+
<MicrosoftDotNetXUnitExtensionsVersion>6.0.0-beta.24326.2</MicrosoftDotNetXUnitExtensionsVersion>
178178
<MoqPackageVersion>4.8.2</MoqPackageVersion>
179179
<MicrosoftDotNetInstallerWindowsSecurityTestDataPackageVersion>6.0.0-beta.22262.1</MicrosoftDotNetInstallerWindowsSecurityTestDataPackageVersion>
180180
</PropertyGroup>

eng/build-pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ jobs:
6464
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
6565
env:
6666
Token: $(dn-bot-dnceng-artifact-feeds-rw)
67+
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
68+
6769
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
6870
- powershell: eng\common\build.ps1
6971
$(_CIBuild)

eng/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ jobs:
7575
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
7676
env:
7777
Token: $(dn-bot-dnceng-artifact-feeds-rw)
78+
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
7879
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
7980
- powershell: eng\common\build.ps1
8081
$(_CIBuild)

eng/common/templates-official/job/source-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ parameters:
3131
# container and pool.
3232
platform: {}
3333

34+
# If set to true and running on a non-public project,
35+
# Internal blob storage locations will be enabled.
36+
# This is not enabled by default because many repositories do not need internal sources
37+
# and do not need to have the required service connections approved in the pipeline.
38+
enableInternalSources: false
39+
3440
jobs:
3541
- job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }}
3642
displayName: Source-Build (${{ parameters.platform.name }})
@@ -59,6 +65,8 @@ jobs:
5965
clean: all
6066

6167
steps:
68+
- ${{ if eq(parameters.enableInternalSources, true) }}:
69+
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
6270
- template: /eng/common/templates-official/steps/source-build.yml
6371
parameters:
6472
platform: ${{ parameters.platform }}

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

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
parameters:
22
runAsPublic: false
3-
sourceIndexPackageVersion: 1.0.1-20240320.1
3+
sourceIndexUploadPackageVersion: 2.0.0-20240502.12
4+
sourceIndexProcessBinlogPackageVersion: 1.0.1-20240129.2
45
sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
56
sourceIndexBuildCommand: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "eng/common/build.ps1 -restore -build -binarylog -ci"
67
preSteps: []
@@ -17,14 +18,14 @@ jobs:
1718
dependsOn: ${{ parameters.dependsOn }}
1819
condition: ${{ parameters.condition }}
1920
variables:
20-
- name: SourceIndexPackageVersion
21-
value: ${{ parameters.sourceIndexPackageVersion }}
21+
- name: SourceIndexUploadPackageVersion
22+
value: ${{ parameters.sourceIndexUploadPackageVersion }}
23+
- name: SourceIndexProcessBinlogPackageVersion
24+
value: ${{ parameters.sourceIndexProcessBinlogPackageVersion }}
2225
- name: SourceIndexPackageSource
2326
value: ${{ parameters.sourceIndexPackageSource }}
2427
- name: BinlogPath
2528
value: ${{ parameters.binlogPath }}
26-
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
27-
- group: source-dot-net stage1 variables
2829

2930
pool: ${{ parameters.pool }}
3031
steps:
@@ -40,8 +41,8 @@ jobs:
4041
workingDirectory: $(Agent.TempDirectory)
4142

4243
- script: |
43-
$(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version $(SourceIndexPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
44-
$(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version $(SourceIndexPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
44+
$(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version $(sourceIndexProcessBinlogPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
45+
$(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version $(sourceIndexUploadPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
4546
displayName: Download Tools
4647
# Set working directory to temp directory so 'dotnet' doesn't try to use global.json and use the repo's sdk.
4748
workingDirectory: $(Agent.TempDirectory)
@@ -53,7 +54,21 @@ jobs:
5354
displayName: Process Binlog into indexable sln
5455

5556
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
56-
- script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name)
57+
- task: AzureCLI@2
58+
displayName: Get stage 1 auth token
59+
inputs:
60+
azureSubscription: 'SourceDotNet Stage1 Publish'
61+
addSpnToEnvironment: true
62+
scriptType: 'ps'
63+
scriptLocation: 'inlineScript'
64+
inlineScript: |
65+
echo "##vso[task.setvariable variable=ARM_CLIENT_ID;issecret=true]$env:servicePrincipalId"
66+
echo "##vso[task.setvariable variable=ARM_ID_TOKEN;issecret=true]$env:idToken"
67+
echo "##vso[task.setvariable variable=ARM_TENANT_ID;issecret=true]$env:tenantId"
68+
69+
- script: |
70+
az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN)
71+
displayName: "Login to Azure"
72+
73+
- script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1
5774
displayName: Upload stage1 artifacts to source index
58-
env:
59-
BLOB_CONTAINER_URL: $(source-dot-net-stage1-blob-container-url)

eng/common/templates-official/jobs/source-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ parameters:
2121
# one job runs on 'defaultManagedPlatform'.
2222
platforms: []
2323

24+
# If set to true and running on a non-public project,
25+
# Internal nuget and blob storage locations will be enabled.
26+
# This is not enabled by default because many repositories do not need internal sources
27+
# and do not need to have the required service connections approved in the pipeline.
28+
enableInternalSources: false
29+
2430
jobs:
2531

2632
- ${{ if ne(parameters.allCompletedJobId, '') }}:
@@ -38,9 +44,11 @@ jobs:
3844
parameters:
3945
jobNamePrefix: ${{ parameters.jobNamePrefix }}
4046
platform: ${{ platform }}
47+
enableInternalSources: ${{ parameters.enableInternalSources }}
4148

4249
- ${{ if eq(length(parameters.platforms), 0) }}:
4350
- template: /eng/common/templates-official/job/source-build.yml
4451
parameters:
4552
jobNamePrefix: ${{ parameters.jobNamePrefix }}
4653
platform: ${{ parameters.defaultManagedPlatform }}
54+
enableInternalSources: ${{ parameters.enableInternalSources }}

0 commit comments

Comments
 (0)