1515# signed DLLs, and finally ESRP signs the NuGet packages.
1616
1717parameters :
18+
19+ # Signing Parameters -----------------------------------------------------
20+
21+ - name : signingAppRegistrationClientId
22+ type : string
23+
24+ - name : signingAppRegistrationTenantId
25+ type : string
26+
27+ - name : signingAuthAkvName
28+ type : string
29+
30+ - name : signingAuthSignCertName
31+ type : string
32+
33+ - name : signingEsrpClientId
34+ type : string
35+
36+ - name : signingEsrpConnectedServiceName
37+ type : string
38+
39+ # Symbols Publishing Parameters ------------------------------------------
40+
41+ - name : symbolsAzureSubscription
42+ type : string
43+ default : ' Symbols publishing Workload Identity federation service-ADO.Net'
44+
45+ - name : symbolsPublishProjectName
46+ type : string
47+ default : ' Microsoft.Data.SqlClient.SNI'
48+
49+ - name : symbolsPublishServer
50+ type : string
51+
52+ - name : symbolsPublishTokenUri
53+ type : string
54+
55+ - name : symbolsUploadAccount
56+ type : string
57+ default : ' SqlClientDrivers'
58+
59+ # OTHERS +=====================================
60+
1861 # Short package name used in the job name, display strings, filesystem paths, and as a suffix for
1962 # the default Build and Pack targets if those aren't specified.
2063 - name : packageName
@@ -42,20 +85,17 @@ parameters:
4285 type : string
4386 default : " "
4487
88+ # True to enable ESRP malware scanning and code signing steps, which should not be
89+ # run on non-official pipelines as they access production resources.
90+ - name : isOfficial
91+ type : boolean
92+
4593 # The MSBuild pack target in build.proj (e.g. PackLogging). If not specified, defaults to
4694 # Pack<packageName>.
4795 - name : packTarget
4896 type : string
4997 default : " "
5098
51- # The C# build configuration to build (e.g. Debug or Release).
52- - name : buildConfiguration
53- type : string
54- values :
55- - Debug
56- - Release
57- default : Release
58-
5999 # Additional MSBuild -p: arguments for version properties. These may include versions of
60100 # packages this package depends on, or versions for this package itself.
61101 - name : versionProperties
@@ -70,30 +110,6 @@ parameters:
70110 - name : publishSymbols
71111 type : boolean
72112
73- # True to enable ESRP malware scanning and code signing steps, which should not be
74- # run on non-official pipelines as they access production resources.
75- - name : isOfficial
76- type : boolean
77-
78- # Values required by ESRP tasks.
79- - name : esrpConnectedServiceName
80- type : string
81-
82- - name : esrpClientId
83- type : string
84-
85- - name : appRegistrationClientId
86- type : string
87-
88- - name : appRegistrationTenantId
89- type : string
90-
91- - name : authAkvName
92- type : string
93-
94- - name : authSignCertName
95- type : string
96-
97113 # Optional list of pipeline artifacts to download before building. Each entry is an object
98114 # with 'artifactName' (the pipeline artifact name) and 'displayName' (used in the task label).
99115 # This replaces hard-coded packageName conditionals so callers declare their own dependencies.
@@ -108,15 +124,20 @@ jobs:
108124 type : windows
109125
110126 variables :
127+ # Inform OneBranch that files put in this directory should be uploaded as artifacts.
111128 ob_outputDirectory : $(PACK_OUTPUT)
129+
112130 # APIScan configuration for this Extension package
113131 ob_sdl_apiscan_enabled : true
114- ob_sdl_apiscan_softwareFolder : $(Build.SourcesDirectory )/apiScan/${{ parameters.packageName }}/dlls
115- ob_sdl_apiscan_symbolsFolder : $(Build.SourcesDirectory )/apiScan/${{ parameters.packageName }}/pdbs
132+ ob_sdl_apiscan_softwareFolder : $(REPO_ROOT )/apiScan/${{ parameters.packageName }}/dlls
133+ ob_sdl_apiscan_symbolsFolder : $(REPO_ROOT )/apiScan/${{ parameters.packageName }}/pdbs
116134 ob_sdl_apiscan_softwarename : ${{ parameters.packageFullName }}
117135 ob_sdl_apiscan_versionNumber : ${{ parameters.assemblyFileVersion }}
118136
137+ # If parameters.buildTarget is not provided, default to "Build{parameters.packageName}"
119138 buildTarget : ${{ coalesce(parameters.buildTarget, format('Build{0}', parameters.packageName)) }}
139+
140+ # If parameters.packTarget is not provided, default to "Pack{parameters.packageName}"
120141 packTarget : ${{ coalesce(parameters.packTarget, format('Pack{0}', parameters.packageName)) }}
121142
122143 steps :
@@ -128,46 +149,45 @@ jobs:
128149 displayName : Download ${{ artifact.displayName }}
129150 inputs :
130151 artifactName : ${{ artifact.artifactName }}
131- targetPath : $(Build.SourcesDirectory )/packages
152+ targetPath : $(REPO_ROOT )/packages
132153
133154 # Install the .NET SDK.
134155 - template : /eng/pipelines/steps/install-dotnet.yml@self
135156
136157 # Perform Roslyn analysis before building, since this step will clobber build output.
137158 - template : /eng/pipelines/onebranch/steps/roslyn-analyzers-csproj-step.yml@self
138159 parameters :
160+ buildTarget : ' ${{ variables.buildTarget }}'
139161 msBuildArguments : >-
140- -t:$(buildTarget)
141- -p:Configuration=${{ parameters.buildConfiguration }}
162+ -p:Configuration=Release
142163 -p:ReferenceType=Package
143164 ${{ parameters.versionProperties }}
144165
145166 # Build the package, producing DLLs only (no NuGet package yet).
146167 - template : /eng/pipelines/onebranch/steps/build-csproj-step.yml@self
147168 parameters :
148- buildTarget : $(buildTarget)
149- buildConfiguration : ${{ parameters.buildConfiguration }}
169+ buildTarget : ' ${{ variables.buildTarget }}'
150170 versionProperties : ${{ parameters.versionProperties }}
151171
152172 - ${{ if eq(parameters.isOfficial, true) }} :
153173 # ESRP sign the DLLs.
154174 - template : /eng/pipelines/onebranch/steps/esrp-dll-signing-step.yml@self
155175 parameters :
156- appRegistrationClientId : ${{ parameters.appRegistrationClientId }}
157- appRegistrationTenantId : ${{ parameters.appRegistrationTenantId }}
158- authAkvName : ${{ parameters.authAkvName }}
159- authSignCertName : ${{ parameters.authSignCertName }}
160- esrpClientId : ${{ parameters.esrpClientId }}
161- esrpConnectedServiceName : ${{ parameters.esrpConnectedServiceName }}
162- pattern : ${{ parameters.packageFullName }}.dll
176+ appRegistrationClientId : ' ${{ parameters.signingAppRegistrationClientId }}'
177+ appRegistrationTenantId : ' ${{ parameters.signingAppRegistrationTenantId }}'
178+ authAkvName : ' ${{ parameters.signingAuthAkvName }}'
179+ authSignCertName : ' ${{ parameters.signingAuthSignCertName }}'
180+ esrpClientId : ' ${{ parameters.signingEsrpClientId }}'
181+ esrpConnectedServiceName : ' ${{ parameters.signingEsrpConnectedServiceName }}'
182+ pattern : ' ${{ parameters.packageFullName }}.dll'
163183
164184 # Copy signed/unsigned DLLs and PDBs to APIScan folders.
165185 - task : CopyFiles@2
166186 displayName : Copy DLLs for APIScan
167187 inputs :
168188 SourceFolder : $(BUILD_OUTPUT)/Package/bin
169189 Contents : " **/${{ parameters.packageFullName }}.dll"
170- TargetFolder : $( ob_sdl_apiscan_softwareFolder)
190+ TargetFolder : ${{ variables. ob_sdl_apiscan_softwareFolder }}
171191 # We must preserve the folder structure since our C# projects may produce multiple
172192 # identically named DLLs for different target frameworks (e.g. netstandard2.0, net5.0,
173193 # etc.), and we need to keep those separate for APIScan to work correctly.
@@ -178,42 +198,41 @@ jobs:
178198 inputs :
179199 SourceFolder : $(BUILD_OUTPUT)/Package/bin
180200 Contents : " **/${{ parameters.packageFullName }}.pdb"
181- TargetFolder : $( ob_sdl_apiscan_symbolsFolder)
201+ TargetFolder : ${{ variables. ob_sdl_apiscan_symbolsFolder }}
182202 flattenFolders : false
183203
184204 # Pack the signed DLLs into NuGet package (NoBuild=true).
185205 - template : /eng/pipelines/onebranch/steps/pack-csproj-step.yml@self
186206 parameters :
187- packTarget : $(packTarget)
188- buildConfiguration : ${{ parameters.buildConfiguration }}
207+ packTarget : ${{ variables.packTarget }}
189208 versionProperties : ${{ parameters.versionProperties }}
190209
191210 - ${{ if eq(parameters.isOfficial, true) }} :
192211 # ESRP sign the NuGet package.
193212 - template : /eng/pipelines/onebranch/steps/esrp-nuget-signing-step.yml@self
194213 parameters :
195- appRegistrationClientId : ${{ parameters.appRegistrationClientId }}
196- appRegistrationTenantId : ${{ parameters.appRegistrationTenantId }}
197- authAkvName : ${{ parameters.authAkvName }}
198- authSignCertName : ${{ parameters.authSignCertName }}
199- esrpClientId : ${{ parameters.esrpClientId }}
200- esrpConnectedServiceName : ${{ parameters.esrpConnectedServiceName }}
214+ appRegistrationClientId : ' ${{ parameters.signingAppRegistrationClientId }}'
215+ appRegistrationTenantId : ' ${{ parameters.signingAppRegistrationTenantId }}'
216+ authAkvName : ' ${{ parameters.signingAuthAkvName }}'
217+ authSignCertName : ' ${{ parameters.signingAuthSignCertName }}'
218+ esrpClientId : ' ${{ parameters.signingEsrpClientId }}'
219+ esrpConnectedServiceName : ' ${{ parameters.signingEsrpConnectedServiceName }}'
201220 searchPath : $(PACK_OUTPUT)
202- searchPattern : ' ${{ parameters.packageFullName }}.*nupkg'
221+ searchPattern : ' ${{ parameters.packageFullName}}.*nupkg'
203222
204223 # Publish symbols to servers
205224 # @TODO: Get these parameters from variables/libraries
206225 - ${{ if eq(parameters.publishSymbols, true) }} :
207226 - template : /eng/pipelines/onebranch/steps/publish-symbols-step.yml@self
208227 parameters :
209228 artifactName : ' ${{ parameters.packageFullName }}_symbols_$(System.TeamProject)_$(Build.Repository.Name)_$(Build.SourceBranchName)_${{ parameters.packageVersion }}_$(System.TimelineId)'
210- azureSubscription : ' Symbols publishing Workload Identity federation service-ADO.Net '
229+ azureSubscription : ' ${{ parameters.symbolsAzureSubscription }} '
211230 packageName : ' ${{ parameters.packageFullName }}'
212- publishProjectName : ' Microsoft.Data.SqlClient.SNI ' # This is used for all SqlClient packages. Don't know why, but it is.
213- publishServer : ' $(SymbolServer) '
231+ publishProjectName : ' ${{ parameters.symbolsPublishProjectName }} '
232+ publishServer : ' ${{ parameters.symbolsPublishServer }} '
214233 publishToInternal : ' true'
215234 publishToPublic : ' true'
216- publishTokenUri : ' $(SymbolTokenUri) '
235+ publishTokenUri : ' ${{ parameters.symbolsPublishTokenUri }} '
217236 searchPattern : ' **/${{ parameters.packageFullName }}*.pdb'
218- uploadAccount : ' SqlClientDrivers '
237+ uploadAccount : ' ${{ parameters.symbolsUploadAccount }} '
219238 version : ' ${{ parameters.packageVersion }}'
0 commit comments