forked from dotnet/maui-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
125 lines (109 loc) · 4.43 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
# https://aka.ms/yaml
trigger:
- main
- develop
pr:
- main
- develop
variables:
DotNetVersion: 6.0.100-preview.1.21103.13
DotNet.Cli.Telemetry.OptOut: true
Android.Msi: https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/net6/4451481/master/05bb8e0eae11ae6a73838b13cf91ee2433169dff/Microsoft.NET.Workload.Android.11.0.200.85.msi
Android.Pkg: https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/net6/4451481/master/05bb8e0eae11ae6a73838b13cf91ee2433169dff/Microsoft.NET.Workload.Android-11.0.200-ci.master.85.pkg
iOS.Msi: https://bosstoragemirror.azureedge.net/wrench/main/f01fde5cd9a7ffffcdc8d241200c35988700fa00/4449408/package/Microsoft.NET.Workload.iOS.14.3.100-ci.main.1079.msi
iOS.Pkg: https://bosstoragemirror.azureedge.net/wrench/main/f01fde5cd9a7ffffcdc8d241200c35988700fa00/4449408/package/notarized/Microsoft.iOS.Bundle.14.3.100-ci.main.1079.pkg
jobs:
- job: windows
pool:
vmImage: windows-latest
variables:
LogDirectory: $(Build.ArtifactStagingDirectory)\logs
steps:
- powershell: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
& .\dotnet-install.ps1 -Version $(DotNetVersion) -InstallDir "$env:ProgramFiles\dotnet\" -Verbose
& dotnet --list-sdks
displayName: install .NET $(DotNetVersion)
errorActionPreference: stop
- powershell: |
& dotnet tool install --global boots
& boots $(Android.Msi)
& boots $(iOS.Msi)
displayName: install .NET workloads
errorActionPreference: stop
- powershell: |
& dotnet build net6-samples.sln -c Debug -bl:$(LogDirectory)\Debug.binlog
& dotnet build net6-samples.sln -c Release -bl:$(LogDirectory)\Release.binlog
displayName: build samples
errorActionPreference: stop
- task: CopyFiles@2
displayName: copy artifacts
inputs:
contents: '*Android\**\*-Signed.apk'
targetFolder: $(Build.ArtifactStagingDirectory)
overWrite: true
condition: always()
- task: PublishPipelineArtifact@1
displayName: publish artifacts
inputs:
artifactName: windows-artifacts
targetPath: $(Build.ArtifactStagingDirectory)
condition: always()
- job: mac
timeoutInMinutes: 120
pool:
vmImage: macOS-latest
variables:
- name: LogDirectory
value: $(Build.ArtifactStagingDirectory)/logs
- name: DotNet.Root
value: /usr/local/share/dotnet/
- name: DotNet.Tools
value: ~/.dotnet/tools
steps:
- task: UseDotNet@2
displayName: install .NET Core 3.1
inputs:
version: 3.1.x
installationPath: $(DotNet.Root)
- bash: >
export PATH="$(DotNet.Root):$(DotNet.Tools):$PATH" &&
curl -L https://raw.githubusercontent.com/dotnet/install-scripts/7a9d5dcab92cf131fc2d8977052f8c2c2d540e22/src/dotnet-install.sh > dotnet-install.sh &&
sh dotnet-install.sh --version $(DotNetVersion) --install-dir $DOTNET_ROOT --verbose &&
dotnet --list-sdks &&
echo "##vso[task.setvariable variable=PATH]$PATH"
displayName: install .NET $(DotNetVersion)
- bash: |
dotnet tool install --global boots
boots $(Android.Pkg)
boots $(iOS.Pkg)
displayName: install .NET workloads
- bash: sudo xcode-select -s /Applications/Xcode_12.3.app
displayName: select Xcode 12.3
- bash: |
set -x
mkdir -p ~/Library/Preferences/Xamarin
rm -f ~/Library/Preferences/Xamarin/Settings.plist
/usr/libexec/PlistBuddy -c "add :AppleSdkRoot string $(dirname $(dirname $(xcode-select -p)))" ~/Library/Preferences/Xamarin/Settings.plist || true
cat ~/Library/Preferences/Xamarin/Settings.plist || true
displayName: configure vsmac xcode
- bash: |
dotnet build net6-samples.sln -c Debug -bl:$(LogDirectory)/Debug.binlog &&
dotnet build net6-samples.sln -c Release -bl:$(LogDirectory)/Release.binlog
displayName: build samples
- task: CopyFiles@2
displayName: copy artifacts
inputs:
contents: |
*Android/**/*-Signed.apk
*iOS/**/*.app/**
targetFolder: $(Build.ArtifactStagingDirectory)
overWrite: true
condition: always()
- task: PublishPipelineArtifact@1
displayName: publish artifacts
inputs:
artifactName: mac-artifacts
targetPath: $(Build.ArtifactStagingDirectory)
condition: always()