-
Notifications
You must be signed in to change notification settings - Fork 124
/
azure-pipelines.yml
147 lines (147 loc) · 5.71 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
variables:
Solution: src/DotNext.sln
TestFolder: src/DotNext.Tests
TestProject: $(TestFolder)/DotNext.Tests.csproj
InternetAccess: false
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')]
trigger:
- master
- develop
stages:
- stage: Tests
jobs:
- job: Windows
pool:
vmImage: windows-latest
steps:
- task: DotNetCoreCLI@2
displayName: Restore Packages
inputs:
command: restore
projects: '$(Solution)'
feedsToUse: 'config'
nugetConfigPath: 'NuGet.config'
- task: DotNetCoreCLI@2
displayName: Test Debug
inputs:
command: test
projects: $(TestProject)
arguments: --configuration Debug --collect "XPlat Code Coverage"
nobuild: false
testRunTitle: 'Debug on Windows'
publishTestResults: true
- task: PublishCodeCoverageResults@2
displayName: 'Publish code coverage'
inputs:
summaryFileLocation: $(Agent.TempDirectory)/*/coverage.cobertura.xml
- job: Linux
pool:
vmImage: ubuntu-latest
steps:
- task: DotNetCoreCLI@2
displayName: Restore Packages
inputs:
command: restore
projects: '$(Solution)'
feedsToUse: 'config'
nugetConfigPath: 'NuGet.config'
arguments: --configuration Debug
- task: DotNetCoreCLI@2
displayName: Test Debug
inputs:
command: test
projects: $(TestProject)
arguments: --configuration Debug --collect "XPlat Code Coverage"
nobuild: false
testRunTitle: 'Debug on Linux'
publishTestResults: true
- task: PublishCodeCoverageResults@2
displayName: 'Publish code coverage'
inputs:
summaryFileLocation: $(Agent.TempDirectory)/*/coverage.cobertura.xml
- job: MacOS
pool:
vmImage: macOS-latest
steps:
- task: DotNetCoreCLI@2
displayName: Restore Packages
inputs:
command: restore
projects: '$(Solution)'
feedsToUse: 'config'
nugetConfigPath: 'NuGet.config'
arguments: --configuration Debug
- task: DotNetCoreCLI@2
displayName: Test Debug
inputs:
command: test
projects: $(TestProject)
arguments: --configuration Debug --collect "XPlat Code Coverage"
nobuild: false
testRunTitle: 'Debug on MacOS'
publishTestResults: true
- task: PublishCodeCoverageResults@2
displayName: 'Publish code coverage'
inputs:
summaryFileLocation: $(Agent.TempDirectory)/*/coverage.cobertura.xml
- stage: BuildPackages
condition: and(succeeded('Tests'), eq(variables.isMain, true))
jobs:
- job: PackAndPublish
pool:
vmImage: ubuntu-latest
steps:
- task: DotNetCoreCLI@2
displayName: Pack
inputs:
command: pack
nobuild: false
configuration: Release
packDirectory: $(Build.ArtifactStagingDirectory)/packages
verbosityPack: Minimal
packagesToPack: src/DotNext/DotNext.csproj;src/DotNext.IO/DotNext.IO.csproj;src/DotNext.Metaprogramming/DotNext.Metaprogramming.csproj;src/DotNext.Reflection/DotNext.Reflection.csproj;src/DotNext.Threading/DotNext.Threading.csproj;src/DotNext.Unsafe/DotNext.Unsafe.csproj;src/DotNext.MaintenanceServices/DotNext.MaintenanceServices.csproj;src/cluster/DotNext.Net.Cluster/DotNext.Net.Cluster.csproj;src/cluster/DotNext.AspNetCore.Cluster/DotNext.AspNetCore.Cluster.csproj
- publish: config
displayName: Publish signing config
artifact: config
- publish: $(Build.ArtifactStagingDirectory)/packages
displayName: Publish artifacts
artifact: packages
- stage: SignPackages
condition: succeeded('BuildPackages')
jobs:
- job: CodeSign
pool:
vmImage: windows-latest
variables:
- group: Sign Client Credentials
steps:
- task: DotNetCoreCLI@2
displayName: Install SignTool tool
inputs:
command: custom
custom: tool
arguments: install --tool-path . sign --version 0.9.0-beta.23127.3
- download: current
displayName: Download packages
artifact: packages
- download: current
displayName: Download signing file list
artifact: config
- pwsh: |
.\sign code azure-key-vault `
"**/*.nupkg" `
--base-directory "$(Pipeline.Workspace)\packages" `
--file-list "$(Pipeline.Workspace)\config\filelist.txt" `
--publisher-name ".NEXT Contributors" `
--description ".NEXT Family of Libraries" `
--description-url "https://github.com/dotnet/dotNext" `
--azure-key-vault-tenant-id "$(SignTenantId)" `
--azure-key-vault-client-id "$(SignClientId)" `
--azure-key-vault-client-secret '$(SignClientSecret)' `
--azure-key-vault-certificate "$(SignKeyVaultCertificate)" `
--azure-key-vault-url "$(SignKeyVaultUrl)"
displayName: Sign packages
- publish: $(Pipeline.Workspace)/packages
displayName: Publish Signed Packages
artifact: SignedPackages