Skip to content

Commit

Permalink
Merge from github release/6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mmitche committed Mar 14, 2022
1 parent d855ecd commit 33d17f8
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 24 deletions.
2 changes: 0 additions & 2 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-runtime -->
<add key="darc-int-dotnet-runtime-c24d9a9" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-c24d9a9c/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-runtime -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
Expand All @@ -19,7 +18,6 @@
<disabledPackageSources>
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-runtime -->
<add key="darc-int-dotnet-runtime-c24d9a9" value="true" />
<!-- End: Package sources from dotnet-runtime -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
</disabledPackageSources>
Expand Down
24 changes: 12 additions & 12 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>c24d9a9c91c5d04b7b4de71f1a9f33ac35e09663</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Wpf.DncEng" Version="6.0.0-rtm.22104.2">
<Dependency Name="Microsoft.DotNet.Wpf.DncEng" Version="6.0.0-rtm.22161.2">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int</Uri>
<Sha>962ab77e3d043ec9377feec32e1b26824338e9db</Sha>
<Sha>c8d46e6b93f648dd15d27210af19b62f98205daa</Sha>
</Dependency>
<Dependency Name="System.IO.Packaging" Version="6.0.0" CoherentParentDependency="Microsoft.Private.Winforms">
<Uri>https://github.com/dotnet/runtime</Uri>
Expand Down Expand Up @@ -83,25 +83,25 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.22107.2">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.22122.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>fe5cc1841d12196d94a4ae3b276cb92d8d7ca73d</Sha>
<Sha>7215d8265a7fbcd022eb72ff7a6e2048444c985f</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="6.0.0-beta.22107.2">
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="6.0.0-beta.22122.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>fe5cc1841d12196d94a4ae3b276cb92d8d7ca73d</Sha>
<Sha>7215d8265a7fbcd022eb72ff7a6e2048444c985f</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.22107.2">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.22122.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>fe5cc1841d12196d94a4ae3b276cb92d8d7ca73d</Sha>
<Sha>7215d8265a7fbcd022eb72ff7a6e2048444c985f</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="6.0.0-beta.22107.2">
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="6.0.0-beta.22122.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>fe5cc1841d12196d94a4ae3b276cb92d8d7ca73d</Sha>
<Sha>7215d8265a7fbcd022eb72ff7a6e2048444c985f</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenAPI" Version="6.0.0-beta.22107.2">
<Dependency Name="Microsoft.DotNet.GenAPI" Version="6.0.0-beta.22122.7">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>fe5cc1841d12196d94a4ae3b276cb92d8d7ca73d</Sha>
<Sha>7215d8265a7fbcd022eb72ff7a6e2048444c985f</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
8 changes: 4 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
</PropertyGroup>
<!-- Packages that come from https://github.com/dotnet/arcade -->
<PropertyGroup>
<MicrosoftDotNetApiCompatVersion>6.0.0-beta.22107.2</MicrosoftDotNetApiCompatVersion>
<MicrosoftDotNetCodeAnalysisPackageVersion>6.0.0-beta.22107.2</MicrosoftDotNetCodeAnalysisPackageVersion>
<MicrosoftDotNetGenAPIVersion>6.0.0-beta.22107.2</MicrosoftDotNetGenAPIVersion>
<MicrosoftDotNetApiCompatVersion>6.0.0-beta.22122.7</MicrosoftDotNetApiCompatVersion>
<MicrosoftDotNetCodeAnalysisPackageVersion>6.0.0-beta.22122.7</MicrosoftDotNetCodeAnalysisPackageVersion>
<MicrosoftDotNetGenAPIVersion>6.0.0-beta.22122.7</MicrosoftDotNetGenAPIVersion>
</PropertyGroup>
<!-- Maintain System.CodeDom PackageVersion at 4.4.0. See https://github.com/Microsoft/msbuild/issues/3627 -->
<!-- Pin specific versions of S.Memory so that it would supply AssemblyVersion=4.0.1.0. See https://github.com/dotnet/runtime/issues/31672 -->
Expand Down Expand Up @@ -97,6 +97,6 @@
<SystemReflectionMetadataLoadContextPackage>System.Reflection.MetadataLoadContext</SystemReflectionMetadataLoadContextPackage>
</PropertyGroup>
<PropertyGroup>
<MicrosoftDotNetWpfDncEngVersion>6.0.0-rtm.22104.2</MicrosoftDotNetWpfDncEngVersion>
<MicrosoftDotNetWpfDncEngVersion>6.0.0-rtm.22161.2</MicrosoftDotNetWpfDncEngVersion>
</PropertyGroup>
</Project>
19 changes: 19 additions & 0 deletions eng/common/generate-sbom-prep.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Param(
[Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed
)

Write-Host "Creating dir $ManifestDirPath"
# create directory for sbom manifest to be placed
if (!(Test-Path -path $ManifestDirPath))
{
New-Item -ItemType Directory -path $ManifestDirPath
Write-Host "Successfully created directory $ManifestDirPath"
}
else{
Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder."
}

Write-Host "Updating artifact name"
$artifact_name = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" -replace '["/:<>\\|?@*"() ]', '_'
Write-Host "Artifact name $artifact_name"
Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$artifact_name"
22 changes: 22 additions & 0 deletions eng/common/generate-sbom-prep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

source="${BASH_SOURCE[0]}"

manifest_dir=$1

if [ ! -d "$manifest_dir" ] ; then
mkdir -p "$manifest_dir"
echo "Sbom directory created." $manifest_dir
else
Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder."
fi

artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM"
echo "Artifact name before : "$artifact_name
# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts.
safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}"
echo "Artifact name after : "$safe_artifact_name
export ARTIFACT_NAME=$safe_artifact_name
echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name"

