This repository has been archived by the owner on Aug 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazure-pipelines.yml
195 lines (180 loc) · 5.4 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
trigger:
- master
- develop
pr:
- develop
- master
name: $(Date:yyyyMMdd)-$(Rev:r)
pool:
vmImage: 'windows-latest'
variables:
solution: 'ECMA2Yaml/ECMA2Yaml.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
displayName: Nuget Restore
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
displayName: Build
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
displayName: Unit Tests
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PowerShell@2
displayName: Integration Tests
inputs:
filePath: 'CI/devopsIntTest.ps1'
# Security Tasks
- task: CredScan@2
displayName: Security - CredScan
inputs:
toolMajorVersion: 'V2'
- task: PostAnalysis@1
displayName: Security - PostAnalysis
inputs:
AllTools: false
APIScan: false
BinSkim: false
CodesignValidation: false
CredScan: true
FortifySCA: false
FxCop: false
ModernCop: false
PoliCheck: false
RoslynAnalyzers: false
SDLNativeRules: false
Semmle: false
TSLint: false
ToolLogsNotFoundAction: 'Standard'
# Publish Artifacts for debug
- task: PublishPipelineArtifact@1
displayName: 'Publish Pipeline Artifact'
inputs:
targetPath: 'test'
artifact: test
condition: succeededOrFailed()
- task: EsrpCodeSigning@1
displayName: Sign exe, dll and powershell files
inputs:
ConnectedServiceName: 'CodeSigning-APEX'
FolderPath: '$(System.DefaultWorkingDirectory)/ECMA2Yaml'
Pattern: |
ECMA2Yaml\bin\Release\**\*.dll
ECMA2Yaml\bin\Release\**\*.exe
IntellisenseFileGen\bin\Release\**\*.exe
MSDNUrlPatch\bin\Release\**\*.exe
ECMA2Yaml\Nuget\*.ps1
ECMAHelper\bin\Release\**\*.dll
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode": "CP-236167",
"OperationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
}
],
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-236167",
"OperationSetCode": "SigntoolVerify",
"Parameters": [
{
"parameterName": "VerifyAll",
"parameterValue": "/all"
}
],
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
SessionTimeout: '60'
MaxConcurrency: '50'
MaxRetryAttempts: '5'
# Pack ECMA2Yaml
- task: PowerShell@2
displayName: Nuget Pack ECMA2Yaml
inputs:
filePath: 'CI/devopsPack.ps1'
# Pack ECMAHelper
- task: MSBuild@1
displayName: Nuget Pack ECMAHelper
inputs:
solution: 'ECMA2Yaml\ECMAHelper\ECMAHelper.csproj'
configuration: 'Release'
msbuildArguments: '-t:pack -p:PackageOutputPath=$(Build.SourcesDirectory)\_nuget\ECMAHelper -p:PackageVersion=$(CurrentPackageVersion)'
# Publish Nuget Package
- task: GitHubRelease@1
displayName: GitHub Release Offical
condition: and(succeeded(), and(eq(variables['ECMA2YamlNugetPush'], 'Yes'), eq(variables['NugetVersionType'], 'release')))
inputs:
gitHubConnection: 'ECMA2Yaml'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: '$(CurrentPackageVersion)'
assets: '$(Build.SourcesDirectory)/_nuget/ECMA2Yaml/*.nupkg'
isPreRelease: false
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'
- task: GitHubRelease@1
displayName: GitHub Release Prerelease
condition: and(succeeded(), and(eq(variables['ECMA2YamlNugetPush'], 'Yes'), eq(variables['NugetVersionType'], 'prerelease')))
inputs:
gitHubConnection: 'ECMA2Yaml'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: '$(CurrentPackageVersion)'
assets: '$(Build.SourcesDirectory)/_nuget/ECMA2Yaml/*.nupkg'
isPreRelease: true
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'
- task: DotNetCoreCLI@2
displayName: Nuget Publish ECMA2Yaml
condition: and(succeeded(), eq(variables['ECMA2YamlNugetPush'], 'Yes'))
inputs:
command: 'push'
packagesToPush: '$(Build.SourcesDirectory)/_nuget/ECMA2Yaml/*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'd3d54af3-265a-4f18-95f6-9a46397ca583/fb2f1e25-b247-417a-a19f-40ba5a96d884'
- task: DotNetCoreCLI@2
displayName: Nuget Publish ECMAHelper
condition: and(succeeded(), eq(variables['ECMA2YamlNugetPush'], 'Yes'))
inputs:
command: 'push'
packagesToPush: '$(Build.SourcesDirectory)/_nuget/ECMAHelper/*.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'docs-public-packages'