Skip to content

Commit

Permalink
Update dependencies from https://github.com/dotnet/arcade build 20221…
Browse files Browse the repository at this point in the history
…108.2 (#29509)

[release/6.0] Update dependencies from dotnet/arcade
  • Loading branch information
dotnet-maestro[bot] authored Nov 9, 2022
1 parent 1bc2a3f commit 3d19b67
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 26 deletions.
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.22512.3">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.22558.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>bb1e72113a7eaf8bebda940beba8cf8bee1b453f</Sha>
<Sha>841e1fe0d2498a7ac6445e458ae521511ec226ca</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.22512.3">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.22558.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>bb1e72113a7eaf8bebda940beba8cf8bee1b453f</Sha>
<Sha>841e1fe0d2498a7ac6445e458ae521511ec226ca</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
38 changes: 38 additions & 0 deletions eng/common/sdl/sdl.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

function Install-Gdn {
param(
[Parameter(Mandatory=$true)]
[string]$Path,

# If omitted, install the latest version of Guardian, otherwise install that specific version.
[string]$Version
)

$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 2.0
$disableConfigureToolsetImport = $true
$global:LASTEXITCODE = 0

# `tools.ps1` checks $ci to perform some actions. Since the SDL
# scripts don't necessarily execute in the same agent that run the
# build.ps1/sh script this variable isn't automatically set.
$ci = $true
. $PSScriptRoot\..\tools.ps1

$argumentList = @("install", "Microsoft.Guardian.Cli", "-Source https://securitytools.pkgs.visualstudio.com/_packaging/Guardian/nuget/v3/index.json", "-OutputDirectory $Path", "-NonInteractive", "-NoCache")

if ($Version) {
$argumentList += "-Version $Version"
}

Start-Process nuget -Verbose -ArgumentList $argumentList -NoNewWindow -Wait

$gdnCliPath = Get-ChildItem -Filter guardian.cmd -Recurse -Path $Path

if (!$gdnCliPath)
{
Write-PipelineTelemetryError -Category 'Sdl' -Message 'Failure installing Guardian'
}

return $gdnCliPath.FullName
}
60 changes: 40 additions & 20 deletions eng/common/templates/steps/execute-sdl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,28 @@ parameters:
condition: ''

steps:
- ${{ if ne(parameters.overrideGuardianVersion, '') }}:
- powershell: |
$content = Get-Content $(GuardianPackagesConfigFile)
Write-Host "packages.config content was:`n$content"
$content = $content.Replace('$(DefaultGuardianVersion)', '$(GuardianVersion)')
$content | Set-Content $(GuardianPackagesConfigFile)
Write-Host "packages.config content updated to:`n$content"
displayName: Use overridden Guardian version ${{ parameters.overrideGuardianVersion }}
- task: NuGetAuthenticate@1
inputs:
nuGetServiceConnections: GuardianConnect

- task: NuGetToolInstaller@1
displayName: 'Install NuGet.exe'

- task: NuGetCommand@2
displayName: 'Install Guardian'
inputs:
restoreSolution: $(Build.SourcesDirectory)\eng\common\sdl\packages.config
feedsToUse: config
nugetConfigPath: $(Build.SourcesDirectory)\eng\common\sdl\NuGet.config
externalFeedCredentials: GuardianConnect
restoreDirectory: $(Build.SourcesDirectory)\.packages
- ${{ if ne(parameters.overrideGuardianVersion, '') }}:
- pwsh: |
Set-Location -Path $(Build.SourcesDirectory)\eng\common\sdl
. .\sdl.ps1
$guardianCliLocation = Install-Gdn -Path $(Build.SourcesDirectory)\.artifacts -Version ${{ parameters.overrideGuardianVersion }}
Write-Host "##vso[task.setvariable variable=GuardianCliLocation]$guardianCliLocation"
displayName: Install Guardian (Overridden)
- ${{ if eq(parameters.overrideGuardianVersion, '') }}:
- pwsh: |
Set-Location -Path $(Build.SourcesDirectory)\eng\common\sdl
. .\sdl.ps1
$guardianCliLocation = Install-Gdn -Path $(Build.SourcesDirectory)\.artifacts
Write-Host "##vso[task.setvariable variable=GuardianCliLocation]$guardianCliLocation"
displayName: Install Guardian
- ${{ if ne(parameters.overrideParameters, '') }}:
- powershell: ${{ parameters.executeAllSdlToolsScript }} ${{ parameters.overrideParameters }}
Expand All @@ -40,7 +39,7 @@ steps:

- ${{ if eq(parameters.overrideParameters, '') }}:
- powershell: ${{ parameters.executeAllSdlToolsScript }}
-GuardianPackageName Microsoft.Guardian.Cli.$(GuardianVersion)
-GuardianCliLocation $(GuardianCliLocation)
-NugetPackageDirectory $(Build.SourcesDirectory)\.packages
-AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw)
${{ parameters.additionalParameters }}
Expand All @@ -62,7 +61,28 @@ steps:
c
i
condition: succeededOrFailed()

- publish: $(Agent.BuildDirectory)/.gdn
artifact: GuardianConfiguration
displayName: Publish GuardianConfiguration
condition: succeededOrFailed()

# Publish the SARIF files in a container named CodeAnalysisLogs to enable integration
# with the "SARIF SAST Scans Tab" Azure DevOps extension
- task: CopyFiles@2
displayName: Copy SARIF files
inputs:
flattenFolders: true
sourceFolder: $(Agent.BuildDirectory)/.gdn/rc/
contents: '**/*.sarif'
targetFolder: $(Build.SourcesDirectory)/CodeAnalysisLogs
condition: succeededOrFailed()

# Use PublishBuildArtifacts because the SARIF extension only checks this case
# see microsoft/sarif-azuredevops-extension#4
- task: PublishBuildArtifacts@1
displayName: Publish SARIF files to CodeAnalysisLogs container
inputs:
pathToPublish: $(Build.SourcesDirectory)/CodeAnalysisLogs
artifactName: CodeAnalysisLogs
condition: succeededOrFailed()
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"rollForward": "latestMajor"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.22512.3",
"Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.22512.3"
"Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.22558.2",
"Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.22558.2"
}
}

0 comments on commit 3d19b67

Please sign in to comment.