Add VSTS pipeline yml file to build, test, package and sign the nuget packages

This commit is contained in:
William Blum 2018-06-07 23:25:01 -07:00 коммит произвёл William Blum
Родитель 1bd81fa278
Коммит 51f70fb275
6 изменённых файлов: 143 добавлений и 10 удалений

128
CI-vsts.yml Normal file
Просмотреть файл

@ -0,0 +1,128 @@
## VSTS pipeline to build, test, package and sign the nuget package
queue:
name: sf-pool
condition: succeeded()
demands: vstest
#Your build definition references the NUGET_PACKAGE_VERSION variable, which youve 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
#Your build definition references the BuildConfiguration variable, which youve 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
#Your build definition references the BuildPlatform variable, which youve 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
steps:
- task: DotNetCoreInstaller@0
displayName: Use .NET Core sdk 2.1.200
inputs:
version: 2.1.200
- powershell: . 'scripts/Update-AssemblyVersion.ps1' '-version $(NUGET_PACKAGE_VERSION)' true
displayName: Set assembly/nuget version number
- task: DotNetCoreCLI@2
displayName: dotnet build for testing
inputs:
arguments: '--no-incremental /t:rebuild /p:Configuration="$(BuildConfiguration)"'
- task: VSTest@2
displayName: Test Assemblies
inputs:
testAssemblyVer2: |
**\*test*.dll
!**\obj\**
vsTestVersion: 15.0
runInParallel: false
codeCoverageEnabled: false
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: dotnet build with delaysigning
inputs:
arguments: '--no-incremental /t:rebuild /p:Configuration="$(BuildConfiguration)" /p:CompilationSymbols=DELAYSIGNING'
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: ESRP CodeSign .Net assemblies
inputs:
ConnectedServiceName: 'MSR Springfield Code Signing'
FolderPath: '$(System.DefaultWorkingDirectory)'
Pattern: 'microsoft.fsharplu.windows.dll,microsoft.fsharplu.dll,microsoft.fsharplu.json.dll'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-235845-SN",
"operationSetCode": "StrongNameSign",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-235845-SN",
"operationSetCode": "StrongNameVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
- task: DotNetCoreCLI@2
displayName: dotnet pack nuget
inputs:
command: pack
packagesToPack: '**/*.fsproj'
packDirectory: '$(Build.ArtifactStagingDirectory)\nuget'
versioningScheme: byEnvVar
versionEnvVar: 'NUGET_PACKAGE_VERSION'
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: ESRP CodeSign Nuget Package
inputs:
ConnectedServiceName: 'MSR Springfield Code Signing'
FolderPath: '$(Build.ArtifactStagingDirectory)\nuget'
Pattern: '*.nupkg'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetSign",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
- task: DotNetCoreCLI@2
displayName: dotnet push nuget
inputs:
command: push
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
publishVstsFeed: '6b4e3a7d-b009-4842-b76e-fb9a587cdc50'
enabled: false
- task: PublishSymbols@2
displayName: Publish symbols
inputs:
SearchPattern: '**\bin\**\*.pdb'
SymbolServerType: TeamServices
SymbolsProduct: Microsoft.FSharpLu
SymbolsVersion: '$( NUGET_PACKAGE_VERSION)'
continueOnError: true
- task: CopyFiles@2
displayName: Binplace built assemblies
inputs:
Contents: '**\bin\**'
TargetFolder: '$(Build.ArtifactStagingDirectory)\build'
enabled: false
- task: PublishBuildArtifacts@1
displayName: Publish Artifact: drop

Просмотреть файл

@ -9,7 +9,7 @@
<Description>Json serialization converters for F# option types and discriminated unions.</Description>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageTags>F#, FSharp, Utilities, Json, discriminated unions</PackageTags>
<PackageReleaseNotes>Port project to .NET Core</PackageReleaseNotes>
<PackageReleaseNotes>Signed assemblies and nuget package</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/Microsoft/fsharplu</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/Microsoft/fsharplu/blob/master/LICENSE.MD</PackageLicenseUrl>
<RepositoryUrl>https://github.com/Microsoft/fsharplu/</RepositoryUrl>

Просмотреть файл

@ -4,7 +4,7 @@ open System.Reflection
open System.Runtime.CompilerServices
open System.Runtime.InteropServices
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[<assembly: AssemblyTitle("FSharpLu.Windows")>]
@ -16,8 +16,8 @@ open System.Runtime.InteropServices
[<assembly: AssemblyTrademark("")>]
[<assembly: AssemblyCulture("")>]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[<assembly: ComVisible(false)>]
@ -25,17 +25,22 @@ open System.Runtime.InteropServices
[<assembly: Guid("2e2cdf04-f40a-4a61-a15d-18c2451ccf6e")>]
// Version information for an assembly consists of the following four values:
//
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [<assembly: AssemblyVersion("0.10.*")>]
[<assembly: AssemblyVersion("0.10.*")>]
[<assembly: AssemblyFileVersion("0.10.*")>]
#if DELAYSIGNING
[<assembly:AssemblyDelaySignAttribute(true)>]
[<assembly:AssemblyKeyFileAttribute(@"..\msft-StrongName.pub")>]
#endif
do
()

Просмотреть файл

@ -10,7 +10,7 @@
<Description>Windows specific helpers requiring the full .NetFramework</Description>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageTags>F#, FSharp, Utilities, Windows, Security, Console</PackageTags>
<PackageReleaseNotes>Port project to .NET Core</PackageReleaseNotes>
<PackageReleaseNotes>Signed assemblies and nuget package</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/Microsoft/fsharplu</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/Microsoft/fsharplu/blob/master/LICENSE.MD</PackageLicenseUrl>
<RepositoryUrl>https://github.com/Microsoft/fsharplu/</RepositoryUrl>

Просмотреть файл

@ -8,7 +8,7 @@
<Description>Utilities and .Net library wrappers for F#</Description>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageTags>F#, FSharp, FSharp utilities, collection, logging, diagnostic, async, Json</PackageTags>
<PackageReleaseNotes>Port projects to .Net core</PackageReleaseNotes>
<PackageReleaseNotes>Signed assemblies and nuget package</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Company>Microsoft</Company>
<PackageId>Microsoft.FSharpLu</PackageId>

Двоичные данные
msft-StrongName.pub

Двоичный файл не отображается.