-
Notifications
You must be signed in to change notification settings - Fork 226
/
azure-pipelines.yml
89 lines (78 loc) · 2.9 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
variables:
solutionUwp: 'samples/MvvmSampleUwp.sln'
solutionXf: 'samples/MvvmSampleXF.sln'
solutionMaui: 'samples/MvvmSampleMAUI.sln'
buildPlatform: 'x86|x64|ARM|ARM64'
buildConfiguration: 'Release'
appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\'
Xcode_Version: '16'
trigger:
branches:
include:
- master
pr:
autoCancel: 'true'
branches:
include:
- master
jobs:
- job: build_samples
displayName: Build Sample Apps
strategy:
matrix:
'Windows':
image: 'windows-latest'
'macOS':
image: 'macos-14'
pool:
vmImage: $(image)
steps:
- task: UseDotNet@2
displayName: 'Install Latest .NET SDK, v8.0.x'
inputs:
packageType: 'sdk'
version: '8.0.x'
includePreviewVersions: false
- task: CmdLine@2
displayName: 'Set Xcode v$(Xcode_Version)'
condition: eq(variables['Agent.OS'], 'Darwin') # Only run this step on macOS
inputs:
script: echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(Xcode_Version).app;sudo xcode-select --switch /Applications/Xcode_$(Xcode_Version).app/Contents/Developer
- task: CmdLine@2
displayName: 'Install Latest .NET MAUI Workload'
inputs:
script: 'dotnet workload install maui'
- task: NuGetToolInstaller@1
displayName: Install NuGet tool
- task: CmdLine@2
displayName: 'Update Git Submodules'
inputs:
script: 'git submodule update --init --recursive'
- task: NuGetCommand@2
condition: eq(variables['Agent.OS'], 'Windows_NT') # Only run this step on Windows
displayName: Restore NuGet Packages (Windows)
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'config'
nugetConfigPath: ./samples/nuget.config
- task: CmdLine@2
displayName: Restore NuGet Packages (macOS)
condition: eq(variables['Agent.OS'], 'Darwin') # Only run this step on macOS
inputs:
script: |
dotnet restore $(solutionUwp) --configfile ./samples/nuget.config
dotnet restore $(solutionXf) --configfile ./samples/nuget.config
dotnet restore $(solutionMaui) --configfile ./samples/nuget.config
- task: VSBuild@1
displayName: Build UWP solution
condition: eq(variables['Agent.OS'], 'Windows_NT') # Only run this step on Windows
inputs:
platform: 'x86'
solution: '$(solutionUwp)'
configuration: '$(buildConfiguration)'
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
- task: CmdLine@2
displayName: 'Build .NET MAUI solution'
inputs:
script: 'dotnet build -c Release $(solutionMaui)'