forked from microsoft/Partner-Center-PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
145 lines (129 loc) · 4.46 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
strategy:
matrix:
Linux:
imageName: 'ubuntu-16.04'
macOS:
imageName: 'macos-10.13'
Windows:
imageName: 'Windows-2019'
trigger:
- master
pool:
vmImage: $(imageName)
variables:
buildConfiguration: 'Release'
steps:
- task: CredScan@2
displayName: CredScan
inputs:
toolMajorVersion: 'V2'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- task: PoliCheck@1
displayName: PoliCheck
inputs:
inputType: 'Basic'
targetType: 'F'
targetArgument: '$(Build.SourcesDirectory)'
result: 'PoliCheck.xml'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: custom
custom: msbuild
arguments: 'build.proj /t:Build /p:Configuration=$(buildConfiguration)'
- pwsh: 'Install-Module platyPS -Force -Confirm:$false -Scope CurrentUser'
displayName: 'Install platyPS'
- task: DotNetCoreCLI@2
displayName: 'Generate Help'
inputs:
command: custom
custom: msbuild
arguments: 'build.proj /t:GenerateHelp /p:Configuration=$(buildConfiguration)'
- pwsh: 'Test-ModuleManifest .\artifacts\$(buildConfiguration)\PartnerCenter.psd1'
displayName: 'Validate Manifest'
- task: BinSkim@3
displayName: BinSkim
inputs:
InputType: 'Basic'
Function: 'analyze'
AnalyzeTarget: 'artifacts\$(buildConfiguration)\*.dll;'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1
displayName: 'Post Analysis'
inputs:
BinSkim: true
CredScan: true
PoliCheck: true
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'ESRP code signing'
inputs:
ConnectedServiceName: 'esrp-partner-center-powershell'
FolderPath: 'artifacts\$(buildConfiguration)'
Pattern: 'Microsoft.Store.PartnerCenter.dll,Microsoft.Store.PartnerCenter.PowerShell.dll,*.ps1xml,*.psd1, *.psm1'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: DeleteFiles@1
displayName: Delete the code sign summary file
inputs:
SourceFolder: '_layout'
Contents: '**\CodeSignSummary-*.md'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: CopyFiles@2
displayName: 'Copy artifacts directory to $(build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(system.DefaultWorkingDirectory)'
Contents: 'artifacts\**'
TargetFolder: '$(build.ArtifactStagingDirectory)\'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: CopyFiles@2
displayName: 'Copy build directory to $(build.ArtifactStagingDirectory)'
inputs:
SourceFolder: '$(system.DefaultWorkingDirectory)'
Contents: 'build\**'
TargetFolder: '$(build.ArtifactStagingDirectory)\'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.ArtifactStagingDirectory)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))