Skip to content

Commit a60a025

Browse files
authored
Abstractions Package - Pipeline Changes (#3628)
1 parent 2843bdd commit a60a025

File tree

45 files changed

+1319
-645
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1319
-645
lines changed

build.proj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@
450450
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "bin", SearchOption.AllDirectories))' />
451451
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", ".nuget", SearchOption.AllDirectories))' />
452452
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "obj", SearchOption.AllDirectories))' />
453-
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "packages", SearchOption.AllDirectories))' />
454453
</Target>
455454

456455
<!-- AKV Targets ========================================================= -->

eng/pipelines/akv-official-pipeline.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,16 @@ extends:
105105
roslyn:
106106
enabled: ${{ parameters.runSdlTasks }}
107107
break: true
108-
# Requires RoslynAnalyzers task to be added after build task
108+
# Requires RoslynAnalyzers task to be added somewhere in
109+
# the build stage.
109110

110111
publishLogs:
111112
enabled: ${{ parameters.runSdlTasks }}
112113

113114
sbom:
114115
enabled: ${{ parameters.runSdlTasks }}
115116
packageName: 'Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider'
116-
packageVersion: ${{ variables.nugetPackageVersion }}
117+
packageVersion: ${{ variables.akvPackageVersion }}
117118

118119
tsa:
119120
# OneBranch publishes all sdl results to TSA. If TSA is disabled all SDL tools will
@@ -127,11 +128,11 @@ extends:
127128
jobs:
128129
- template: /eng/pipelines/jobs/build-akv-official-job.yml@self
129130
parameters:
131+
akvAssemblyFileVersion: '${{ variables.assemblyFileVersion }}'
132+
akvPackageVersion: '${{ variables.akvPackageVersion }}'
130133
apiScanDllPath: '${{ variables.apiScanDllPath }}'
131134
apiScanPdbPath: '${{ variables.apiScanPdbPath }}'
132-
assemblyFileVersion: '${{ variables.assemblyFileVersion }}'
133135
buildConfiguration: '${{ parameters.buildConfiguration }}'
134-
nugetPackageVersion: '${{ variables.nugetPackageVersion }}'
135136
mdsPackageVersion: '${{ variables.mdsPackageVersion }}'
136137
publishSymbols: '${{ parameters.publishSymbols }}'
137138
signingAppRegistrationClientId: '$(SigningAppRegistrationClientId)'

eng/pipelines/common/templates/jobs/build-signed-package-job.yml

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ jobs:
2727
variables:
2828
- template: ../../../libraries/variables.yml@self
2929
- ${{ if parameters.isPreview }}:
30-
- name: NugetPackageVersion
31-
value: $(PreviewNugetPackageVersion)
30+
- name: abstractionsPackageVersion
31+
value: $(abstractionsPackagePreviewVersion)
32+
- name: mdsPackageVersion
33+
value: $(previewMdsPackageVersion)
3234

3335
steps:
3436
- script: SET
@@ -37,20 +39,56 @@ jobs:
3739
- powershell: |
3840
Write-Host "##vso[task.setvariable variable=CDP_BUILD_TYPE_COPY;isOutput=true]$($env:CDP_BUILD_TYPE)"
3941
name: GetBuildType
40-
41-
- template: ../steps/build-all-configurations-signed-dlls-step.yml@self
42-
42+
43+
# Build our tooling, which is required by the analysis step below, but
44+
# shouldn't be analyzed itself.
45+
- task: MSBuild@1
46+
displayName: 'Build Tooling'
47+
inputs:
48+
solution: '**/build.proj'
49+
configuration: $(Configuration)
50+
msbuildArguments: -t:BuildTools
51+
52+
# Perform analysis before building, since this step will clobber build output
4353
- template: ../steps/code-analyze-step.yml@self
54+
55+
# Update the root NuGet.config to use the packages/ directory as a source.
56+
# When we build MDS in Package mode, it depends on the Abstractions package,
57+
# which we will build and package into packages/.
58+
- template: ../steps/update-nuget-config-local-feed-step.yml
4459
parameters:
45-
analyzeType: all
60+
packagePath: $(REPOROOT)/packages
4661

