Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
6bc9ebf
In Solution: Move source projects under source folder, remove add-ons…
benrr101 Jan 16, 2025
9de28d4
Add engineering files to solution
benrr101 Jan 16, 2025
82afae8
Add new variables files for AKV (and v2) pipelines
benrr101 Jan 25, 2025
b48110f
ESRP signing step (and associated variables)
benrr101 Jan 29, 2025
0fd9acf
Renaming esrp steps
benrr101 Jan 29, 2025
5291d41
Adding steps for publishing AKV symbols
benrr101 Jan 29, 2025
96cd551
Adding nuget packaging steps
benrr101 Jan 30, 2025
226dc5e
Make symbols publishing more generic
benrr101 Jan 30, 2025
1bcf09e
Add task for roslyn analyzers
benrr101 Jan 30, 2025
9a72d8b
Adding task for building AKV project
benrr101 Feb 3, 2025
a877774
Finishing up wiring the tasks to jobs to pipeline
benrr101 Feb 3, 2025
c566c24
Fix errors, round 1
benrr101 Feb 4, 2025
1cac77e
Fix typo 1
benrr101 Feb 4, 2025
2d0d4ef
Fix errors in job file
benrr101 Feb 4, 2025
4081d9a
Forgot a colon
benrr101 Feb 4, 2025
55aaef4
Renaming SET step to make sure it follows convention
benrr101 Feb 4, 2025
9404683
Apparently script needs to go first
benrr101 Feb 4, 2025
066f403
Reworking the entire code signing and publish steps to use parameters…
benrr101 Feb 5, 2025
ea93408
Fix parameter reference
benrr101 Feb 5, 2025
4abc6db
Fix parameter reference 2
benrr101 Feb 5, 2025
9150617
Adding onebranch variables to pipeline
benrr101 Feb 5, 2025
d447c91
Fixing definition of common variables
benrr101 Feb 5, 2025
ab484d3
Let's try again without the ob variables file
benrr101 Feb 5, 2025
ed8e5ba
Uhhhh...
benrr101 Feb 5, 2025
fdef1e8
UH.
benrr101 Feb 5, 2025
2214a0c
WTF.
benrr101 Feb 5, 2025
f41b05d
Another attempt.
benrr101 Feb 5, 2025
31b620d
I'm confused.
benrr101 Feb 5, 2025
59357d4
Idk, let's try it how the docs say to do it.
benrr101 Feb 5, 2025
8490619
Remove common variables group
benrr101 Feb 5, 2025
2a76222
bring back the onebranch variables?
benrr101 Feb 5, 2025
5dcb704
Rework the AKV build target ... why the heck does the build.proj tota…
benrr101 Feb 5, 2025
b420424
Fix typo with key path
benrr101 Feb 5, 2025
ef07727
Let's try this without the multiple lines?
benrr101 Feb 6, 2025
e5f9dbb
What's wrong with YAML strings.
benrr101 Feb 6, 2025
4837cb9
Fix mistake?
benrr101 Feb 6, 2025
f07d7b9
Maybe it doesn't like the extra spaces...
benrr101 Feb 6, 2025
6eb55a3
Debug the parameters!
benrr101 Feb 6, 2025
c9b22b3
Rename variables?
benrr101 Feb 6, 2025
52dcd38
Ugh is this another one that doesn't support multi-line?
benrr101 Feb 6, 2025
0627412
So apparently extra indenting means yaml preserves the dang newline.
benrr101 Feb 6, 2025
34edc6d
More debug...
benrr101 Feb 6, 2025
30715e9
"Artifact" folder doesn't exist yet. Duh.
benrr101 Feb 6, 2025
1ebd010
* Cleanup build.proj targets a tiny bit
benrr101 Feb 6, 2025
48228d5
Fix property definition in build.proj :shrug_man:
benrr101 Feb 6, 2025
84120c1
Fixing build.proj ... there's still some complexities in here that ar…
benrr101 Feb 6, 2025
07a4272
Copy the dll/pdb for ApiScan
benrr101 Feb 7, 2025
dd1441c
Why even have array types if we can't use them
benrr101 Feb 7, 2025
b170f38
Rename file
benrr101 Feb 7, 2025
61e7367
Reinstating the tree command, fixing some path variables.
benrr101 Feb 8, 2025
1478059
Fixing source path for apiscan extract
benrr101 Feb 8, 2025
1b04be5
Man just when I think I get it, I don't get it.
benrr101 Feb 8, 2025
da34f0f
Not sure why it matters if there is a slash at the end or not. But le…
benrr101 Feb 10, 2025
ca7d1c5
I guess variable templates can't depend on variables from other templ…
benrr101 Feb 10, 2025
d5e7fb7
There's no type safety anywhere else, but there is when I want to pri…
benrr101 Feb 10, 2025
541a80f
:expressionless:
benrr101 Feb 10, 2025
82ba738
Fix template name for symbols publishing step
benrr101 Feb 10, 2025
6f0dcaa
Fix values name
benrr101 Feb 10, 2025
66a65ae
Merge branch 'main' into dev/russellben/akv-pipeline
benrr101 Feb 10, 2025
89474dc
Yeah, I don't know what's broken here. This is a random guess.
benrr101 Feb 10, 2025
7da4efd
Parameter to symbols publishing step
benrr101 Feb 10, 2025
5984fc5
Artifacts path != Build output artifacts folder
benrr101 Feb 10, 2025
ed0a20f
Remove \"
benrr101 Feb 10, 2025
54d75f0
Language injection would've helped me with that
benrr101 Feb 10, 2025
e337b9b
Needed some quote marks
benrr101 Feb 11, 2025
36baeff
Fix issue with network isolation
benrr101 Feb 11, 2025
8866966
Rename buildPreview to runSdlTasks, cleanup a couple to-dos
benrr101 Feb 11, 2025
0371d50
Whoops.
benrr101 Feb 12, 2025
e0b12cd
Merge branch 'main' into dev/russellben/akv-pipeline
benrr101 Feb 12, 2025
2d0012e
Couple tweaks
benrr101 Feb 12, 2025
353a782
Remove signing from roslyn analyzers
benrr101 Feb 12, 2025
9eafc40
Removing one more to-do
benrr101 Feb 13, 2025
a787dea
I doubt case sensitivity matters here, but juuuuust in case, we can t…
benrr101 Feb 13, 2025
e10ace7
Disable nuget auditing on CI builds, remove KS2 from feature flags
benrr101 Feb 13, 2025
081daa9
Can I turn it off at all?
benrr101 Feb 14, 2025
346a24a
ContinuousIntegrationBuild is set later in the file. Use the base field
benrr101 Feb 18, 2025
cf57cab
Only report to TSA on official builds
benrr101 Feb 19, 2025
1f90c36
Convert to json
benrr101 Feb 25, 2025
cab9d63
Ok whatever
benrr101 Feb 25, 2025
33d9389
I love it when examples don't actually work
benrr101 Feb 25, 2025
81157df
What in the heck
benrr101 Feb 25, 2025
0b12b3e
THIS IS SO DUMB
benrr101 Feb 25, 2025
1d6c189
Claude save me
benrr101 Feb 25, 2025
6d51fc8
Escape sequence fix
benrr101 Feb 25, 2025
44bbbc8
Fixing the replacement to be good
benrr101 Feb 25, 2025
9dee08c
WORDS WORDS WORDS
benrr101 Feb 25, 2025
70dddc6
Standardizing the quotes
benrr101 Feb 25, 2025
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
33 changes: 33 additions & 0 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@

