-
Notifications
You must be signed in to change notification settings - Fork 19
/
azure-pipelines.yml
160 lines (138 loc) · 5.68 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
148
149
150
151
152
153
154
155
156
157
158
159
160
trigger:
- master
- rel/*
pr:
- master
- rel/*
pool:
vmImage: 'windows-latest'
variables:
buildPlatform: 'Any CPU'
BuildPlatformDirName: 'AnyCpu'
buildConfiguration: 'Release'
rootDir: '$(Build.SourcesDirectory)'
oDataClientFactorySln: '$(rootDir)\sln\ODataClientFactory.sln'
oDataMigrationSln: '$(rootDir)\sln\ODataMigration.sln'
signigConfigPath: '$(rootDir)\configs'
signingConfigFiles: '*.*'
productBinPath: '$(rootDir)\bin\$(BuildPlatformDirName)\$(buildConfiguration)\Product'
productFiles: 'Microsoft.OData.Extensions.*?(*.dll|*.config|*.pdb)'
snExe: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\sn.exe'
snExe64: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\sn.exe'
VERSION_SEMANITCS_CLIENT: '$(VersionSemanticsClient)'
VERSION_SEMANITCS_CLIENT_ABSTRACTIONS: '$(VersionSemanticsClientAbstractions)'
VERSION_SEMANITCS_MIGRATIONS: '$(VersionSemanticsMigration)'
RELEASE_SEMANTICS: '$(ReleaseSemantics)'
stages:
- stage: Build
jobs:
- job: Build
steps:
- task: NuGetToolInstaller@1
displayName: 'Use NuGet >=5.2.0'
inputs:
versionSpec: '>=5.2.0'
- task: NuGetCommand@2
displayName: 'NuGet restore'
- task: VSBuild@1
displayName: 'Build solution sln/ODataClientFactory.sln'
inputs:
solution: $(oDataClientFactorySln)
vsVersion: "16.0"
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- task: VSBuild@1
displayName: 'Build solution sln/ODataMigration.sln'
inputs:
solution: $(oDataMigrationSln)
vsVersion: "16.0"
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Running All Tests'
inputs:
command: test
projects: '**/*Tests/*.csproj'
- task: DotNetCoreCLI@2
displayName: 'Build Client Libraries'
inputs:
command: build
arguments: --configuration=$(buildConfiguration)
projects: |
$(rootDir)\src\Microsoft.OData.Extensions.Client\Microsoft.OData.Extensions.Client.csproj
$(rootDir)\src\Microsoft.OData.Extensions.Client.Abstractions\Microsoft.OData.Extensions.Client.Abstractions.csproj
platform: '$(buildPlatform)'
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: pack
arguments: >
$(rootDir)\src\Microsoft.OData.Extensions.Client.Abstractions\Microsoft.OData.Extensions.Client.Abstractions.csproj
/p:NuspecFile=$(rootDir)\src\Microsoft.OData.Extensions.Client.Abstractions\Microsoft.OData.Extensions.Client.Abstractions.$(RELEASE_SEMANTICS).nuspec
--configuration=$(buildConfiguration)
--output=$(Build.ArtifactStagingDirectory)\Packages
-p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
displayName: Packing Client Abstractions
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: pack
arguments: >
$(rootDir)\src/Microsoft.OData.Extensions.Client\Microsoft.OData.Extensions.Client.csproj
/p:NuspecFile=$(rootDir)\src\Microsoft.OData.Extensions.Client\Microsoft.OData.Extensions.Client.$(RELEASE_SEMANTICS).nuspec
--configuration=$(buildConfiguration)
--output=$(Build.ArtifactStagingDirectory)\Packages
-p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
displayName: Packing Client
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: pack
arguments: >
$(rootDir)\src\Microsoft.OData.Extensions.Migration\Microsoft.OData.Extensions.Migration.csproj
/p:NuspecFile=$(rootDir)\src\Microsoft.OData.Extensions.Migration\Microsoft.OData.Extensions.Migration.$(RELEASE_SEMANTICS).nuspec
--configuration=$(buildConfiguration)
--output=$(Build.ArtifactStagingDirectory)\Packages
-p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
displayName: Packing Migrations
- publish: $(Build.ArtifactStagingDirectory)\Packages
displayName: Publish Build Artifacts
artifact: BuildPackages
- publish: configs
displayName: Publish Signing Scripts
artifact: configs
- stage: CodeSign
condition: and(succeeded('Build'), not(eq(variables['build.reason'], 'PullRequest')))
jobs:
- deployment: CodeSign
displayName: Code Signing
pool:
vmImage: windows-latest
environment: Code Sign - Approvals
variables:
- group: Code Signing
strategy:
runOnce:
deploy:
steps:
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . SignClient
displayName: Install SignTool tool
- pwsh: |
.\SignClient "Sign" `
--baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
--input "**/*.nupkg" `
--config "$(Pipeline.Workspace)\configs\SignClient.json" `
--filelist "$(Pipeline.Workspace)\configs\filelist.txt" `
--user "$(SignClientUser)" `
--secret "$(SignClientSecret)" `
--name "Code Sign packages" `
--description "Signing packages" `
--descriptionUrl "https://github.com/OData/Extensions"
displayName: Sign packages
- publish: $(Pipeline.Workspace)/BuildPackages
displayName: Publish Signed Packages
artifact: SignedPackages