11parameters :
22 runAsPublic : false
3- sourceIndexPackageVersion : 1.0.1-20230228.2
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 : []
@@ -14,15 +15,15 @@ jobs:
1415 dependsOn : ${{ parameters.dependsOn }}
1516 condition : ${{ parameters.condition }}
1617 variables :
17- - name : SourceIndexPackageVersion
18- value : ${{ parameters.sourceIndexPackageVersion }}
18+ - name : SourceIndexUploadPackageVersion
19+ value : ${{ parameters.sourceIndexUploadPackageVersion }}
20+ - name : SourceIndexProcessBinlogPackageVersion
21+ value : ${{ parameters.sourceIndexProcessBinlogPackageVersion }}
1922 - name : SourceIndexPackageSource
2023 value : ${{ parameters.sourceIndexPackageSource }}
2124 - name : BinlogPath
2225 value : ${{ parameters.binlogPath }}
23- - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }} :
24- - group : source-dot-net stage1 variables
25- - template : /eng/common/templates-official/variables/pool-providers.yml
26+ - template : /eng/common/templates/variables/pool-providers.yml
2627
2728 ${{ if ne(parameters.pool, '') }} :
2829 pool : ${{ parameters.pool }}
@@ -33,24 +34,23 @@ jobs:
3334 demands : ImageOverride -equals windows.vs2019.amd64.open
3435 ${{ if eq(variables['System.TeamProject'], 'internal') }} :
3536 name : $(DncEngInternalBuildPool)
36- image : windows.vs2022.amd64
37- os : windows
37+ demands : ImageOverride -equals windows.vs2019.amd64
3838
3939 steps :
4040 - ${{ each preStep in parameters.preSteps }} :
4141 - ${{ preStep }}
4242
4343 - task : UseDotNet@2
44- displayName : Use .NET Core SDK 6
44+ displayName : Use .NET 8 SDK
4545 inputs :
4646 packageType : sdk
47- version : 6 .0.x
47+ version : 8 .0.x
4848 installationPath : $(Agent.TempDirectory)/dotnet
4949 workingDirectory : $(Agent.TempDirectory)
5050
5151 - script : |
52- $(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version $(SourceIndexPackageVersion ) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
53- $(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version $(SourceIndexPackageVersion ) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
52+ $(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version $(sourceIndexProcessBinlogPackageVersion ) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
53+ $(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version $(sourceIndexUploadPackageVersion ) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools
5454 displayName: Download Tools
5555 # Set working directory to temp directory so 'dotnet' doesn't try to use global.json and use the repo's sdk.
5656 workingDirectory: $(Agent.TempDirectory)
6262 displayName : Process Binlog into indexable sln
6363
6464 - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }} :
65- - script : $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name)
66- displayName : Upload stage1 artifacts to source index
67- env :
68- BLOB_CONTAINER_URL : $(source-dot-net-stage1-blob-container-url)
65+ - task : AzureCLI@2
66+ displayName : Get stage 1 auth token
67+ inputs :
68+ azureSubscription : ' SourceDotNet Stage1 Publish'
69+ addSpnToEnvironment : true
70+ scriptType : ' ps'
71+ scriptLocation : ' inlineScript'
72+ inlineScript : |
73+ echo "##vso[task.setvariable variable=ARM_CLIENT_ID]$env:servicePrincipalId"
74+ echo "##vso[task.setvariable variable=ARM_ID_TOKEN]$env:idToken"
75+ echo "##vso[task.setvariable variable=ARM_TENANT_ID]$env:tenantId"
76+
77+ - script : |
78+ echo "Client ID: $(ARM_CLIENT_ID)"
79+ echo "ID Token: $(ARM_ID_TOKEN)"
80+ echo "Tenant ID: $(ARM_TENANT_ID)"
81+ az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN)
82+ displayName: "Login to Azure"
83+
84+ - script : $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1
85+ displayName : Upload stage1 artifacts to source index
0 commit comments