<Target Name="RunManualTests">
<!-- Windows -->
<Exec ConsoleToMsBuild="true" Command="$(DotnetPath)dotnet test &quot;@(ManualTestsProj)&quot; -p:Configuration=$(Configuration) -p:Target$(TFGroup)Version=$(TF) -p:ReferenceType=$(ReferenceType) --no-build -l &quot;console;verbosity=normal&quot; --collect &quot;Code coverage&quot; -p:TestSet=$(TestSet) --results-directory $(ResultsDirectory) -p:TestTargetOS=Windows$(TargetGroup) --filter &quot;category!=non$(TargetGroup)tests&amp;category!=failing&amp;category!=nonwindowstests&quot; &quot;--logger:trx;LogFilePrefix=Manual-Windows$(TargetGroup)-$(TestSet)&quot;" Condition="'$(IsEnabledWindows)' == 'true'"/>

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (Win22_Sql19 net8_0_AnyCPU_NativeSNI_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net8.0 -p:ReferenceType=Project --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-3"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (Win22_Azure_Sql net8_0_AnyCPU_NativeSNI_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net8.0 -p:ReferenceType=Project --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-3"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (Win22_Sql22 net8_0_AnyCPU_NativeSNI_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net8.0 -p:ReferenceType=Project --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-3"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (Win22_Azure_ARM64_Sql net9_0_AnyCPU_NativeSNI_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Package --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-3"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (Win22_Sql22_named_instance net8_0_AnyCPU_NativeSNI_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net8.0 -p:ReferenceType=Package --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-3"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (Win22_Sql19 net9_0_AnyCPU_NativeSNI_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Package --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-3"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (Win22_Sql22 net9_0_AnyCPU_ManagedSNI_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Package --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-3"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (win11_Azure_Sql net8_0_AnyCPU_NativeSNI_2)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net8.0 -p:ReferenceType=Package --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=2 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-2"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (Win22_Sql22_named_instance net9_0_AnyCPU_NativeSNI_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Package --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-3"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (Win22_Sql22_named_instance net9_0_AnyCPU_NativeSNI_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Package --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-3"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (Win22_Sql19 net8_0_AnyCPU_NativeSNI_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net8.0 -p:ReferenceType=Package --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-3"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (Win22_Sql22 net9_0_AnyCPU_NativeSNI_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Package --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-3"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (Win22_Sql22 net9_0_AnyCPU_NativeSNI_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Package --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetcoreapp --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetcoreapp-3"" exited with code 1.

Check failure on line 191 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (Win22_Sql22_named_instance net462_AnyCPU_3)

build.proj#L191

build.proj(191,5): Error MSB3073: The command "dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Configuration=Release -p:TargetnetfxVersion=net462 -p:ReferenceType=Package --no-build -l "console;verbosity=normal" --collect "Code coverage" -p:TestSet=3 --results-directory TestResults -p:TestTargetOS=Windowsnetfx --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" "--logger:trx;LogFilePrefix=Manual-Windowsnetfx-3"" exited with code 1.
<!-- Unix -->
<Exec ConsoleToMsBuild="true" Command="$(DotnetPath)dotnet test &quot;@(ManualTestsProj)&quot; -p:Configuration=$(Configuration) -p:TargetNetCoreVersion=$(TF) -p:ReferenceType=$(ReferenceType) --no-build -l &quot;console;verbosity=normal&quot; --collect &quot;Code coverage&quot; -p:TestSet=$(TestSet) --results-directory $(ResultsDirectory) -p:TestTargetOS=Unixnetcoreapp --filter &quot;category!=nonnetcoreapptests&amp;category!=failing&amp;category!=nonlinuxtests&amp;category!=nonuaptests&quot; &quot;--logger:trx;LogFilePrefix=Manual-Unixnetcoreapp-$(TestSet)&quot;" Condition="'$(IsEnabledWindows)' != 'true'"/>
</Target>
Expand All @@ -201,6 +201,39 @@
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".",".nuget", SearchOption.AllDirectories))' />
</Target>

<!-- AKV Targets ========================================================= -->
<Target Name="BuildAkv">
<!-- @TODO: TestTargetOS for restore poisons the project.assets.json file... We should remove it. -->
<!-- @TODO: TestTargetOS makes this far more complicated than it needs to be. We should remove it. -->
<!-- @TODO: RemoveProperties shouldn't be necessary -->
<Message Text=">>> Restoring AKV project" />
<MSBuild Projects="@(AKVProvider)" Targets="Restore"/>

<PropertyGroup>
<BuildAkvProperties>$(CI);TestTargetOS=$(TestOS)netfx;Platform=AnyCPU;$(ProjectProperties);$(NugetPackProperties)</BuildAkvProperties>
</PropertyGroup>
<Message Text=">>> Building AKV project for netfx [$(BuildAkvProperties)]" />
<MSBuild Projects="@(AKVProvider)" Properties="$(BuildAkvProperties);" />

<PropertyGroup>
<BuildAkvProperties>$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=Unix;</BuildAkvProperties>
</PropertyGroup>
<Message Text=">>> Building AKV project for netcore/unix [$(BuildAkvProperties)]" />
<MSBuild Projects="@(AKVProvider)" Properties="$(BuildAkvProperties)" RemoveProperties="TargetsWindows;TargetsUnix;" />

<PropertyGroup>
<BuildAkvProperties>$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=Windows_NT</BuildAkvProperties>
</PropertyGroup>
<Message Text=">>> Building AKV project for netcore/windows [$(BuildAkvProperties)]" />
<MSBuild Projects="@(AKVProvider)" Properties="$(BuildAkvProperties);" RemoveProperties="TargetsWindows;TargetsUnix;" />

<PropertyGroup>
<BuildAkvProperties>$(CI);TestTargetOS=$(TestOS)netcoreapp;$(ProjectProperties);Platform=AnyCPU;OSGroup=AnyOS;</BuildAkvProperties>
</PropertyGroup>
<Message Text=">>> Building AKV project for netcore/anyos [$(BuildAkvProperties)]" />
<MSBuild Projects="@(AKVProvider)" Properties="$(BuildAkvProperties)" RemoveProperties="TargetsWindows;TargetsUnix;" />
</Target>

<Target Name="BuildAKVNetFx" Condition="'$(IsEnabledWindows)' == 'true'">
<MSBuild Projects="@(AKVProvider)" Targets="restore" Properties="TestTargetOS=$(TestOS)netfx" />
<Message Text=">>> Building AKVNetFx [$(CI);TestTargetOS=$(TestOS)netfx;Platform=AnyCPU;$(TestProjectProperties)] ..." Condition="!$(ReferenceType.Contains('Package'))"/>
Expand Down
146 changes: 146 additions & 0 deletions eng/pipelines/akv-official-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
#################################################################################
# Licensed to the .NET Foundation under one or more agreements. #
# The .NET Foundation licenses this file to you under the MIT license. #
# See the LICENSE file in the project root for more information. #
#################################################################################

name: $(Year:YY)$(DayOfYear)$(Rev:.r)

# @TODO: Add triggers and schedules

parameters:
- name: oneBranchType
displayName: 'OneBranch template'
type: 'string'
values:
- 'Official'
- 'NonOfficial'
default: 'Official'

- name: buildConfiguration
displayName: 'Build configuration'
type: 'string'
values:
- 'Release'
- 'Debug'
default: 'Release'

- name: publishSymbols
displayName: 'Publish symbols'
type: 'boolean'
default: false

- name: runSdlTasks
displayName: 'Run SDL Tasks'
type: 'boolean'
default: true

variables:
- template: /eng/pipelines/variables/common-variables.yml@self
- template: /eng/pipelines/variables/onebranch-variables.yml@self
- template: /eng/pipelines/variables/akv-official-variables.yml@self

resources:
repositories:
- repository: templates
type: 'git'
name: 'OneBranch.Pipelines/GovernedTemplates'
ref: 'refs/heads/main'

extends:
template: 'v2/OneBranch.${{ parameters.oneBranchType }}.CrossPlat.yml@templates'

parameters:
featureFlags:
WindowsHostVersion:
Version: '2022'

globalSdl:
# See https://aka.ms/obpipelines/sdl

apiscan:
enabled: ${{ parameters.runSdlTasks }}
softwareFolder: '${{ variables.apiScanDllPath }}'
softwareName: 'Microsoft.Data.SqlClient' # Note: This name is registered with ApiScan
softwareVersionNum: '${{ variables.assemblyFileVersion }}'
symbolsFolder: '${{ variables.apiScanPdbPath }}'

armory:
enabled: ${{ parameters.runSdlTasks }}
break: true

asyncSdl:
# If this should be enabled, move supported tools under this item,
# see https://aka.ms/obpipelines/asyncsdl
enabled: false

binskim:
enabled: ${{ parameters.runSdlTasks }}
break: true

codeinspector:
enabled: ${{ parameters.runSdlTasks }}
logLevel: Error

codeql:
enabled: ${{ parameters.runSdlTasks }}
sourceRoot: '$(REPO_ROOT)/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider'
# Note, this can only be done if project doesn't depend on other projects. In
# package reference mode, this is true, but if we ever enable project reference
# builds, this will have to be removed.

credscan:
enabled: ${{ parameters.runSdlTasks }}
suppressionsFile: '$(REPO_ROOT)/.config/CredScanSuppressions.json'

eslint:
enabled: false

policheck:
enabled: ${{ parameters.runSdlTasks }}
break: true
exclusionFile: '$(REPO_ROOT)/.config/PolicheckExclusions.xml'

roslyn:
enabled: ${{ parameters.runSdlTasks }}
break: true
# Requires RoslynAnalyzers task to be added after build task

publishLogs:
enabled: ${{ parameters.runSdlTasks }}

sbom:
enabled: ${{ parameters.runSdlTasks }}
packageName: 'Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider'
packageVersion: ${{ variables.nugetPackageVersion }}

tsa:
# OneBranch publishes all sdl results to TSA. If TSA is disabled all SDL tools will
# be forced into 'break' build mode.
enabled: ${{ eq(parameters.oneBranchType, 'Official') }}
configFile: '$(REPO_ROOT)/.config/tsaoptions.json'

stages:
- stage: BuildAkv
displayName: 'Build AKV'
jobs:
- template: /eng/pipelines/jobs/build-akv-official-job.yml@self
parameters:
apiScanDllPath: '${{ variables.apiScanDllPath }}'
apiScanPdbPath: '${{ variables.apiScanPdbPath }}'
assemblyFileVersion: '${{ variables.assemblyFileVersion }}'
buildConfiguration: '${{ parameters.buildConfiguration }}'
nugetPackageVersion: '${{ variables.nugetPackageVersion }}'
mdsPackageVersion: '${{ variables.mdsPackageVersion }}'
publishSymbols: '${{ parameters.publishSymbols }}'
signingAppRegistrationClientId: '$(SigningAppRegistrationClientId)'
signingAppRegistrationTenantId: '$(SigningAppRegistrationTenantId)'
signingAkvName: '$(SigningAkvName)'
signingAuthCertName: '$(SigningAuthCertName)'
signingConnectedServiceName: '$(SigningConnectedServiceName)'
signingSignCertName: '$(SigningSignCertName)'
symbolsAzureSubscription: '$(SymbolsAzureSubscription)'
symbolsPublishProjectName: '$(SymbolsPublishProjectName)'
symbolsPublishServer: '$(SymbolsPublishServer)'
symbolsPublishTokenUri: '$(SymbolsPublishTokenUri)'
symbolsUploadAccount: '$(SymbolsUploadAccount)'
154 changes: 154 additions & 0 deletions eng/pipelines/jobs/build-akv-official-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
#################################################################################
# Licensed to the .NET Foundation under one or more agreements. #
# The .NET Foundation licenses this file to you under the MIT license. #
# See the LICENSE file in the project root for more information. #
#################################################################################

parameters:
- name: apiScanDllPath
type: string

- name: apiScanPdbPath
type: string

- name: assemblyFileVersion
type: string

- name: buildConfiguration
type: string

- name: nugetPackageVersion
type: string

- name: mdsPackageVersion
type: string

- name: publishSymbols
type: boolean

- name: signingAppRegistrationClientId
type: string

- name: signingAppRegistrationTenantId
type: string

- name: signingAkvName
type: string

- name: signingAuthCertName
type: string

- name: signingConnectedServiceName
type: string

- name: signingSignCertName
type: string

- name: symbolsAzureSubscription
type: string

- name: symbolsPublishProjectName
type: string

- name: symbolsPublishServer
type: string

- name: symbolsPublishTokenUri
type: string

- name: symbolsUploadAccount
type: string

# @TODO: This should be determined from build output, or at a higher level
- # Note: not intended to be passed in, is only used for copying files for ApiScan.
# This is only defined as a parameter since ADO pipelines do not support array variables.
name: targetFrameworks
type: object
default:
- net462
- net8.0
- net9.0

jobs:
- job: buildSignedAkvPackage
displayName: 'Build Signed AKV Package'
pool:
type: windows

variables:
ob_outputDirectory: '$(ARTIFACT_PATH)'

steps:
- template: ../steps/script-output-environment-variables-step.yml@self

- powershell: |
$jsonParams = '${{ convertToJson(parameters) }}' -replace '\\', '\\'
$jsonParams | ConvertFrom-Json | Format-List
displayName: 'Output Job Parameters'

- template: ../steps/compound-build-akv-step.yml@self
parameters:
assemblyFileVersion: '${{ parameters.assemblyFileVersion }}'
buildConfiguration: '${{ parameters.buildConfiguration }}'
mdsPackageVersion: '${{ parameters.mdsPackageVersion }}'

- ${{ each targetFramework in parameters.targetFrameworks }}:
- template: ../steps/compound-extract-akv-apiscan-files-step.yml
parameters:
buildConfiguration: '${{ parameters.buildConfiguration }}'
dllPath: '${{ parameters.apiScanDllPath }}'
pdbPath: '${{ parameters.apiScanPdbPath }}'
referenceType: Package
targetFramework: '${{ targetFramework }}'

- template: ../steps/roslyn-analyzers-akv-step.yml@self
parameters:
buildConfiguration: '${{ parameters.buildConfiguration }}'
mdsPackageVersion: '${{ parameters.mdsPackageVersion }}'

- template: ../steps/compound-esrp-code-signing-step.yml@self
parameters:
akvName: '${{ parameters.signingAkvName }}'
appRegistrationClientId: '${{ parameters.signingAppRegistrationClientId }}'
appRegistrationTenantId: '${{ parameters.signingAppRegistrationTenantId }}'
artifactType: 'dll'
authCertName: '${{ parameters.signingAuthCertName }}'
connectedServiceName: '${{ parameters.signingConnectedServiceName }}'
signingCertName: '${{ parameters.signingSignCertName }}'

- template: ../steps/compound-nuget-pack-step.yml@self
parameters:
buildConfiguration: '${{ parameters.buildConfiguration }}'
generateSymbolsPackage: true # Always generate symbols, even if they are not published
packageVersion: '${{ parameters.nugetPackageVersion }}'
nuspecPath: '$(REPO_ROOT)/tools/specs/add-ons/$(PACKAGE_NAME).nuspec'
outputDirectory: '$(ARTIFACT_PATH)'
referenceType: 'Package'

- template: ../steps/compound-esrp-code-signing-step.yml@self
parameters:
akvName: '${{ parameters.signingAkvName }}'
appRegistrationClientId: '${{ parameters.signingAppRegistrationClientId }}'
appRegistrationTenantId: '${{ parameters.signingAppRegistrationTenantId }}'
artifactType: 'pkg'
authCertName: '${{ parameters.signingAuthCertName }}'
connectedServiceName: '${{ parameters.signingConnectedServiceName }}'
signingCertName: '${{ parameters.signingSignCertName }}'

- ${{ if parameters.publishSymbols }}:
- template: ../steps/compound-publish-symbols-step.yml@self
parameters:
artifactName: 'akv_symbols_$(System.TeamProject)_$(Build.Repository.Name)_$(Build.SourceBranchName)_${{ parameters.nugetPackageVersion }}_$(System.TimelineId)'
azureSubscription: '${{ parameters.symbolsAzureSubscription }}'
publishProjectName: '${{ parameters.symbolsPublishProjectName }}'
packageName: '$(PACKAGE_NAME)'
publishServer: '${{ parameters.symbolsPublishServer }}'
publishToInternal: true
publishToPublic: true
publishTokenUri: '${{ parameters.symbolsPublishTokenUri }}'
referenceType: 'Package'
searchPattern: |
Windows_NT/${{ parameters.buildConfiguration }}.AnyCPU/AzureKeyVaultProvider/**/$(PACKAGE_NAME).pdb
AnyOS/${{ parameters.buildConfiguration }}.AnyCPU/AzureKeyVaultProvider/**/$(PACKAGE_NAME).pdb
uploadAccount: '${{ parameters.symbolsUploadAccount }}'
version: '${{ parameters.nugetPackageVersion }}'
54 changes: 54 additions & 0 deletions eng/pipelines/steps/compound-build-akv-step.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#################################################################################
# Licensed to the .NET Foundation under one or more agreements. #
# The .NET Foundation licenses this file to you under the MIT license. #
# See the LICENSE file in the project root for more information. #
#################################################################################

# @TODO: This can probably be made generic and pass in the command lines for msbuild
# BUT, they should be kept separate by now as we rebuild build.proj in parallel, we won't
# affect >1 project at a time.
# @TODO: NugetPackageVersion should not be used for MDS package version

parameters:
- name: assemblyFileVersion
type: string

- name: buildConfiguration
type: string

- name: mdsPackageVersion
type: string

steps:
- task: DownloadSecureFile@1
displayName: 'Download Signing Key'
inputs:
retryCount: 5
secureFile: 'netfxKeypair.snk'

- task: UseDotNet@2
displayName: 'Install .NET 9.x SDK'
inputs:
packageType: 'sdk'
version: '9.x'

- task: UseDotNet@2
displayName: 'Install .NET 8.x Runtime'
inputs:
packageType: 'runtime'
version: '8.x'

- task: MSBuild@1
displayName: 'Build.proj - BuildAkv'
inputs:
solution: '$(REPO_ROOT)/build.proj'
configuration: '${{ parameters.buildConfiguration }}'
msbuildArguments: >-
-t:BuildAkv
-p:AssemblyFileVersion=${{ parameters.assemblyFileVersion }}
-p:NugetPackageVersion=${{ parameters.mdsPackageVersion }}
-p:ReferenceType=Package
-p:SigningKeyPath=$(Agent.TempDirectory)/netfxKeypair.snk

- script: tree /a /f $(BUILD_OUTPUT)
displayName: Output Build Output Tree
Loading
Loading