Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
displayName: 'Build Signed MDS Package'
pool:
type: windows # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs

variables:
- template: /eng/pipelines/libraries/variables.yml@self
- ${{ if parameters.isPreview }}:
Expand All @@ -38,22 +38,25 @@ jobs:
Write-Host "##vso[task.setvariable variable=CDP_BUILD_TYPE_COPY;isOutput=true]$($env:CDP_BUILD_TYPE)"
name: GetBuildType

# Install the .NET SDK.
- template: /eng/pipelines/steps/install-dotnet.yml@self

# Build our tooling, which is required by the analysis step below, but
# shouldn't be analyzed itself.
- task: MSBuild@1
displayName: 'Build Tooling'
inputs:
solution: '**/build.proj'
configuration: $(Configuration)
configuration: Release
msbuildArguments: -t:BuildTools

# Perform analysis before building, since this step will clobber build output.
- template: /eng/pipelines/common/templates/steps/code-analyze-step.yml@self

# Build MDS in Package mode, producing signed DLLs.
- template: /eng/pipelines/common/templates/steps/build-all-configurations-signed-dlls-step.yml@self
parameters:
buildConfiguration: $(Configuration)
buildConfiguration: Release
# These variables are sourced from common-variables.yml.
mdsAssemblyFileVersion: $(mdsAssemblyFileVersion)
mdsPackageVersion: $(mdsPackageVersion)
Expand All @@ -62,7 +65,7 @@ jobs:
- template: /eng/pipelines/common/templates/steps/esrp-code-signing-step.yml@self
parameters:
artifactType: dll

- template: /eng/pipelines/common/templates/steps/generate-nuget-package-step.yml@self
parameters:
buildConfiguration: Release
Expand All @@ -72,11 +75,11 @@ jobs:
outputDirectory: $(artifactDirectory)
packageVersion: $(mdsPackageVersion)
referenceType: Package

- template: /eng/pipelines/common/templates/steps/esrp-code-signing-step.yml@self
parameters:
artifactType: pkg

- template: /eng/pipelines/common/templates/steps/copy-dlls-for-test-step.yml@self
parameters:
buildConfiguration: Release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ jobs:
isCustom: true
name: ADO-1ES-Pool
vmImage: 'ADO-MMS22-SQL19'

variables: # More settings at https://aka.ms/obpipelines/yaml/jobs
- template: /eng/pipelines/libraries/mds-validation-variables.yml@self

- name: pathToDownloadedNuget # path to the downloaded nuget files
value: $(Pipeline.Workspace)\${{parameters.packageFolderName }}

- name: BuildType
value: $[ stageDependencies.buildMDS.build_signed_package.outputs['GetBuildType.CDP_BUILD_TYPE_COPY'] ]

Expand All @@ -61,21 +61,10 @@ jobs:
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'

- powershell: |
# Sets the pipeline ASSEMBLY_VERSION variable.

[Xml] $versionprops = Get-Content -Path ".\tools\props\Versions.props"
Write-Host $versionprops.Project.PropertyGroup[0].AssemblyFileVersion

$AssemblyVersion = $versionprops.Project.PropertyGroup[0].AssemblyVersion

Write-Host "##vso[task.setvariable variable=ASSEMBLY_VERSION;]$AssemblyVersion"
displayName: 'Update assembly version property'

- powershell: |
# Displays the paths of all the local cache directories
nuget locals all -List

#Clears all files from all local cache directories
nuget locals all -Clear
displayName: 'Clear local cache'
Expand All @@ -99,7 +88,7 @@ jobs:
Write-Host "--------------------------------------------------"
Write-Host "This will verify the artifact signature" -ForegroundColor Green
Write-Host "--------------------------------------------------"

if ($packageType -eq 'dll' -or $packageType -eq 'both')
{
nuget verify -All $(pathToDownloadedNuget)\*.nupkg
Expand All @@ -111,15 +100,15 @@ jobs:
displayName: 'Verify nuget signature'

- powershell: |
$buildType = [string]"$(BuildType)"
$buildType = [string]"$(BuildType)"

if($buildType -eq 'Official')
{
# Recursively find all .dll files in TempFolder (installed nuget folder)
# Microsoft.Data.SqlClient.dll and Microsoft.Data.SqlClient.resources.dll (in localized folders) should have strong name
$dllFiles = Get-ChildItem -Path $(TempFolderName) -Recurse -Filter *.dll
$badDlls = @()
foreach ($file in $dllFiles)
foreach ($file in $dllFiles)
{
# Run sn.k to verify the strong name on each dll
$result = & "C:\Program Files (x86)\Microsoft SDKs\Windows\*\bin\NETFX 4.8.1 Tools\sn.exe" -vf $file.FullName
Expand All @@ -137,7 +126,7 @@ jobs:
foreach($dll in $badDlls)
{
Write-Output $dll
}
}
Exit -1
}
Write-Host "Strong name has been verified for all dlls"
Expand Down Expand Up @@ -179,7 +168,7 @@ jobs:
}
}
}

