This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathazure-pipelines.yml
130 lines (118 loc) · 4.27 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
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: 'Office365APIEditor/Office365APIEditor.csproj'
buildPlatform: 'AnyCPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
packagesdirectory: '..\packages'
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '2.1.x'
- task: EsrpCodeSigning@1
inputs:
ConnectedServiceName: 'ESPR CodeSigning'
FolderPath: 'Office365APIEditor\bin\Release'
Pattern: 'Office365APIEditor.exe'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
{
"KeyCode" : "CP-230012",
"OperationCode" : "SigntoolSign",
"Parameters" : {
"OpusName" : "Microsoft",
"OpusInfo" : "http://www.microsoft.com",
"FileDigest" : "/fd \"SHA256\"",
"PageHash" : "/NPH",
"TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-230012",
"OperationCode" : "SigntoolVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
SessionTimeout: '60'
MaxConcurrency: '50'
MaxRetryAttempts: '5'
- task: EsrpCodeSigning@1
inputs:
ConnectedServiceName: 'ESPR CodeSigning'
FolderPath: 'Office365APIEditor\StagingMSI'
Pattern: 'Setup.msi'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
{
"KeyCode" : "CP-230012",
"OperationCode" : "SigntoolSign",
"Parameters" : {
"OpusName" : "Microsoft",
"OpusInfo" : "http://www.microsoft.com",
"FileDigest" : "/fd \"SHA256\"",
"PageHash" : "/NPH",
"TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-230012",
"OperationCode" : "SigntoolVerify",
"Parameters" : {},
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
SessionTimeout: '60'
MaxConcurrency: '50'
MaxRetryAttempts: '5'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PowerShell@2
name: PowerShellTask
env:
ArtifactStagingDirectory: $(Build.ArtifactStagingDirectory)
inputs:
targetType: 'inline'
script: |
$buildNumber = [Regex]::Match((Get-Content "Office365APIEditor\Properties\AssemblyInfo.cs"), "\[assembly: AssemblyVersion\(.(\d+)\.(\d+)\.(\d+)\.(\d+)").Value.Split('"')[1];
Write-Host $buildNumber;
$archivePath = $env:ArtifactStagingDirectory + "\Office365APIEditor_" + $buildNumber + ".zip";
Write-Host $archivePath;
Remove-Item Office365APIEditor\bin\Release\CodeSignSummary*.md;
Compress-Archive -Path Office365APIEditor\bin\Release\* -DestinationPath $archivePath -Update;
Write-Host ('##vso[task.setvariable variable=archivePath;isOutput=true] ' + $archivePath);
$msiPath = $env:ArtifactStagingDirectory + "\Office365APIEditor_" + $buildNumber + ".msi";
Move-Item -Path Office365APIEditor\StagingMSI\Setup.msi -Destination $msiPath
- task: AzureFileCopy@4
inputs:
SourcePath: '$(Build.ArtifactStagingDirectory)/*'
azureSubscription: 'Azure Resource Manager service connection'
Destination: 'AzureBlob'
storage: 'office365apieditor'
ContainerName: 'build'