forked from isaacrlevin/presencelight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-worker.yml
204 lines (175 loc) · 6.92 KB
/
azure-pipelines-worker.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
196
197
198
199
200
201
202
203
204
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
branches:
include:
- main
paths:
exclude:
- azure-pipelines-wpf.yml
- .github/workflows/main.yml
- src/PresenceLight/*
- README.md
- worker-README.md
stages:
- stage: Build
jobs:
- job: Build
pool:
vmImage: windows-latest
strategy:
matrix:
Channel_Windows_x64_x86:
ChannelName: Windows_x64_x86
RID: win-x64
Channel_Windows_ARM:
ChannelName: Windows_ARM
RID: win-arm
Channel_macOS:
ChannelName: macOS
RID: osx-x64
Channel_Linux_ARM:
ChannelName: Linux_ARM
RID: linux-arm
Channel_Linux_ARM64:
ChannelName: Linux_ARM64
RID: linux-x64
Channel_Linux_Musl_x64:
ChannelName: Linux_Musl_x64
RID: linux-x64
Channel_Linux_Musl_ARM_x64:
ChannelName: Linux_Musl_ARM_x64
RID: linux-musl-x64
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 5.0.x'
inputs:
version: 5.0.x
includePreviewVersions: true
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install -g nbgv
displayName: Install NBGV tool
- script: nbgv cloud -c -a
displayName: Set Build Version
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
workingDirectory: src/PresenceLight.Worker
arguments: -r $(RID) -c Release /p:PublishSingleFile=true -o $(Build.ArtifactStagingDirectory)/$(GitBuildVersionSimple)_$(ChannelName)
publishWebProjects: false
- publish: $(Build.ArtifactStagingDirectory)\$(GitBuildVersionSimple)_$(ChannelName)
displayName: Publish Arifacts
artifact: $(ChannelName)
- publish: Build
displayName: Publish signing scripts
artifact: SigningScripts
condition: and(succeeded(), eq(variables['ChannelName'], 'Windows_x64_x86'))
- 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 - CI
variables:
- group: Sign Client Credentials
strategy:
runOnce:
deploy:
steps:
- task: DownloadPipelineArtifact@2
displayName: Download Windows_x64_x86 Artifacts
inputs:
artifactName: Windows_x64_x86
targetPath: $(Pipeline.Workspace)/ToSign/Windows_x64_x86
- task: DownloadPipelineArtifact@2
displayName: Download Windows_ARM Artifacts
inputs:
artifactName: Windows_ARM
targetPath: $(Pipeline.Workspace)/ToSign/Windows_ARM
- task: DownloadPipelineArtifact@2
displayName: Download macOS Artifacts
inputs:
artifactName: macOS
targetPath: $(Pipeline.Workspace)/ToSign/macOS
- task: DownloadPipelineArtifact@2
displayName: Download Linux_ARM Artifacts
inputs:
artifactName: Linux_ARM
targetPath: $(Pipeline.Workspace)/ToSign/Linux_ARM
- task: DownloadPipelineArtifact@2
displayName: Download Linux_ARM64 Artifacts
inputs:
artifactName: Linux_ARM64
targetPath: $(Pipeline.Workspace)/ToSign/Linux_ARM64
- task: DownloadPipelineArtifact@2
displayName: Download Linux_Musl_x64 Artifacts
inputs:
artifactName: Linux_Musl_x64
targetPath: $(Pipeline.Workspace)/ToSign/Linux_Musl_x64
- task: DownloadPipelineArtifact@2
displayName: Download Linux_Musl_ARM_x64 Artifacts
inputs:
artifactName: Linux_Musl_ARM_x64
targetPath: $(Pipeline.Workspace)/ToSign/Linux_Musl_ARM_x64
- download: current
artifact: SigningScripts
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . SignClient
displayName: Install SignTool tool
- task: AzureCLI@2
displayName: Scale Up Sign Service
inputs:
azureSubscription: 'Isaac Levin MSDN (a07802f5-f8df-47d8-9b88-79ba55cfb396)'
scriptType: 'ps'
scriptLocation: 'inlineScript'
inlineScript: 'az appservice plan update --name levin-signserv-asp-2dnwx6q6jwiay --resource-group SignService --sku P1V2'
- pwsh: |
.\SignClient "Sign" `
--baseDirectory "$(Pipeline.Workspace)\ToSign" `
--input "**/*.{exe,zip}" `
--config "$(Pipeline.Workspace)\SigningScripts\appsettings.json" `
--filelist "$(Pipeline.Workspace)\SigningScripts\filelist.txt" `
--user "$(SignClientUser)" `
--secret "$(SignClientSecret)" `
--name "PresenceLight" `
--description "PresenceLight" `
--descriptionUrl "https://github.com/isaacrlevin/PresenceLight"
displayName: Authenticode Sign artifacts
- task: AzureCLI@2
displayName: Scale Down Sign Service
inputs:
azureSubscription: 'Isaac Levin MSDN (a07802f5-f8df-47d8-9b88-79ba55cfb396)'
scriptType: 'ps'
scriptLocation: 'inlineScript'
inlineScript: 'az appservice plan update --name levin-signserv-asp-2dnwx6q6jwiay --resource-group SignService --sku S1'
- publish: $(Pipeline.Workspace)/ToSign/Windows_x64_x86
displayName: Publish Signed Windows_x64_x86 Packages
artifact: Windows_x64_x86_Signed
- publish: $(Pipeline.Workspace)/ToSign/Windows_ARM
displayName: Publish Signed Windows_ARM Packages
artifact: Windows_ARM_Signed
- publish: $(Pipeline.Workspace)/ToSign/macOS
displayName: Publish Signed macOS Packages
artifact: macOS_Signed
- publish: $(Pipeline.Workspace)/ToSign/Linux_ARM
displayName: Publish Signed Linux_ARM Packages
artifact: Linux_ARM_Signed
- publish: $(Pipeline.Workspace)/ToSign/Linux_ARM64
displayName: Publish Signed Linux_ARM64 Packages
artifact: Linux_ARM64_Signed
- publish: $(Pipeline.Workspace)/ToSign/Linux_Musl_x64
displayName: Publish Signed Linux_Musl_x64 Packages
artifact: Linux_Musl_x64_Signed
- publish: $(Pipeline.Workspace)/ToSign/Linux_Musl_ARM_x64
displayName: Publish Signed Linux_Musl_ARM_x64 Packages
artifact: Linux_Musl_ARM_x64_Signed