|
| 1 | +## VSTS pipeline to build, test, package and sign the nuget package |
| 2 | + |
| 3 | +queue: |
| 4 | + name: sf-pool |
| 5 | + condition: succeeded() |
| 6 | + demands: vstest |
| 7 | + |
| 8 | + |
| 9 | +#Your build definition references the ‘NUGET_PACKAGE_VERSION’ variable, which you’ve selected to be settable at queue time. Create or edit the build definition for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 |
| 10 | +#Your build definition references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build definition for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 |
| 11 | +#Your build definition references the ‘BuildPlatform’ variable, which you’ve selected to be settable at queue time. Create or edit the build definition for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 |
| 12 | + |
| 13 | +steps: |
| 14 | +- task: DotNetCoreInstaller@0 |
| 15 | + displayName: Use .NET Core sdk 2.1.200 |
| 16 | + inputs: |
| 17 | + version: 2.1.200 |
| 18 | + |
| 19 | +- powershell: . 'scripts/Update-AssemblyVersion.ps1' '-version $(NUGET_PACKAGE_VERSION)' true |
| 20 | + displayName: Set assembly/nuget version number |
| 21 | + |
| 22 | +- task: DotNetCoreCLI@2 |
| 23 | + displayName: dotnet build for testing |
| 24 | + inputs: |
| 25 | + arguments: '--no-incremental /t:rebuild /p:Configuration="$(BuildConfiguration)"' |
| 26 | + |
| 27 | +- task: VSTest@2 |
| 28 | + displayName: Test Assemblies |
| 29 | + inputs: |
| 30 | + testAssemblyVer2: | |
| 31 | + **\*test*.dll |
| 32 | + !**\obj\** |
| 33 | + vsTestVersion: 15.0 |
| 34 | + runInParallel: false |
| 35 | + codeCoverageEnabled: false |
| 36 | + platform: '$(BuildPlatform)' |
| 37 | + configuration: '$(BuildConfiguration)' |
| 38 | + |
| 39 | +- task: DotNetCoreCLI@2 |
| 40 | + displayName: dotnet build with delaysigning |
| 41 | + inputs: |
| 42 | + arguments: '--no-incremental /t:rebuild /p:Configuration="$(BuildConfiguration)" /p:CompilationSymbols=DELAYSIGNING' |
| 43 | + |
| 44 | +- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 |
| 45 | + displayName: ESRP CodeSign .Net assemblies |
| 46 | + inputs: |
| 47 | + ConnectedServiceName: 'MSR Springfield Code Signing' |
| 48 | + FolderPath: '$(System.DefaultWorkingDirectory)' |
| 49 | + Pattern: 'microsoft.fsharplu.windows.dll,microsoft.fsharplu.dll,microsoft.fsharplu.json.dll' |
| 50 | + signConfigType: inlineSignParams |
| 51 | + inlineOperation: | |
| 52 | + [ |
| 53 | + { |
| 54 | + "keyCode": "CP-235845-SN", |
| 55 | + "operationSetCode": "StrongNameSign", |
| 56 | + "parameters": [ ], |
| 57 | + "toolName": "sign", |
| 58 | + "toolVersion": "1.0" |
| 59 | + }, |
| 60 | + { |
| 61 | + "keyCode": "CP-235845-SN", |
| 62 | + "operationSetCode": "StrongNameVerify", |
| 63 | + "parameters": [ ], |
| 64 | + "toolName": "sign", |
| 65 | + "toolVersion": "1.0" |
| 66 | + } |
| 67 | + ] |
| 68 | +
|
| 69 | +- task: DotNetCoreCLI@2 |
| 70 | + displayName: dotnet pack nuget |
| 71 | + inputs: |
| 72 | + command: pack |
| 73 | + packagesToPack: '**/*.fsproj' |
| 74 | + packDirectory: '$(Build.ArtifactStagingDirectory)\nuget' |
| 75 | + versioningScheme: byEnvVar |
| 76 | + versionEnvVar: 'NUGET_PACKAGE_VERSION' |
| 77 | + |
| 78 | +- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 |
| 79 | + displayName: ESRP CodeSign Nuget Package |
| 80 | + inputs: |
| 81 | + ConnectedServiceName: 'MSR Springfield Code Signing' |
| 82 | + FolderPath: '$(Build.ArtifactStagingDirectory)\nuget' |
| 83 | + Pattern: '*.nupkg' |
| 84 | + signConfigType: inlineSignParams |
| 85 | + inlineOperation: | |
| 86 | + [ |
| 87 | + { |
| 88 | + "keyCode": "CP-401405", |
| 89 | + "operationSetCode": "NuGetSign", |
| 90 | + "parameters": [ ], |
| 91 | + "toolName": "sign", |
| 92 | + "toolVersion": "1.0" |
| 93 | + }, |
| 94 | + { |
| 95 | + "keyCode": "CP-401405", |
| 96 | + "operationSetCode": "NuGetVerify", |
| 97 | + "parameters": [ ], |
| 98 | + "toolName": "sign", |
| 99 | + "toolVersion": "1.0" |
| 100 | + } |
| 101 | + ] |
| 102 | +
|
| 103 | +- task: DotNetCoreCLI@2 |
| 104 | + displayName: dotnet push nuget |
| 105 | + inputs: |
| 106 | + command: push |
| 107 | + packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' |
| 108 | + publishVstsFeed: '6b4e3a7d-b009-4842-b76e-fb9a587cdc50' |
| 109 | + enabled: false |
| 110 | + |
| 111 | +- task: PublishSymbols@2 |
| 112 | + displayName: Publish symbols |
| 113 | + inputs: |
| 114 | + SearchPattern: '**\bin\**\*.pdb' |
| 115 | + SymbolServerType: TeamServices |
| 116 | + SymbolsProduct: Microsoft.FSharpLu |
| 117 | + SymbolsVersion: '$( NUGET_PACKAGE_VERSION)' |
| 118 | + continueOnError: true |
| 119 | + |
| 120 | +- task: CopyFiles@2 |
| 121 | + displayName: Binplace built assemblies |
| 122 | + inputs: |
| 123 | + Contents: '**\bin\**' |
| 124 | + TargetFolder: '$(Build.ArtifactStagingDirectory)\build' |
| 125 | + enabled: false |
| 126 | + |
| 127 | +- task: PublishBuildArtifacts@1 |
| 128 | + displayName: Publish Artifact: drop |
0 commit comments