11parameters :
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 :
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)
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)
0 commit comments