forked from Hofknecht/SystemTrayMenu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines-v2.yml
More file actions
187 lines (166 loc) · 6.93 KB
/
azure-pipelines-v2.yml
File metadata and controls
187 lines (166 loc) · 6.93 KB
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
#MIT License
#Copyright (c) 2024-2024 Peter Kirmeier
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#The above copyright notice and this permission notice shall be included in all
#copies or substantial portions of the Software.
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
#SOFTWARE.
# https://aka.ms/yaml
# https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/?view=azure-pipelines&viewFallbackFrom=azure-devops
# https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops
# RuntimeRID values: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog
# Available Software on Agents: https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#software
trigger:
- v2.x_Avalonia
stages:
- stage: Build
jobs:
- job:
strategy:
maxParallel: 4
matrix:
# Most Used
win-x64:
PoolVmImg: 'windows-latest'
RuntimeRID: 'win-x64'
TargetFramework: 'net8.0-windows10.0.22000.0'
SelfContained: 'false'
linux-x64:
PoolVmImg: 'ubuntu-latest'
RuntimeRID: 'linux-x64'
TargetFramework: 'net8.0'
SelfContained: 'false'
osx-x64:
PoolVmImg: 'macOS-latest'
RuntimeRID: 'osx-x64'
TargetFramework: 'net8.0'
SelfContained: 'false'
# Windows
# win-arm:
# PoolVmImg: 'windows-latest'
# RuntimeRID: 'win-arm'
# TargetFramework: 'net8.0-windows10.0.22000.0'
# SelfContained: 'false'
# win-arm64:
# PoolVmImg: 'windows-latest'
# RuntimeRID: 'win-arm64'
# TargetFramework: 'net8.0-windows10.0.22000.0'
# SelfContained: 'false'
# Linux
# linux-musl-x64:
# PoolVmImg: 'ubuntu-latest'
# RuntimeRID: 'linux-musl-x64'
# TargetFramework: 'net8.0'
# SelfContained: 'false'
# linux-arm:
# PoolVmImg: 'ubuntu-latest'
# RuntimeRID: 'linux-arm'
# TargetFramework: 'net8.0'
# SelfContained: 'false'
# linux-arm64:
# PoolVmImg: 'ubuntu-latest'
# RuntimeRID: 'linux-arm64'
# TargetFramework: 'net8.0'
# SelfContained: 'false'
# MacOS
osx-arm64:
PoolVmImg: 'macOS-latest'
RuntimeRID: 'osx-arm64'
TargetFramework: 'net8.0'
SelfContained: 'false'
variables:
buildConfiguration: 'Release'
pool:
vmImage: '$(PoolVmImg)'
steps:
# Available versions: https://github.com/dotnet/core/blob/main/release-notes/releases-index.json
- task: UseDotNet@2
displayName: 'Install .NET 8'
inputs:
version: '8.x'
# Available versions: https://dist.nuget.org/tools.json
- task: NuGetToolInstaller@1
displayName: 'Install NuGet 6'
inputs:
versionSpec: '6.x'
- task: MSBuild@1
condition: startsWith(variables['RuntimeRID'], 'win-')
# This is needed for Windows as we have COM dependencies which dotnet publish is not able to handle:
# error MSB4803: The task "ResolveComReference" is not supported on the .NET Core version of MSBuild.
# Please use the .NET Framework version of MSBuild. See https://aka.ms/msbuild/MSB4803 for further details.
# See: https://learn.microsoft.com/de-de/visualstudio/msbuild/resolvecomreference-task?view=vs-2022#msb4803-error
displayName: 'MSBuild Publish'
inputs:
solution: '$(Build.DefinitionName).csproj'
msbuildArchitecture: 'x64'
platform: 'AnyCPU'
configuration: '$(BuildConfiguration)'
msbuildArguments: '/restore /t:publish /p:RuntimeIdentifier=win-x64;TargetFrameworks=$(TargetFramework);SelfContained=$(SelfContained)'
maximumCpuCount: true
# example: dotnet publish --configuration Release --runtime win-x64 --framework net8.0 --self-contained false SystemTrayMenu.csproj
- task: DotNetCoreCLI@2
condition: not(startsWith(variables['RuntimeRID'], 'win-'))
displayName: 'DotNet Publish'
inputs:
command: 'publish'
arguments: '--configuration $(buildConfiguration) --runtime $(RuntimeRID) --framework $(TargetFramework) --self-contained $(SelfContained)'
publishWebProjects: false
zipAfterPublish: false
projects: '$(Build.DefinitionName).csproj'
- task: Bash@3
displayName: 'Dump file tree'
inputs:
targetType: 'inline'
script: |
echo "Listing '$(Build.SourcesDirectory)' ..."
find -L . -type f
- task: ArchiveFiles@2
condition: startsWith(variables['RuntimeRID'], 'win-')
displayName: 'Archive ZIP'
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)/bin/AnyCPU/$(buildConfiguration)/$(TargetFramework)/$(RuntimeRID)/publish/'
includeRootFolder: false
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.DefinitionName).$(System.JobName)-v2-PreRelease.zip'
archiveType: 'zip'
replaceExistingArchive: true
verbose: true
- task: ArchiveFiles@2
condition: or(startsWith(variables['RuntimeRID'], 'linux-'), startsWith(variables['RuntimeRID'], 'osx-'))
displayName: 'Archive TAR.GZ'
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)/bin/AnyCPU/$(buildConfiguration)/$(TargetFramework)/$(RuntimeRID)/publish/'
includeRootFolder: false
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.DefinitionName).$(System.JobName)-v2-PreRelease.tar.gz'
archiveType: 'tar'
tarCompression: 'gz'
replaceExistingArchive: true
verbose: true
#https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops
#- stage: Deploy
# dependsOn: Build
#
# https://docs.microsoft.com/de-de/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#use-outputs-in-a-different-stage
#
# jobs:
# - job: Store
# displayName: 'Deploy Artifacts'
# pool:
# vmImage: 'windows-latest'
#
# steps:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: PreRelease'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
publishLocation: 'Container'
ArtifactName: 'PreRelease'