62+
# Build the Abstractions package.
63+
- task: MSBuild@1
64+
displayName: Build Abstractions
65+
inputs:
66+
solution: '**/build.proj'
67+
configuration: $(Configuration)
68+
msbuildArguments: -t:BuildAbstractions
69+
70+
# Build MDS in Package mode, producing signed DLLs.
71+
- template: ../steps/build-all-configurations-signed-dlls-step.yml@self
72+
parameters:
73+
# These variables are sourced from common-variables.yml.
74+
abstractionsAssemblyFileVersion: $(abstractionsAssemblyFileVersion)
75+
abstractionsPackageVersion: $(abstractionsPackageVersion)
76+
configuration: $(Configuration)
77+
mdsAssemblyFileVersion: $(mdsAssemblyFileVersion)
78+
mdsPackageVersion: $(mdsPackageVersion)
79+
referenceType: Package
80+
4781
- template: ../steps/esrp-code-signing-step.yml@self
4882
parameters:
4983
artifactType: dll
5084

5185
- template: ../steps/generate-nuget-package-step.yml@self
5286
parameters:
53-
OutputDirectory: $(artifactDirectory)
87+
nuspecPath: $(nuspecPath)
88+
packageVersion: $(mdsPackageVersion)
89+
outputDirectory: $(artifactDirectory)
90+
displayName: 'Create MDS NuGet Package'
91+
referenceType: Package
5492
properties: 'AbstractionsPackageVersion=$(abstractionsPackageVersion)'
5593

5694
- template: ../steps/esrp-code-signing-step.yml@self
@@ -65,4 +103,4 @@ jobs:
65103
- template: ../steps/publish-symbols-step.yml@self
66104
parameters:
67105
publishSymbols: ${{ parameters['PublishSymbols'] }}
68-
symbolsArtifactName: mds_symbols_$(System.TeamProject)_$(Build.Repository.Name)_$(Build.SourceBranchName)_$(NuGetPackageVersion)_$(System.TimelineId)
106+
symbolsArtifactName: mds_symbols_$(System.TeamProject)_$(Build.Repository.Name)_$(Build.SourceBranchName)_$(mdsPackageVersion)_$(System.TimelineId)

eng/pipelines/common/templates/jobs/ci-build-nugets-job.yml

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
# See the LICENSE file in the project root for more information. #
55
#################################################################################
66
parameters:
7+
8+
- name: 'debug'
9+
type: boolean
10+
default: false
11+
12+
- name: referenceType
13+
type: string
14+
values:
15+
- Package
16+
- Project
17+
718
- name: poolName
819
type: string
920
default: $(ci_var_defaultPoolName)
@@ -12,9 +23,13 @@ parameters:
1223
type: string
1324
default: ADO-MMS22-SQL19
1425

15-
- name: artifactName
26+
- name: abstractionsArtifactName
1627
type: string
17-
default: Artifacts
28+
default: Abstractions.Artifact
29+
30+
- name: mdsArtifactName
31+
type: string
32+
default: MDS.Artifact
1833

1934
- name: platform
2035
type: string
@@ -28,8 +43,15 @@ parameters:
2843
type: stepList
2944
default: []
3045

46+
- name: abstractionsPackageVersion
47+
type: string
48+
49+
- name: mdsPackageVersion
50+
type: string
51+
3152
jobs:
32-
- job: build_nugets
53+
- job: build_mds_akv_packages_job
54+
displayName: Build MDS & AKV Packages
3355

3456
pool:
3557
name: ${{parameters.poolName }}
@@ -44,36 +66,65 @@ jobs:
4466
- ${{ if ne(parameters.prebuildSteps, '') }}:
4567
- ${{ parameters.prebuildSteps }} # extra steps to run before the build like downloading sni and the required configuration
4668

