forked from nblockchain/DotNetEssentials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
150 lines (140 loc) · 5.69 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
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
trigger:
- main
- develop
- refs/tags/*
pr:
- main
- develop
variables:
BASE_VERSION: 1.6.0
PREVIEW_LABEL: 'ci'
BUILD_NUMBER: $[counter(format('{0}_{1}_{2}', variables['BASE_VERSION'], variables['PREVIEW_LABEL'], variables['Build.SourceBranch']), 1)]
NUGET_VERSION: $[format('{0}-{1}.{2}', variables['BASE_VERSION'], variables['PREVIEW_LABEL'], variables['BUILD_NUMBER'])]
GIT_SHA: $(Build.SourceVersion)
GIT_BRANCH_NAME: $(Build.SourceBranchName)
resources:
repositories:
- repository: internal-templates
type: github
name: xamarin/yaml-templates
endpoint: xamarin
- repository: components
type: github
name: xamarin/XamarinComponents
endpoint: xamarin
stages:
- stage: build
displayName: Build Library
jobs:
- template: .ci/build.yml@components
parameters:
areaPath: 'DevDiv\Xamarin SDK\Build and Tools'
masterBranchName: 'main'
preBuildSteps:
- pwsh: |
$pr = "pr." + $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
$nuget = $env:BASE_VERSION + "-" + $pr + "." + $env:BUILD_NUMBER
Write-Host "Preview label: $pr"
Write-Host "NuGet version: $nuget"
Write-Host "##vso[task.setvariable variable=PREVIEW_LABEL]$pr"
Write-Host "##vso[task.setvariable variable=NUGET_VERSION]$nuget"
displayName: Use a special preview label for PRs
condition: eq(variables['Build.Reason'], 'PullRequest')
- pwsh: |
$tagVersion = $env:BUILD_SOURCEBRANCHNAME
Write-Host "Tag version: $tagVersion"
Write-Host "##vso[task.setvariable variable=NUGET_VERSION]$tagVersion"
displayName: Override version for tags
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
- pwsh: |
Write-Host "##vso[build.updatebuildnumber]$env:NUGET_VERSION"
displayName: Update the build number with a more readable one
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
- stage: signing
displayName: Sign Artifacts
dependsOn: [ 'build' ]
jobs:
- template: sign-artifacts/jobs/v1.yml@internal-templates
parameters:
additionalConditions: eq(variables['Build.SourceBranch'], 'refs/heads/main')
- stage: devicetests
displayName: Device Tests
dependsOn: []
jobs:
- job: devicetests_uwp
displayName: UWP
# skip for now
condition: and(succeeded(), not(succeeded()))
pool:
vmImage: windows-2019
steps:
- script: 'certutil -importpfx $(Build.SourcesDirectory)\DeviceTests\DeviceTests.UWP\DeviceTests.UWP_TemporaryKey.pfx'
displayName: 'Run certutil'
- powershell: |
cd DeviceTests
.\build.ps1 --target=test-uwp-emu --settings_skipverification=true --verbosity=diagnostic
displayName: 'Run Device Tests - UWP'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: XUnit
testResultsFiles: '**/xunit-*.xml'
testRunTitle: 'Device Tests - UWP'
- template: .ci/build.yml@components
parameters:
name: devicetests_ios
runChecks: false
displayName: iOS
windowsImage: ''
areaPath: 'DevDiv\Xamarin SDK\Build and Tools'
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-ios-emu
- template: .ci/build.yml@components
parameters:
name: devicetests_android_api_23
runChecks: false
displayName: Android API 23
windowsImage: ''
macosImage: 'macos-10.14'
xcode: '11.3.1'
areaPath: 'DevDiv\Xamarin SDK\Build and Tools'
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-23;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-23;google_apis;x86\""
displayName: Install the Android emulators
- template: .ci/build.yml@components
parameters:
name: devicetests_android_api_26
runChecks: false
displayName: Android API 26
windowsImage: ''
macosImage: 'macos-10.14'
xcode: '11.3.1'
areaPath: 'DevDiv\Xamarin SDK\Build and Tools'
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-26;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-26;google_apis;x86\""
displayName: Install the Android emulators
- template: .ci/build.yml@components
parameters:
name: devicetests_android_api_29
runChecks: false
displayName: Android API 29
windowsImage: ''
macosImage: 'macos-10.14'
xcode: '11.3.1'
areaPath: 'DevDiv\Xamarin SDK\Build and Tools'
verbosity: diagnostic
cakeFile: DeviceTests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-29;google_apis_playstore;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-29;google_apis_playstore;x86\""
displayName: Install the Android emulators