|
| 1 | +################################################################################# |
| 2 | +# Licensed to the .NET Foundation under one or more agreements. # |
| 3 | +# The .NET Foundation licenses this file to you under the MIT license. # |
| 4 | +# See the LICENSE file in the project root for more information. # |
| 5 | +################################################################################# |
| 6 | + |
| 7 | +parameters: |
| 8 | + - name: apiScanDllPath |
| 9 | + type: string |
| 10 | + |
| 11 | + - name: apiScanPdbPath |
| 12 | + type: string |
| 13 | + |
| 14 | + - name: assemblyFileVersion |
| 15 | + type: string |
| 16 | + |
| 17 | + - name: buildConfiguration |
| 18 | + type: string |
| 19 | + |
| 20 | + - name: nugetPackageVersion |
| 21 | + type: string |
| 22 | + |
| 23 | + - name: mdsPackageVersion |
| 24 | + type: string |
| 25 | + |
| 26 | + - name: publishSymbols |
| 27 | + type: boolean |
| 28 | + |
| 29 | + - name: signingAppRegistrationClientId |
| 30 | + type: string |
| 31 | + |
| 32 | + - name: signingAppRegistrationTenantId |
| 33 | + type: string |
| 34 | + |
| 35 | + - name: signingAkvName |
| 36 | + type: string |
| 37 | + |
| 38 | + - name: signingAuthCertName |
| 39 | + type: string |
| 40 | + |
| 41 | + - name: signingConnectedServiceName |
| 42 | + type: string |
| 43 | + |
| 44 | + - name: signingSignCertName |
| 45 | + type: string |
| 46 | + |
| 47 | + - name: symbolsAzureSubscription |
| 48 | + type: string |
| 49 | + |
| 50 | + - name: symbolsPublishProjectName |
| 51 | + type: string |
| 52 | + |
| 53 | + - name: symbolsPublishServer |
| 54 | + type: string |
| 55 | + |
| 56 | + - name: symbolsPublishTokenUri |
| 57 | + type: string |
| 58 | + |
| 59 | + - name: symbolsUploadAccount |
| 60 | + type: string |
| 61 | + |
| 62 | + # @TODO: This should be determined from build output, or at a higher level |
| 63 | + - # Note: not intended to be passed in, is only used for copying files for ApiScan. |
| 64 | + # This is only defined as a parameter since ADO pipelines do not support array variables. |
| 65 | + name: targetFrameworks |
| 66 | + type: object |
| 67 | + default: |
| 68 | + - net462 |
| 69 | + - net8.0 |
| 70 | + - net9.0 |
| 71 | + |
| 72 | +jobs: |
| 73 | + - job: buildSignedAkvPackage |
| 74 | + displayName: 'Build Signed AKV Package' |
| 75 | + pool: |
| 76 | + type: windows |
| 77 | + |
| 78 | + variables: |
| 79 | + ob_outputDirectory: '$(ARTIFACT_PATH)' |
| 80 | + |
| 81 | + steps: |
| 82 | + - template: ../steps/script-output-environment-variables-step.yml@self |
| 83 | + |
| 84 | + - powershell: | |
| 85 | + $jsonParams = '${{ convertToJson(parameters) }}' -replace '\\', '\\' |
| 86 | + $jsonParams | ConvertFrom-Json | Format-List |
| 87 | + displayName: 'Output Job Parameters' |
| 88 | +
|
| 89 | + - template: ../steps/compound-build-akv-step.yml@self |
| 90 | + parameters: |
| 91 | + assemblyFileVersion: '${{ parameters.assemblyFileVersion }}' |
| 92 | + buildConfiguration: '${{ parameters.buildConfiguration }}' |
| 93 | + mdsPackageVersion: '${{ parameters.mdsPackageVersion }}' |
| 94 | + |
| 95 | + - ${{ each targetFramework in parameters.targetFrameworks }}: |
| 96 | + - template: ../steps/compound-extract-akv-apiscan-files-step.yml |
| 97 | + parameters: |
| 98 | + buildConfiguration: '${{ parameters.buildConfiguration }}' |
| 99 | + dllPath: '${{ parameters.apiScanDllPath }}' |
| 100 | + pdbPath: '${{ parameters.apiScanPdbPath }}' |
| 101 | + referenceType: Package |
| 102 | + targetFramework: '${{ targetFramework }}' |
| 103 | + |
| 104 | + - template: ../steps/roslyn-analyzers-akv-step.yml@self |
| 105 | + parameters: |
| 106 | + buildConfiguration: '${{ parameters.buildConfiguration }}' |
| 107 | + mdsPackageVersion: '${{ parameters.mdsPackageVersion }}' |
| 108 | + |
| 109 | + - template: ../steps/compound-esrp-code-signing-step.yml@self |
| 110 | + parameters: |
| 111 | + akvName: '${{ parameters.signingAkvName }}' |
| 112 | + appRegistrationClientId: '${{ parameters.signingAppRegistrationClientId }}' |
| 113 | + appRegistrationTenantId: '${{ parameters.signingAppRegistrationTenantId }}' |
| 114 | + artifactType: 'dll' |
| 115 | + authCertName: '${{ parameters.signingAuthCertName }}' |
| 116 | + connectedServiceName: '${{ parameters.signingConnectedServiceName }}' |
| 117 | + signingCertName: '${{ parameters.signingSignCertName }}' |
| 118 | + |
| 119 | + - template: ../steps/compound-nuget-pack-step.yml@self |
| 120 | + parameters: |
| 121 | + buildConfiguration: '${{ parameters.buildConfiguration }}' |
| 122 | + generateSymbolsPackage: true # Always generate symbols, even if they are not published |
| 123 | + packageVersion: '${{ parameters.nugetPackageVersion }}' |
| 124 | + nuspecPath: '$(REPO_ROOT)/tools/specs/add-ons/$(PACKAGE_NAME).nuspec' |
| 125 | + outputDirectory: '$(ARTIFACT_PATH)' |
| 126 | + referenceType: 'Package' |
| 127 | + |
| 128 | + - template: ../steps/compound-esrp-code-signing-step.yml@self |
| 129 | + parameters: |
| 130 | + akvName: '${{ parameters.signingAkvName }}' |
| 131 | + appRegistrationClientId: '${{ parameters.signingAppRegistrationClientId }}' |
| 132 | + appRegistrationTenantId: '${{ parameters.signingAppRegistrationTenantId }}' |
| 133 | + artifactType: 'pkg' |
| 134 | + authCertName: '${{ parameters.signingAuthCertName }}' |
| 135 | + connectedServiceName: '${{ parameters.signingConnectedServiceName }}' |
| 136 | + signingCertName: '${{ parameters.signingSignCertName }}' |
| 137 | + |
| 138 | + - ${{ if parameters.publishSymbols }}: |
| 139 | + - template: ../steps/compound-publish-symbols-step.yml@self |
| 140 | + parameters: |
| 141 | + artifactName: 'akv_symbols_$(System.TeamProject)_$(Build.Repository.Name)_$(Build.SourceBranchName)_${{ parameters.nugetPackageVersion }}_$(System.TimelineId)' |
| 142 | + azureSubscription: '${{ parameters.symbolsAzureSubscription }}' |
| 143 | + publishProjectName: '${{ parameters.symbolsPublishProjectName }}' |
| 144 | + packageName: '$(PACKAGE_NAME)' |
| 145 | + publishServer: '${{ parameters.symbolsPublishServer }}' |
| 146 | + publishToInternal: true |
| 147 | + publishToPublic: true |
| 148 | + publishTokenUri: '${{ parameters.symbolsPublishTokenUri }}' |
| 149 | + referenceType: 'Package' |
| 150 | + searchPattern: | |
| 151 | + Windows_NT/${{ parameters.buildConfiguration }}.AnyCPU/AzureKeyVaultProvider/**/$(PACKAGE_NAME).pdb |
| 152 | + AnyOS/${{ parameters.buildConfiguration }}.AnyCPU/AzureKeyVaultProvider/**/$(PACKAGE_NAME).pdb |
| 153 | + uploadAccount: '${{ parameters.symbolsUploadAccount }}' |
| 154 | + version: '${{ parameters.nugetPackageVersion }}' |
0 commit comments