microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
.github/ado-publish.yml
156lines · modecode
| 1 | trigger: none |
| 2 | |
| 3 | pr: none |
| 4 | |
| 5 | pool: |
| 6 | vmImage: 'ubuntu-22.04' |
| 7 | |
| 8 | variables: |
| 9 | buildConfiguration: 'Release' |
| 10 | folderPath: '$(Build.SourcesDirectory)' |
| 11 | appRegistrationTenantId: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2' |
| 12 | authenticodeSignId: '2d5c4ab9-0b7e-4f60-bb92-70322df77b94' |
| 13 | nugetSignId: 'a94a770a-9a7b-4888-a3ea-24584b851e49' |
| 14 | |
| 15 | stages: |
| 16 | - stage: Build_Test_Sign_Pack |
| 17 | jobs: |
| 18 | - job: BuildTestSignPack |
| 19 | displayName: 'Build, Test, Sign, and Pack' |
| 20 | steps: |
| 21 | - checkout: self |
| 22 | |
| 23 | - task: UseDotNet@2 |
| 24 | displayName: 'Use .NET 9' |
| 25 | inputs: |
| 26 | packageType: 'sdk' |
| 27 | version: '9.0.x' |
| 28 | |
| 29 | - script: dotnet restore |
| 30 | displayName: 'Restore' |
| 31 | |
| 32 | - script: dotnet build --no-restore --configuration $(buildConfiguration) |
| 33 | displayName: 'Build' |
| 34 | |
| 35 | - script: dotnet test --no-restore --verbosity normal --logger trx --configuration $(buildConfiguration) |
| 36 | displayName: 'Test' |
| 37 | |
| 38 | - task: EsrpCodeSigning@5 |
| 39 | displayName: "Authenticode Sign DLLs" |
| 40 | inputs: |
| 41 | ConnectedServiceName: 'TeamsESRP-CP-230012' |
| 42 | AppRegistrationTenantId: '$(appRegistrationTenantId)' |
| 43 | AppRegistrationClientId: '$(authenticodeSignId)' |
| 44 | AuthSignCertName: '$(authenticodeSignId)' |
| 45 | EsrpClientId: '$(authenticodeSignId)' |
| 46 | AuthAKVName: esrp-teams |
| 47 | UseMSIAuthentication: true |
| 48 | FolderPath: '$(folderPath)' |
| 49 | Pattern: 'Libraries/**/*.dll' |
| 50 | UseMinimatch: true |
| 51 | signConfigType: 'inlineSignParams' |
| 52 | inlineOperation: | |
| 53 | [ |
| 54 | { |
| 55 | "KeyCode": "CP-230012", |
| 56 | "OperationCode": "SigntoolSign", |
| 57 | "Parameters": { |
| 58 | "OpusName": "Microsoft", |
| 59 | "OpusInfo": "http://www.microsoft.com", |
| 60 | "FileDigest": "/fd \"SHA256\"", |
| 61 | "PageHash": "/NPH", |
| 62 | "TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" |
| 63 | }, |
| 64 | "ToolName": "sign", |
| 65 | "ToolVersion": "1.0" |
| 66 | }, |
| 67 | { |
| 68 | "KeyCode": "CP-230012", |
| 69 | "OperationCode": "SigntoolVerify", |
| 70 | "Parameters": {}, |
| 71 | "ToolName": "sign", |
| 72 | "ToolVersion": "1.0" |
| 73 | } |
| 74 | ] |
| 75 | SessionTimeout: '60' |
| 76 | MaxConcurrency: '50' |
| 77 | MaxRetryAttempts: '5' |
| 78 | |
| 79 | - task: DotNetCoreCLI@2 |
| 80 | displayName: 'Pack NuGet Packages' |
| 81 | inputs: |
| 82 | command: pack |
| 83 | packagesToPack: '$(folderPath)/Libraries/**/*.csproj' |
| 84 | packDestination: '$(Build.ArtifactStagingDirectory)' |
| 85 | includeSymbols: false |
| 86 | nobuild: true |
| 87 | configuration: '$(buildConfiguration)' |
| 88 | arguments: '/p:SymbolPackageFormat=snupkg' |
| 89 | |
| 90 | - task: EsrpCodeSigning@5 |
| 91 | displayName: 'Sign NuGet Packages' |
| 92 | inputs: |
| 93 | ConnectedServiceName: 'TeamsESRP-CP-401405' |
| 94 | AppRegistrationTenantId: '$(appRegistrationTenantId)' |
| 95 | AppRegistrationClientId: '$(nugetSignId)' |
| 96 | AuthSignCertName: '$(nugetSignId)' |
| 97 | EsrpClientId: '$(nugetSignId)' |
| 98 | AuthAKVName: esrp-teams |
| 99 | UseMSIAuthentication: true |
| 100 | FolderPath: '$(Build.ArtifactStagingDirectory)' |
| 101 | Pattern: | |
| 102 | *.nupkg |
| 103 | *.snupkg |
| 104 | UseMinimatch: true |
| 105 | signConfigType: 'inlineSignParams' |
| 106 | inlineOperation: | |
| 107 | [ |
| 108 | { |
| 109 | "KeyCode": "CP-401405", |
| 110 | "OperationCode": "NuGetSign", |
| 111 | "ToolName": "sign", |
| 112 | "ToolVersion": "1.0", |
| 113 | "Parameters": {} |
| 114 | }, |
| 115 | { |
| 116 | "KeyCode": "CP-401405", |
| 117 | "OperationCode": "NuGetVerify", |
| 118 | "Parameters": {}, |
| 119 | "ToolName": "sign", |
| 120 | "ToolVersion": "1.0" |
| 121 | } |
| 122 | ] |
| 123 | SessionTimeout: '20' |
| 124 | MaxConcurrency: '50' |
| 125 | MaxRetryAttempts: '5' |
| 126 | PendingAnalysisWaitTimeoutMinutes: '5' |
| 127 | |
| 128 | - task: PublishBuildArtifacts@1 |
| 129 | displayName: 'Publish NuGet Artifacts' |
| 130 | inputs: |
| 131 | PathToPublish: '$(Build.ArtifactStagingDirectory)' |
| 132 | ArtifactName: 'Packages' |
| 133 | |
| 134 | - stage: PushToNuGet |
| 135 | displayName: 'Push NuGet Packages to nuget.org' |
| 136 | dependsOn: Build_Test_Sign_Pack |
| 137 | condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) |
| 138 | jobs: |
| 139 | - deployment: PushPackages |
| 140 | displayName: 'Manual Approval Required to Push Packages' |
| 141 | environment: |
| 142 | name: 'teams-net-publish' |
| 143 | strategy: |
| 144 | runOnce: |
| 145 | deploy: |
| 146 | steps: |
| 147 | - download: current |
| 148 | artifact: Packages |
| 149 | |
| 150 | - task: NuGetCommand@2 |
| 151 | displayName: 'Push NuGet Packages' |
| 152 | inputs: |
| 153 | command: push |
| 154 | packagesToPush: '$(Pipeline.Workspace)/Packages/*.nupkg' |
| 155 | nuGetFeedType: external |
| 156 | publishFeedCredentials: 'Microsoft.Teams.*' |