|
| 1 | +trigger: none |
| 2 | +pr: none |
| 3 | + |
| 4 | +variables: |
| 5 | + mainProjectPath: '$(Build.Repository.LocalPath)/*.sln' |
| 6 | + exampleProjectFolder: '$(Build.Repository.LocalPath)/example/' |
| 7 | + exampleProjectPath: '$(Build.Repository.LocalPath)/example/*.sln' |
| 8 | + outputFolder: '$(Build.Repository.LocalPath)/output/' |
| 9 | + |
| 10 | +pool: |
| 11 | + vmImage: 'ubuntu-latest' |
| 12 | + |
| 13 | +steps: |
| 14 | + - checkout: self |
| 15 | + displayName: 'Checkout Repository' |
| 16 | + |
| 17 | + - task: UseDotNet@2 |
| 18 | + inputs: |
| 19 | + packageType: 'sdk' |
| 20 | + version: '8.x' |
| 21 | + displayName: 'Setup dotnet' |
| 22 | + |
| 23 | + - task: NuGetCommand@2 |
| 24 | + inputs: |
| 25 | + restoreSolution: '$(mainProjectPath)' |
| 26 | + displayName: 'NuGet Restore Main Solution' |
| 27 | + |
| 28 | + - task: DotNetCoreCLI@2 |
| 29 | + inputs: |
| 30 | + command: 'build' |
| 31 | + projects: '$(mainProjectPath)' |
| 32 | + displayName: 'Build Main Solution' |
| 33 | + |
| 34 | + - task: DotNetCoreCLI@2 |
| 35 | + inputs: |
| 36 | + command: 'test' |
| 37 | + projects: '$(mainProjectPath)' |
| 38 | + displayName: 'Test Main Solution' |
| 39 | + |
| 40 | + - task: DotNetCoreCLI@2 |
| 41 | + inputs: |
| 42 | + command: 'pack' |
| 43 | + packagesToPack: '$(mainProjectPath)' |
| 44 | + displayName: 'Create NuGet Packages from Main Solution' |
| 45 | + |
| 46 | + - task: NuGetCommand@2 |
| 47 | + inputs: |
| 48 | + restoreSolution: '$(mainProjectPath)' |
| 49 | + displayName: 'NuGet Restore Example Solution' |
| 50 | + |
| 51 | + - script: dotnet tool restore |
| 52 | + displayName: 'Restore .NET Tools for Example Project' |
| 53 | + workingDirectory: '$(exampleProjectFolder)' |
| 54 | + |
| 55 | + - task: DotNetCoreCLI@2 |
| 56 | + inputs: |
| 57 | + command: 'build' |
| 58 | + projects: '$(exampleProjectPath)' |
| 59 | + displayName: 'Build Example Solution' |
| 60 | + |
| 61 | + - task: DotNetCoreCLI@2 |
| 62 | + inputs: |
| 63 | + command: 'test' |
| 64 | + projects: '$(exampleProjectPath)' |
| 65 | + displayName: 'Test Example Solution' |
| 66 | + |
| 67 | + - task: onebranch.pipeline.signing@1 |
| 68 | + displayName: 'Sign NuGet package' |
| 69 | + inputs: |
| 70 | + command: 'sign' |
| 71 | + signing_environment: 'azure-ado' |
| 72 | + cp_code: CP-401405 |
| 73 | + signing_profile: 'external_distribution' |
| 74 | + # signing_profile: 'CP-401405' |
| 75 | + files_to_sign: '*.nupkg' |
| 76 | + search_root: '$(outputFolder)' |
| 77 | + |
| 78 | + - task: NuGetCommand@2 |
| 79 | + inputs: |
| 80 | + command: 'verify' |
| 81 | + packagesToVerify: '*.nupkg' |
| 82 | + displayName: 'Verify Signed NuGet Packages' |
| 83 | + workingDirectory: '$(outputFolder)' |
| 84 | + |
| 85 | + - task: PublishBuildArtifacts@1 |
| 86 | + inputs: |
| 87 | + pathToPublish: '$(outputFolder)' |
| 88 | + artifactName: 'SignedPackages' |
| 89 | + publishLocation: 'Container' |
| 90 | + displayName: 'Upload Signed NuGet Packages' |
0 commit comments