forked from dotnet/dotNext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
126 lines (126 loc) · 4.5 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
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: UseDotNet@2
displayName: Install .NET 6 SDK
inputs:
packageType: sdk
version: 6.0.100
- 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 "Code coverage"
nobuild: false
testRunTitle: 'Debug on Windows'
publishTestResults: true
- job: Linux
pool:
vmImage: ubuntu-latest
steps:
- task: UseDotNet@2
displayName: Install .NET 6 SDK
inputs:
packageType: sdk
version: 6.0.100
- 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 "Code coverage"
nobuild: false
testRunTitle: 'Debug on Linux'
publishTestResults: true
- stage: BuildPackages
condition: and(succeeded('Tests'), eq(variables.isMain, true))
jobs:
- job: PackAndPublish
pool:
vmImage: ubuntu-latest
steps:
- task: UseDotNet@2
displayName: Install .NET 6 SDK
inputs:
packageType: sdk
version: 6.0.100
- 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/cluster/DotNext.Net.Cluster/DotNext.Net.Cluster.csproj;src/cluster/DotNext.AspNetCore.Cluster/DotNext.AspNetCore.Cluster.csproj
- publish: build
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 . SignClient
- download: current
displayName: Download packages
artifact: packages
- download: current
displayName: Download code sign config
artifact: config
- pwsh: |
.\SignClient "Sign" `
--baseDirectory "$(Pipeline.Workspace)\packages" `
--input "**/*.nupkg" `
--config "$(Pipeline.Workspace)\config\signclient.json" `
--user "$(SignClientUser)" `
--secret '$(SignClientSecret)' `
--name ".NEXT" `
--description ".NEXT" `
--descriptionUrl "https://github.com/dotnet/dotNext"
displayName: Sign packages
- publish: $(Pipeline.Workspace)/packages
displayName: Publish Signed Packages
artifact: SignedPackages