-
Notifications
You must be signed in to change notification settings - Fork 317
AKV Official Pipeline #3150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
AKV Official Pipeline #3150
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 9de28d4
Add engineering files to solution
benrr101 82afae8
Add new variables files for AKV (and v2) pipelines
benrr101 b48110f
ESRP signing step (and associated variables)
benrr101 0fd9acf
Renaming esrp steps
benrr101 5291d41
Adding steps for publishing AKV symbols
benrr101 96cd551
Adding nuget packaging steps
benrr101 226dc5e
Make symbols publishing more generic
benrr101 1bcf09e
Add task for roslyn analyzers
benrr101 9a72d8b
Adding task for building AKV project
benrr101 a877774
Finishing up wiring the tasks to jobs to pipeline
benrr101 c566c24
Fix errors, round 1
benrr101 1cac77e
Fix typo 1
benrr101 2d0d4ef
Fix errors in job file
benrr101 4081d9a
Forgot a colon
benrr101 55aaef4
Renaming SET step to make sure it follows convention
benrr101 9404683
Apparently script needs to go first
benrr101 066f403
Reworking the entire code signing and publish steps to use parameters…
benrr101 ea93408
Fix parameter reference
benrr101 4abc6db
Fix parameter reference 2
benrr101 9150617
Adding onebranch variables to pipeline
benrr101 d447c91
Fixing definition of common variables
benrr101 ab484d3
Let's try again without the ob variables file
benrr101 ed8e5ba
Uhhhh...
benrr101 fdef1e8
UH.
benrr101 2214a0c
WTF.
benrr101 f41b05d
Another attempt.
benrr101 31b620d
I'm confused.
benrr101 59357d4
Idk, let's try it how the docs say to do it.
benrr101 8490619
Remove common variables group
benrr101 2a76222
bring back the onebranch variables?
benrr101 5dcb704
Rework the AKV build target ... why the heck does the build.proj tota…
benrr101 b420424
Fix typo with key path
benrr101 ef07727
Let's try this without the multiple lines?
benrr101 e5f9dbb
What's wrong with YAML strings.
benrr101 4837cb9
Fix mistake?
benrr101 f07d7b9
Maybe it doesn't like the extra spaces...
benrr101 6eb55a3
Debug the parameters!
benrr101 c9b22b3
Rename variables?
benrr101 52dcd38
Ugh is this another one that doesn't support multi-line?
benrr101 0627412
So apparently extra indenting means yaml preserves the dang newline.
benrr101 34edc6d
More debug...
benrr101 30715e9
"Artifact" folder doesn't exist yet. Duh.
benrr101 1ebd010
* Cleanup build.proj targets a tiny bit
benrr101 48228d5
Fix property definition in build.proj :shrug_man:
benrr101 84120c1
Fixing build.proj ... there's still some complexities in here that ar…
benrr101 07a4272
Copy the dll/pdb for ApiScan
benrr101 dd1441c
Why even have array types if we can't use them
benrr101 b170f38
Rename file
benrr101 61e7367
Reinstating the tree command, fixing some path variables.
benrr101 1478059
Fixing source path for apiscan extract
benrr101 1b04be5
Man just when I think I get it, I don't get it.
benrr101 da34f0f
Not sure why it matters if there is a slash at the end or not. But le…
benrr101 ca7d1c5
I guess variable templates can't depend on variables from other templ…
benrr101 d5e7fb7
There's no type safety anywhere else, but there is when I want to pri…
benrr101 541a80f
:expressionless:
benrr101 82ba738
Fix template name for symbols publishing step
benrr101 6f0dcaa
Fix values name
benrr101 66a65ae
Merge branch 'main' into dev/russellben/akv-pipeline
benrr101 89474dc
Yeah, I don't know what's broken here. This is a random guess.
benrr101 7da4efd
Parameter to symbols publishing step
benrr101 5984fc5
Artifacts path != Build output artifacts folder
benrr101 ed0a20f
Remove \"
benrr101 54d75f0
Language injection would've helped me with that
benrr101 e337b9b
Needed some quote marks
benrr101 36baeff
Fix issue with network isolation
benrr101 8866966
Rename buildPreview to runSdlTasks, cleanup a couple to-dos
benrr101 0371d50
Whoops.
benrr101 e0b12cd
Merge branch 'main' into dev/russellben/akv-pipeline
benrr101 2d0012e
Couple tweaks
benrr101 353a782
Remove signing from roslyn analyzers
benrr101 9eafc40
Removing one more to-do
benrr101 a787dea
I doubt case sensitivity matters here, but juuuuust in case, we can t…
benrr101 e10ace7
Disable nuget auditing on CI builds, remove KS2 from feature flags
benrr101 081daa9
Can I turn it off at all?
benrr101 346a24a
ContinuousIntegrationBuild is set later in the file. Use the base field
benrr101 cf57cab
Only report to TSA on official builds
benrr101 1f90c36
Convert to json
benrr101 cab9d63
Ok whatever
benrr101 33d9389
I love it when examples don't actually work
benrr101 81157df
What in the heck
benrr101 0b12b3e
THIS IS SO DUMB
benrr101 1d6c189
Claude save me
benrr101 6d51fc8
Escape sequence fix
benrr101 44bbbc8
Fixing the replacement to be good
benrr101 9dee08c
WORDS WORDS WORDS
benrr101 70dddc6
Standardizing the quotes
benrr101 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | ||
mdaigle marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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 }}' | ||
benrr101 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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)' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.