-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
Copy pathdaily-build.yml
177 lines (164 loc) · 5.42 KB
/
daily-build.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
# Please don't use ADO UI defined scheduled triggers because it takes precedence over YAML scheduled triggers.
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/scheduled-triggers
variables:
today: $(Get-Date -Format yyyyMMddhhmmss)
schedules:
- cron: "0 18 * * *"
displayName: 2:00 AM (UTC + 8:00) China Daily Build
branches:
include:
- main
pr: none
jobs:
- job: DailyBuild
timeoutInMinutes: 180
pool: pool-windows-2019
steps:
- task: PowerShell@2
displayName: 'Initialization'
inputs:
targetType: 'inline'
script: |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# Avoid issue of filename too long
git config --global core.longpaths true
# Wipe any changes from a previous branch
git clean -xdf
- task: PowerShell@2
displayName: Prepare Powershell $(PSVersion)
inputs:
filePath: 'tools/Test/SmokeTest/PrepareRequiredPowershell.ps1'
arguments: '-RequiredPsVersion $(PSVersion)'
- task: PowerShell@2
displayName: 'Install platyPS'
inputs:
targetType: 'inline'
script: |
$command = "`$PSVersionTable `
Install-Module platyPS -Force -Confirm:`$false -Scope CurrentUser `
Exit"
dotnet tool run pwsh -c $command
- task: DotNetCoreCLI@2
displayName: 'Build for Bumping Version'
inputs:
command: custom
custom: msbuild
arguments: 'build.proj /t:"Build" /p:"Configuration=Release"'
- task: PowerShell@2
displayName: 'Bump Version'
inputs:
targetType: 'inline'
script: |
$command = "`$PSVersionTable `
Get-PSRepository `
./tools/RunVersionController.ps1 -Release 'Daily Build $(today)' `
Exit"
dotnet tool run pwsh -c $command
- task: PowerShell@2
displayName: 'Clean artifacts folder'
inputs:
targetType: 'inline'
script: |
Remove-Item -Force -Recurse -Path artifacts
- task: DotNetCoreCLI@2
displayName: 'Build after Version Bump up'
inputs:
command: custom
custom: msbuild
arguments: 'build.proj /t:Build /p:Configuration=Release'
- task: EsrpCodeSigning@1
inputs:
ConnectedServiceName: '$(signServiceConnection)'
FolderPath: 'artifacts'
Pattern: |
Release/**/Microsoft*Azure*PowerShell*Cmdlets*.dll
Release/**/Microsoft.Azure.PowerShell.*.Sdk.dll
Release/**/Az.*.private.dll
Release/**/Microsoft.Azure.PowerShell.Authentication.dll
Release/**/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll
Release/**/Microsoft.Azure.PowerShell.Authenticators.dll
Release/**/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll
Release/**/Microsoft.Azure.Commands.*.AlcWrapper.dll
!Release/**/Microsoft*Azure*PowerShell*Cmdlets*.Test.dll
UseMinimatch: true
signConfigType: 'inlineSignParams'
inlineOperation: |
[
{
"KeyCode": "CP-233863-SN",
"OperationCode": "StrongNameSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-233863-SN",
"OperationCode": "StrongNameVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"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
displayName: 'Sign 3rd Party [Strong Name]'
inputs:
ConnectedServiceName: '$(signServiceConnection)'
FolderPath: artifacts
Pattern: 'Release/**/FuzzySharp.dll'
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode": "CP-233863-SN",
"OperationCode": "StrongNameSign",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-233863-SN",
"OperationCode": "StrongNameVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
SessionTimeout: '60'
MaxConcurrency: '50'
MaxRetryAttempts: '5'
- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: custom
custom: msbuild
arguments: 'build.proj /t:Publish /p:Configuration=Release;NuGetKey=$(NuGetKey)'
- task: PublishPipelineArtifact@0
displayName: 'Save artifacts'
inputs:
artifactName: artifacts
targetPath: artifacts
condition: succeededOrFailed()