forked from dhei/azure-mobile-apps-net-client
-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
155 lines (144 loc) · 6.04 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
151
152
153
154
155
trigger:
- master
- refs/tags/*
pr:
- master
variables:
AREA_PATH: 'DevDiv\Xamarin SDK'
BASE_VERSION: 4.2.0
PREVIEW_LABEL: 'preview'
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'])]
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
dependsOn: []
jobs:
- template: .ci/build.yml@components
parameters:
publishJob: windows
areaPath: $(AREA_PATH)
validPackagePrefixes:
- Microsoft.Azure.Mobile.Client
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: Signing
dependsOn: [ 'build' ]
jobs:
- template: sign-artifacts/jobs/v2.yml@internal-templates
parameters:
codeSignOverride: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
- stage: e2etests
displayName: Device End-to-End Tests
dependsOn: [ ]
jobs:
- template: .ci/build.yml@components
parameters:
name: e2etests_ios
dependsOn: [ ] # temporary until tests support parallel runs
runChecks: false
displayName: iOS
windowsImage: ''
xcode: '12'
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: e2etests/build.cake
cakeTarget: test-ios-emu
cakeExtraArgs: --ios-device="`"iPhone 11`"" --ios-runtime="`"com.apple.CoreSimulator.SimRuntime.iOS-14-0`""
- template: .ci/build.yml@components
parameters:
name: e2etests_android_api_23
dependsOn: [ 'e2etests_ios' ] # temporary until tests support parallel runs
runChecks: false
displayName: Android API 23
windowsImage: ''
macosImage: 'macos-10.14'
xcode: '11.3.1'
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: e2etests/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: e2etests_android_api_26
dependsOn: [ 'e2etests_android_api_23' ] # temporary until tests support parallel runs
runChecks: false
displayName: Android API 26
windowsImage: ''
macosImage: 'macos-10.14'
xcode: '11.3.1'
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: e2etests/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: e2etests_android_api_29
dependsOn: [ 'e2etests_android_api_26' ] # temporary until tests support parallel runs
runChecks: false
displayName: Android API 29
windowsImage: ''
macosImage: 'macos-10.14'
xcode: '11.3.1'
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: e2etests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-29;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-29;google_apis;x86\""
displayName: Install the Android emulators
- template: .ci/build.yml@components
parameters:
name: e2etests_android_api_30
dependsOn: [ 'e2etests_android_api_29' ] # temporary until tests support parallel runs
runChecks: false
displayName: Android API 30
windowsImage: ''
macosImage: 'macos-10.14'
xcode: '11.3.1'
areaPath: $(AREA_PATH)
verbosity: diagnostic
cakeFile: e2etests/build.cake
cakeTarget: test-android-emu
cakeExtraArgs: --avd-target="`"system-images;android-30;google_apis;x86`""
preBuildSteps:
- bash: sh -c "echo \"y\" | $ANDROID_HOME/tools/bin/sdkmanager \"system-images;android-30;google_apis;x86\""
displayName: Install the Android emulators