Skip to content

Commit 51f70fb

Browse files
committedJun 11, 2018
Add VSTS pipeline yml file to build, test, package and sign the nuget packages
1 parent 1bd81fa commit 51f70fb

File tree

6 files changed

+143
-10
lines changed

6 files changed

+143
-10
lines changed
 

‎CI-vsts.yml

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
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

‎FSharpLu.Json/FSharpLu.Json.fsproj

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

‎FSharpLu.Windows/AssemblyInfo.fs

+12-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ open System.Reflection
44
open System.Runtime.CompilerServices
55
open System.Runtime.InteropServices
66

7-
// General Information about an assembly is controlled through the following
7+
// General Information about an assembly is controlled through the following
88
// set of attributes. Change these attribute values to modify the information
99
// associated with an assembly.
1010
[<assembly: AssemblyTitle("FSharpLu.Windows")>]
@@ -16,26 +16,31 @@ open System.Runtime.InteropServices
1616
[<assembly: AssemblyTrademark("")>]
1717
[<assembly: AssemblyCulture("")>]
1818

19-
// Setting ComVisible to false makes the types in this assembly not visible
20-
// to COM components. If you need to access a type in this assembly from
19+
// Setting ComVisible to false makes the types in this assembly not visible
20+
// to COM components. If you need to access a type in this assembly from
2121
// COM, set the ComVisible attribute to true on that type.
2222
[<assembly: ComVisible(false)>]
2323

2424
// The following GUID is for the ID of the typelib if this project is exposed to COM
2525
[<assembly: Guid("2e2cdf04-f40a-4a61-a15d-18c2451ccf6e")>]
2626

2727
// Version information for an assembly consists of the following four values:
28-
//
28+
//
2929
// Major Version
30-
// Minor Version
30+
// Minor Version
3131
// Build Number
3232
// Revision
33-
//
34-
// You can specify all the values or you can default the Build and Revision Numbers
33+
//
34+
// You can specify all the values or you can default the Build and Revision Numbers
3535
// by using the '*' as shown below:
3636
// [<assembly: AssemblyVersion("0.10.*")>]
3737
[<assembly: AssemblyVersion("0.10.*")>]
3838
[<assembly: AssemblyFileVersion("0.10.*")>]
3939

40+
#if DELAYSIGNING
41+
[<assembly:AssemblyDelaySignAttribute(true)>]
42+
[<assembly:AssemblyKeyFileAttribute(@"..\msft-StrongName.pub")>]
43+
#endif
44+
4045
do
4146
()

‎FSharpLu.Windows/FSharpLu.Windows.fsproj

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

‎FSharpLu/FSharpLu.fsproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<Description>Utilities and .Net library wrappers for F#</Description>
99
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
1010
<PackageTags>F#, FSharp, FSharp utilities, collection, logging, diagnostic, async, Json</PackageTags>
11-
<PackageReleaseNotes>Port projects to .Net core</PackageReleaseNotes>
11+
<PackageReleaseNotes>Signed assemblies and nuget package</PackageReleaseNotes>
1212
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1313
<Company>Microsoft</Company>
1414
<PackageId>Microsoft.FSharpLu</PackageId>

‎msft-StrongName.pub

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.