@@ -64,6 +64,9 @@ extends:
6464 repoRoot : $(Build.SourcesDirectory)\DSC
6565 ob_sdl_tsa_configFile : $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json
6666 ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
67+ ob_sdl_sbom_enabled : false
68+ ob_signing_setup_enabled : false
69+ ob_sdl_codeql_compiled_enabled : false
6770 steps :
6871 - checkout : self
6972 - pwsh : |
@@ -92,37 +95,66 @@ extends:
9295 signSrcPath : ' $(Build.SourcesDirectory)\out'
9396 ob_sdl_sbom_enabled : true
9497 ob_signing_setup_enabled : true
95- ob_sdl_codeql_compiled_enabled : false
98+ ob_sdl_codeql_compiled_enabled : true
9699 pool :
97100 type : windows
98101 displayName : BuildWin
99102 steps :
100103 - checkout : self
101- env :
104+ env :
102105 ob_restore_phase : true
103106 - task : CodeQL3000Init@0 # Add CodeQL Init task right before your 'Build' step.
104107 inputs :
105108 Enabled : true
106109 AnalyzeInPipeline : true
107110 Language : rust
108- env :
111+ env :
109112 ob_restore_phase : true
110113 - pwsh : |
111114 $tmpdir = "$(Agent.TempDirectory)"
112115 Write-Host "##vso[task.setvariable variable=CARGO_TARGET_DIR;]$tmpdir"
113116 displayName: 🛠️ Workaround for the LoadLibrary ACCESS_VIOLATION OneBranch issue
114- env:
117+ env:
118+ ob_restore_phase: true
119+ - task : RustInstaller@1
120+ inputs :
121+ rustVersion : ms-stable
122+ toolchainFeed : https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
123+ additionalTargets : $(buildName)
124+ displayName : Install Rust
125+ env :
126+ ob_restore_phase : true
127+ - task : AzureCLI@2
128+ inputs :
129+ azureSubscription : az-PowerShell-feed-ingestion
130+ scriptType : ' pscore'
131+ scriptLocation : ' inlineScript'
132+ inlineScript : |
133+ $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
134+
135+ # Set the access token as a secret, so it doesn't get leaked in the logs
136+ Write-Host "##vso[task.setsecret]$accessToken"
137+ $header = "Bearer $accessToken"
138+ Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN]$header"
139+ displayName : ' Get Azure DevOps Token'
140+ env :
115141 ob_restore_phase : true
116142 - pwsh : |
117143 Set-Location "$(Build.SourcesDirectory)/DSC"
144+ Write-Host "Use 'powershell' CFS"
145+ Add-Content -Path "./.cargo/config.toml" -Value '[source.crates-io]'
146+ Add-Content -Path "./.cargo/config.toml" -Value 'replace-with = "powershell"'
147+ Add-Content -Path "./.cargo/config.toml" -Value '[registry]'
148+ Add-Content -Path "./.cargo/config.toml" -Value 'global-credential-providers = ["cargo:token"]'
149+
118150 ./build.ps1 -Release -Architecture $(buildName) -SkipLinkCheck
119151 displayName: 'Build $(buildName)'
120- env:
152+ env:
121153 ob_restore_phase: true
122154 condition: succeeded()
123155 - task : CodeQL3000Finalize@0 # Add CodeQL Finalize task right after your 'Build' step.
124156 condition : always()
125- env :
157+ env :
126158 ob_restore_phase : true
127159 - pwsh : |
128160 $null = New-Item -ItemType Directory -Path "$(PackageRoot)" -ErrorAction Ignore
@@ -137,7 +169,7 @@ extends:
137169 write-host 'Binaries in $(signSrcPath)'
138170 dir -r "$(signSrcPath)"
139171 displayName: Copy built binaries
140- env:
172+ env:
141173 ob_restore_phase: true
142174 condition: succeeded()
143175 - task : onebranch.pipeline.signing@1
@@ -201,6 +233,9 @@ extends:
201233 signOutPath : $[ dependencies.BuildWin.outputs['signOutPath.signOutPath'] ]
202234 ob_sdl_tsa_configFile : $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json
203235 ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
236+ ob_sdl_sbom_enabled : false
237+ ob_signing_setup_enabled : false
238+ ob_sdl_codeql_compiled_enabled : false
204239 pool :
205240 type : windows
206241 steps :
@@ -220,7 +255,36 @@ extends:
220255 pool :
221256 type : linux
222257 steps :
258+ - task : RustInstaller@1
259+ inputs :
260+ rustVersion : ms-stable
261+ toolchainFeed : https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
262+ additionalTargets : x86_64-unknown-linux-gnu
263+ displayName : Install Rust
264+ env :
265+ ob_restore_phase : true
266+ - task : AzureCLI@2
267+ inputs :
268+ azureSubscription : az-PowerShell-feed-ingestion
269+ scriptType : ' pscore'
270+ scriptLocation : ' inlineScript'
271+ inlineScript : |
272+ $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
273+
274+ # Set the access token as a secret, so it doesn't get leaked in the logs
275+ Write-Host "##vso[task.setsecret]$accessToken"
276+ $header = "Bearer $accessToken"
277+ Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN]$header"
278+ displayName : ' Get Azure DevOps Token'
279+ env :
280+ ob_restore_phase : true
223281 - pwsh : |
282+ Write-Host "Use 'powershell' CFS"
283+ Add-Content -Path "./.cargo/config.toml" -Value '[source.crates-io]'
284+ Add-Content -Path "./.cargo/config.toml" -Value 'replace-with = "powershell"'
285+ Add-Content -Path "./.cargo/config.toml" -Value '[registry]'
286+ Add-Content -Path "./.cargo/config.toml" -Value 'global-credential-providers = ["cargo:token"]'
287+
224288 ./build.ps1 -Release -Architecture x86_64-unknown-linux-gnu
225289 ./build.ps1 -PackageType tgz -Architecture x86_64-unknown-linux-gnu -Release
226290 Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
@@ -237,7 +301,36 @@ extends:
237301 type : linux
238302 hostArchitecture : arm64
239303 steps :
304+ - task : RustInstaller@1
305+ inputs :
306+ rustVersion : ms-stable
307+ toolchainFeed : https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
308+ additionalTargets : aarch64-unknown-linux-gnu
309+ displayName : Install Rust
310+ env :
311+ ob_restore_phase : true
312+ - task : AzureCLI@2
313+ inputs :
314+ azureSubscription : az-PowerShell-feed-ingestion
315+ scriptType : ' pscore'
316+ scriptLocation : ' inlineScript'
317+ inlineScript : |
318+ $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
319+
320+ # Set the access token as a secret, so it doesn't get leaked in the logs
321+ Write-Host "##vso[task.setsecret]$accessToken"
322+ $header = "Bearer $accessToken"
323+ Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN]$header"
324+ displayName : ' Get Azure DevOps Token'
325+ env :
326+ ob_restore_phase : true
240327 - pwsh : |
328+ Write-Host "Use 'powershell' CFS"
329+ Add-Content -Path "./.cargo/config.toml" -Value '[source.crates-io]'
330+ Add-Content -Path "./.cargo/config.toml" -Value 'replace-with = "powershell"'
331+ Add-Content -Path "./.cargo/config.toml" -Value '[registry]'
332+ Add-Content -Path "./.cargo/config.toml" -Value 'global-credential-providers = ["cargo:token"]'
333+
241334 ./build.ps1 -Release -Architecture aarch64-unknown-linux-gnu
242335 ./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-gnu -Release
243336 Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
@@ -262,7 +355,41 @@ extends:
262355 macOS arm64 :
263356 buildName : aarch64-apple-darwin
264357 steps :
358+ - task : RustInstaller@1
359+ inputs :
360+ rustVersion : ms-stable
361+ toolchainFeed : https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
362+ additionalTargets : $(buildName)
363+ displayName : Install Rust
364+ env :
365+ ob_restore_phase : true
366+ - task : AzureCLI@2
367+ inputs :
368+ azureSubscription : az-PowerShell-feed-ingestion
369+ scriptType : ' pscore'
370+ scriptLocation : ' inlineScript'
371+ inlineScript : |
372+ $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv
373+
374+ # Set the access token as a secret, so it doesn't get leaked in the logs
375+ Write-Host "##vso[task.setsecret]$accessToken"
376+ $header = "Bearer $accessToken"
377+ Write-Host "##vso[task.setvariable variable=CARGO_REGISTRIES_POWERSHELL_TOKEN]$header"
378+ displayName : ' Get Azure DevOps Token'
379+ env :
380+ ob_restore_phase : true
265381 - pwsh : |
382+ Write-Host "Use 'powershell' CFS"
383+ Add-Content -Path "./.cargo/config.toml" -Value '[source.crates-io]'
384+ Add-Content -Path "./.cargo/config.toml" -Value 'replace-with = "powershell"'
385+ Add-Content -Path "./.cargo/config.toml" -Value '[registry]'
386+ Add-Content -Path "./.cargo/config.toml" -Value 'global-credential-providers = ["cargo:token"]'
387+
388+ $c = get-content "./.cargo/config.toml" | Out-String
389+ Write-Host $c
390+
391+ $env:CARGO_HTTP_DEBUG=true
392+ $env:CARGO_LOG='network=trace'
266393 ./build.ps1 -Release -Architecture $(buildName)
267394 ./build.ps1 -PackageType tgz -Architecture $(buildName) -Release
268395 Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
0 commit comments