Skip to content

Commit e2fa738

Browse files
Remove CDP_BUILD_TYPE from OneBranch pipelines (dotnet#3976)
Co-authored-by: paulmedynski <31868385+paulmedynski@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent 5609461 commit e2fa738

File tree

7 files changed

+33
-46
lines changed

7 files changed

+33
-46
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ jobs:
4040
- script: SET
4141
displayName: 'Print Environment Variables'
4242

43-
- pwsh: |
44-
Write-Host "##vso[task.setvariable variable=CDP_BUILD_TYPE_COPY;isOutput=true]$($env:CDP_BUILD_TYPE)"
45-
# This variable is used far away in validate-signed-packages-job.yml.
46-
name: GetBuildType
47-
displayName: Get Build Type
48-
4943
# Download the Abstractions and Logging packages from the previous stage into
5044
# packages/ so that they're available via the local NuGet feed when restoring MDS.
5145
# MDS depends on both Extensions.Abstractions and Extensions.Logging.

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

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ jobs:
2929
- name: pathToDownloadedNuget # path to the downloaded nuget files
3030
value: $(Pipeline.Workspace)\${{parameters.artifactName }}
3131

32-
- name: BuildType
33-
# This variable is set in the build-signed-package-job.yml job. Any changes
34-
# to the names of the stage, job, or variable must be reflected here.
35-
value: $[ stageDependencies.build_dependent.build_package_SqlClient.outputs['GetBuildType.CDP_BUILD_TYPE_COPY'] ]
36-
3732
- ${{ if parameters.isPreview }}:
3833
- name: extractedNugetPath
3934
value: $(extractedNugetRootPath).$(previewMdsPackageVersion)
@@ -80,42 +75,33 @@ jobs:
8075
displayName: 'Verify nuget signature'
8176
8277
- powershell: |
83-
$buildType = [string]"$(BuildType)"
84-
85-
if($buildType -eq 'Official')
78+
# Recursively find all .dll files in TempFolder (installed nuget folder)
79+
# Microsoft.Data.SqlClient.dll and Microsoft.Data.SqlClient.resources.dll (in localized folders) should have strong name
80+
$dllFiles = Get-ChildItem -Path $(TempFolderName) -Recurse -Filter *.dll
81+
$badDlls = @()
82+
foreach ($file in $dllFiles)
8683
{
87-
# Recursively find all .dll files in TempFolder (installed nuget folder)
88-
# Microsoft.Data.SqlClient.dll and Microsoft.Data.SqlClient.resources.dll (in localized folders) should have strong name
89-
$dllFiles = Get-ChildItem -Path $(TempFolderName) -Recurse -Filter *.dll
90-
$badDlls = @()
91-
foreach ($file in $dllFiles)
92-
{
93-
# Run sn.k to verify the strong name on each dll
94-
$result = & "C:\Program Files (x86)\Microsoft SDKs\Windows\*\bin\NETFX 4.8.1 Tools\sn.exe" -vf $file.FullName
95-
Write-OutPut $result
84+
# Run sn.exe to verify the strong name on each dll
85+
$result = & "C:\Program Files (x86)\Microsoft SDKs\Windows\*\bin\NETFX 4.8.1 Tools\sn.exe" -vf $file.FullName
86+
Write-OutPut $result
9687
97-
# if thhe dll is not valid, it would be delay signed or test-signed which is not meant for production
98-
if($result[$result.Length-1] -notlike "* is valid")
99-
{
100-
$badDlls += $result[$result.Length-1]
101-
}
102-
}
103-
if($badDlls.Count -gt 0)
104-
{
105-
Write-OutPut "Error: Invalid dlls are detected. Chek below list:"
106-
foreach($dll in $badDlls)
107-
{
108-
Write-Output $dll
109-
}
110-
Exit -1
88+
# if the dll is not valid, it would be delay signed or test-signed which is not meant for production
89+
if($result[$result.Length-1] -notlike "* is valid")
90+
{
91+
$badDlls += $result[$result.Length-1]
11192
}
112-
Write-Host "Strong name has been verified for all dlls"
11393
}
114-
else
94+
if($badDlls.Count -gt 0)
11595
{
116-
Write-OutPut "Strong name verification is not required for non-official builds"
96+
Write-OutPut "Error: Invalid dlls are detected. Check the list below:"
97+
foreach($dll in $badDlls)
98+
{
99+
Write-Output $dll
100+
}
101+
Exit -1
117102
}
118-
displayName: 'Verify strong name is generated for production'
103+
Write-Host "Strong name has been verified for all dlls"
104+
displayName: 'Verify assembly strong names'
119105
120106
- powershell: |
121107
# Checks the expected folder names such as lib, ref, runtimes

src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
</PropertyGroup>
2222

2323
<!-- Strong name signing ============================================= -->
24+
25+
<!-- When a signing key is specified, we will perform strong name assembly signing. -->
2426
<PropertyGroup Condition="'$(SigningKeyPath)' != ''">
2527
<SignAssembly>true</SignAssembly>
2628
<AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile>

src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
</PropertyGroup>
1717

1818
<!-- Strong name signing ============================================= -->
19+
20+
<!-- When a signing key is specified, we will perform strong name assembly signing. -->
1921
<PropertyGroup Condition="'$(SigningKeyPath)' != ''">
2022
<SignAssembly>true</SignAssembly>
2123
<AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile>

src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
</PropertyGroup>
1212

1313
<!-- Strong name signing ============================================= -->
14+
15+
<!-- When a signing key is specified, we will perform strong name assembly signing. -->
1416
<PropertyGroup Condition="'$(SigningKeyPath)' != ''">
1517
<SignAssembly>true</SignAssembly>
1618
<AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile>

src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
</ItemGroup>
1313

1414
<!-- Strong name signing ============================================= -->
15-
<PropertyGroup>
16-
<AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile>
17-
</PropertyGroup>
18-
<PropertyGroup Condition="'$(CDP_BUILD_TYPE)' == 'Official'">
15+
16+
<!-- When a signing key is specified, we will perform strong name assembly signing. -->
17+
<PropertyGroup Condition="'$(SigningKeyPath)' != ''">
1918
<SignAssembly>true</SignAssembly>
20-
<KeyFile>$(SigningKeyPath)</KeyFile>
19+
<AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile>
2120
</PropertyGroup>
2221

2322
<!-- References ====================================================== -->

src/Microsoft.SqlServer.Server/Microsoft.SqlServer.Server.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ Microsoft.SqlServer.Server.Format</Description>
7171
</ItemGroup>
7272

7373
<!-- Strong name signing ============================================= -->
74+
75+
<!-- When a signing key is specified, we will perform strong name assembly signing. -->
7476
<PropertyGroup Condition="'$(SigningKeyPath)' != ''">
7577
<SignAssembly>true</SignAssembly>
7678
<AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile>

0 commit comments

Comments
 (0)