elseif ($_.Name -eq 'runtimes'){
Get-ChildItem -Depth 3 -Path $_.FullName -Exclude $excludNamesFromRuntimeFolder -Directory | foreach{
if('$(expectedDotnetVersions)'.Contains($_.Name)){
Expand Down Expand Up @@ -211,15 +200,15 @@ jobs:

- powershell: |
# list all the child items of created temp folder

#Verify all DLLs unzipped match "expected" hierarchy

foreach( $folderName in (Get-ChildItem -Path $(extractedNugetPath) -Directory).Name)
{
# List all Childerns of the Path
Get-ChildItem -Path $(extractedNugetPath)\$folderName -Recurse -File
$subFiles = Get-ChildItem -Path $(extractedNugetPath)\$folderName -Recurse -File
Get-ChildItem -Path $(extractedNugetPath)\$folderName -Recurse -File
$subFiles = Get-ChildItem -Path $(extractedNugetPath)\$folderName -Recurse -File

foreach($file in $subFiles)
{
if($subFiles[0].Name -like "*.dll" )
Expand All @@ -238,7 +227,7 @@ jobs:
Write-Host "Expected file pattern for localization did not match to *.dll" -ForegroundColor Red
Exit -1
}
}
}
}
else
{
Expand All @@ -252,7 +241,7 @@ jobs:
displayName: 'Verify all DLLs unzipped match "expected" hierarchy'
- powershell: |
# Verify all dlls status are Valid

$dlls = Get-ChildItem -Path $(extractedNugetPath) -Recurse -Include *.dll
foreach ($status in $dlls | Get-AuthenticodeSignature)
{
Expand All @@ -274,18 +263,18 @@ jobs:
# expected values.
$failed = 0

foreach ( $pVersion in Get-ChildItem *.dll -Path $(extractedNugetPath) -Recurse | ForEach-Object versioninfo )
foreach ( $pVersion in Get-ChildItem *.dll -Path $(extractedNugetPath) -Recurse | ForEach-Object versioninfo )
{
if ($pVersion.ProductVersion -Like '$(mdsPackageVersion)*')
{
Write-Host -ForegroundColor Green "Correct ProductVersion detected for $($pVersion.FileName): $($pVersion.ProductVersion)"
}
else
{
{
Write-Host -ForegroundColor Red "Wrong ProductVersion detected for $($pVersion.FileName); expected: $(mdsPackageVersion); found: $($pVersion.ProductVersion)"
$failed = 1
}

if ($pVersion.FileVersion -eq '$(mdsAssemblyFileVersion)')
{
Write-Host -ForegroundColor Green "Correct FileVersion detected for $($pVersion.FileName): $($pVersion.FileVersion)"
Expand All @@ -296,7 +285,7 @@ jobs:
$failed = 1
}
}

if ($failed -ne 0)
{
Exit -1
Expand All @@ -314,10 +303,10 @@ jobs:
# TODO: This also isn't checking the versions of the actual assemblies in
# the package, so it isn't terribly useful.

[Xml] $versionprops = Get-Content -Path "tools/props/Versions.props"
[Xml] $versionprops = Get-Content -Path "tools/props/Versions.props"
$AssemblyFileVersion = $versionprops.Project.PropertyGroup[2].AssemblyFileVersion
$AssemblyVersion = $versionprops.Project.PropertyGroup[2].AssemblyVersion

if($AssemblyFileVersion -eq $AssemblyVersion)
{
Write-Host AssemblyFileVersion: $AssemblyFileVersion should not be equal to: $AssemblyVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ steps:
-p:ReferenceType=${{ parameters.referenceType }}
-p:GenerateNuget=false
-p:SigningKeyPath=$(Agent.TempDirectory)\netfxKeypair.snk
-p:MdsAssemblyFileVersion=${{ parameters.mdsAssemblyFileVersion }}
-p:AssemblyFileVersion=${{ parameters.mdsAssemblyFileVersion }}
-p:MdsPackageVersion=${{ parameters.mdsPackageVersion }}
14 changes: 7 additions & 7 deletions eng/pipelines/dotnet-sqlclient-signing-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ parameters: # parameters are shown up in ADO UI in a build queue time

variables:
- template: /eng/pipelines/libraries/variables.yml@self
- name: packageFolderName
value: packages
- name: mdsArtifactName
value: drop_buildMDS_build_signed_package
- name: PublishSymbols
value: ${{ parameters['publishSymbols'] }}
- name: CurrentNetFxVersion
value: ${{ parameters['CurrentNetFxVersion'] }}

resources:
repositories:
repositories:
- repository: templates
type: git
name: OneBranch.Pipelines/GovernedTemplates
Expand Down Expand Up @@ -124,7 +124,7 @@ extends:
break: true # always break the build on policheck issues. You can disable it by setting to 'false'
exclusionsFile: $(REPOROOT)\.config\PolicheckExclusions.xml
asyncSdl:
enabled: false
enabled: false
credscan:
enabled: ${{ not(parameters['isPreview']) }}
suppressionsFile: $(REPOROOT)/.config/CredScanSuppressions.json
Expand Down Expand Up @@ -159,11 +159,11 @@ extends:
jobs:
- template: /eng/pipelines/common/templates/jobs/validate-signed-package-job.yml@self
parameters:
packageFolderName: $(packageFolderName)
packageFolderName: $(mdsArtifactName)
isPreview: ${{ parameters['isPreview'] }}
downloadPackageStep:
download: current
artifact: $(packageFolderName)
artifact: $(mdsArtifactName)
patterns: '**/*.*nupkg'
displayName: 'Download NuGet Package'

Expand All @@ -174,6 +174,6 @@ extends:
# timeout: ${{ parameters.testJobTimeout }}
# downloadPackageStep:
# download: current
# artifact: $(packageFolderName)
# artifact: $(mdsArtifactName)
# patterns: '**/*.nupkg'
# displayName: 'Download NuGet Package'
2 changes: 1 addition & 1 deletion eng/pipelines/libraries/build-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
# This file is only included in MDS OneBranch Official pipelines.

variables:
- group: Release Variables
- template: /eng/pipelines/libraries/common-variables.yml@self
- template: /eng/pipelines/libraries/mds-variables.yml@self
40 changes: 17 additions & 23 deletions eng/pipelines/libraries/common-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ variables:
# AuthSignCertName

- name: CommitHead
value: '' # the value will be extracted from the repo's head
value: '' # the value will be extracted from the repo's head
- name: REPOROOT
value: $(Build.SourcesDirectory)
- name: softwareFolder
Expand Down Expand Up @@ -47,39 +47,34 @@ variables:
# The NuGet package version for GA releases (non-preview).
- name: abstractionsPackageVersion
value: '1.0.0'

# The NuGet package version for preview releases.
- name: abstractionsPackagePreviewVersion
value: 1.0.0-preview1.$(Build.BuildNumber)

# The AssemblyFileVersion for all assemblies in the Abstractions package.
#
- name: abstractionsAssemblyFileVersion
value: 1.0.0.$(assemblyBuildNumber)

# ----------------------------------------------------------------------------
# MDS Package Versions
#
# These are version values that will be used by the official build. They
# should be updated after each release to reflect the next release's versions.

# Update this after every release. This is used to generate the MDS NuGet package version.
- name: Major
value: '7'
- name: Minor
value: '0'
- name: Patch
value: '0'

# Update this for preview releases.
- name: Preview
value: '-preview'
- name: Revision
value: '3'

# The NuGet package version for GA releases (non-preview).
- name: mdsPackageVersion
value: $(Major).$(Minor).$(Patch)
value: '7.0.0'

# The NuGet package version for preview releases.
- name: previewMdsPackageVersion
value: $(Major).$(Minor).$(Patch)$(Preview)$(Revision).$(Build.BuildNumber)
value: 7.0.0-preview4.$(Build.BuildNumber)

# The AssemblyFileVersion for all assemblies in the MDS package.
- name: mdsAssemblyFileVersion
value: $(Major).$(Minor).$(Patch).$(assemblyBuildNumber)
value: 7.0.0.$(assemblyBuildNumber)

# The path to the NuGet packaging specification file used to generate the MDS NuGet package.
- name: nuspecPath
value: '$(REPOROOT)/tools/specs/Microsoft.Data.SqlClient.nuspec'

Expand All @@ -92,12 +87,11 @@ variables:
# The NuGet package version for GA releases (non-preview).
- name: azurePackageVersion
value: '1.0.0'

# The NuGet package version for preview releases.
- name: azurePackagePreviewVersion
value: 1.0.0-preview1.$(Build.BuildNumber)

# The AssemblyFileVersion for all assemblies in the Azure package.
#
- name: azureAssemblyFileVersion
value: 1.0.0.$(assemblyBuildNumber)
2 changes: 1 addition & 1 deletion eng/pipelines/libraries/mds-validation-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# This file is only included in MDS OneBranch Official pipelines.

variables:
- group: Release Variables
- template: /eng/pipelines/libraries/common-variables.yml@self
- template: /eng/pipelines/libraries/mds-variables.yml@self

- name: TempFolderName # extract the nuget package here
value: temp
Expand Down
10 changes: 0 additions & 10 deletions eng/pipelines/libraries/mds-variables.yml

This file was deleted.

Loading