69+
# If we're testing in Package mode, download the Abstractions package artifacts into packages/,
70+
# and then setup the top-level NuGet.config to look in packages/ for local
71+
# NuGet dependencies.
72+
- ${{ if eq(parameters.referenceType, 'Package') }}:
73+
- task: DownloadPipelineArtifact@2
74+
displayName: Download Abstractions Package Artifact
75+
inputs:
76+
artifactName: ${{ parameters.abstractionsArtifactName }}
77+
targetPath: $(packagePath)
78+
# Note that packages/ will have been created by the above step, which is a
79+
# pre-requisite for configuring NuGet.
80+
- template: ../steps/ci-prebuild-step.yml@self
81+
parameters:
82+
debug: ${{ parameters.debug }}
83+
referenceType: ${{ parameters.referenceType }}
84+
4785
- template: ../steps/ci-project-build-step.yml@self
4886
parameters:
4987
platform: ${{ parameters.platform }}
5088
configuration: ${{ parameters.configuration }}
89+
referenceType: ${{ parameters.referenceType }}
5190
operatingSystem: Windows
52-
build: all
91+
build: MDS
92+
abstractionsPackageVersion: ${{parameters.abstractionsPackageVersion}}
5393

5494
- template: ../steps/generate-nuget-package-step.yml@self
5595
parameters:
56-
NugetPackageVersion: $(NugetPackageVersion)
96+
packageVersion: ${{ parameters.mdsPackageVersion }}
5797
configuration: $(Configuration)
5898
nuspecPath: 'tools/specs/Microsoft.Data.SqlClient.nuspec'
59-
OutputDirectory: $(packagePath)
99+
outputDirectory: $(packagePath)
60100
generateSymbolsPackage: false
61-
properties: 'AbstractionsPackageVersion=$(abstractionsPackageVersion)'
62-
displayName: 'Generate NuGet package M.D.SqlClient'
101+
referenceType: ${{ parameters.referenceType }}
102+
properties: 'AbstractionsPackageVersion=${{ parameters.abstractionsPackageVersion }}'
103+
displayName: 'Create MDS NuGet Package'
104+
105+
- template: ../steps/ci-project-build-step.yml@self
106+
parameters:
107+
platform: ${{ parameters.platform }}
108+
configuration: ${{ parameters.configuration }}
109+
referenceType: ${{ parameters.referenceType }}
110+
operatingSystem: Windows
111+
build: AKV
112+
mdsPackageVersion: ${{parameters.mdsPackageVersion}}
63113

64114
- template: ../steps/generate-nuget-package-step.yml@self
65115
parameters:
66-
NugetPackageVersion: $(NugetPackageVersion)
116+
packageVersion: $(akvPackageVersion)
67117
configuration: $(Configuration)
68118
nuspecPath: 'tools/specs/add-ons/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.nuspec'
69-
OutputDirectory: $(packagePath)
119+
outputDirectory: $(packagePath)
70120
generateSymbolsPackage: false
71-
properties: 'MdsPackageVersion=$(mdsPackageVersion)'
121+
referenceType: ${{ parameters.referenceType }}
122+
properties: 'MdsPackageVersion=${{ parameters.mdsPackageVersion }}'
72123
installNuget: false
73-
displayName: 'Generate NuGet package AKV Provider'
124+
displayName: 'Create AKV NuGet Package'
74125

75-
- task: PublishBuildArtifacts@1
76-
displayName: 'Publish Artifact: Artifacts'
126+
- task: PublishPipelineArtifact@1
127+
displayName: 'Publish Pipeline Artifact'
77128
inputs:
78-
PathtoPublish: $(packagePath)
79-
ArtifactName: ${{ parameters.artifactName }}
129+
targetPath: $(packagePath)
130+
artifactName: ${{ parameters.mdsArtifactName }}

0 commit comments

Comments
 (0)