exit 0
10 changes: 10 additions & 0 deletions eng/common/templates/job/job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ parameters:
name: ''
preSteps: []
runAsPublic: false
# Sbom related params
enableSbom: true
PackageVersion: 6.0.0
BuildDropPath: '$(Build.SourcesDirectory)/artifacts'

jobs:
- job: ${{ parameters.name }}
Expand Down Expand Up @@ -247,3 +251,9 @@ jobs:
ArtifactName: AssetManifests
continueOnError: ${{ parameters.continueOnError }}
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))

- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}:
- template: /eng/common/templates/steps/generate-sbom.yml
parameters:
PackageVersion: ${{ parameters.packageVersion}}
BuildDropPath: ${{ parameters.buildDropPath }}
4 changes: 0 additions & 4 deletions eng/common/templates/jobs/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ parameters:
# Optional: Enable publishing using release pipelines
enablePublishUsingPipelines: false

# Optional: Disable component governance detection. In general, component governance
# should be on for all jobs. Use only in the event of issues.
disableComponentGovernance: false

# Optional: Enable running the source-build jobs to build repo from source
enableSourceBuild: false

Expand Down
44 changes: 44 additions & 0 deletions eng/common/templates/steps/generate-sbom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# BuildDropPath - The root folder of the drop directory for which the manifest file will be generated.
# PackageName - The name of the package this SBOM represents.
# PackageVersion - The version of the package this SBOM represents.
# ManifestDirPath - The path of the directory where the generated manifest files will be placed

parameters:
PackageVersion: 6.0.0
BuildDropPath: '$(Build.SourcesDirectory)/artifacts'
PackageName: '.NET'
ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom
sbomContinueOnError: true

steps:
- task: PowerShell@2
displayName: Prep for SBOM generation in (Non-linux)
condition: or(eq(variables['Agent.Os'], 'Windows_NT'), eq(variables['Agent.Os'], 'Darwin'))
inputs:
filePath: ./eng/common/generate-sbom-prep.ps1
arguments: ${{parameters.manifestDirPath}}

# Chmodding is a workaround for https://github.com/dotnet/arcade/issues/8461
- script: |
chmod +x ./eng/common/generate-sbom-prep.sh
./eng/common/generate-sbom-prep.sh ${{parameters.manifestDirPath}}
displayName: Prep for SBOM generation in (Linux)
condition: eq(variables['Agent.Os'], 'Linux')
continueOnError: ${{ parameters.sbomContinueOnError }}

- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: 'Generate SBOM manifest'
continueOnError: ${{ parameters.sbomContinueOnError }}
inputs:
PackageName: ${{ parameters.packageName }}
BuildDropPath: ${{ parameters.buildDropPath }}
PackageVersion: ${{ parameters.packageVersion }}
ManifestDirPath: ${{ parameters.manifestDirPath }}

- task: PublishPipelineArtifact@1
displayName: Publish SBOM manifest
continueOnError: ${{parameters.sbomContinueOnError}}
inputs:
targetPath: '${{parameters.manifestDirPath}}'
artifactName: $(ARTIFACT_NAME)

4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.22107.2",
"Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.22107.2"
"Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.22122.7",
"Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.22122.7"
},
"sdk": {
"version": "6.0.101"
Expand Down

0 comments on commit 33d17f8

Please sign in to comment.