-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines-Android.yml
73 lines (64 loc) · 1.84 KB
/
azure-pipelines-Android.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
# Xamarin.Android
# Build a Xamarin.Android project.
# Add steps that test, sign, and distribute an app, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/xamarin
# Trigger on the main brach, and filtered to only the Mobile and Shared projects
trigger:
branches:
include:
- main
paths:
include:
- src/Mobile
- src/Shared
exclude:
- Screenshots
- src
- Docs
- azure-pipelines.yml
- azure-pipelines-Android.yml
- azure-pipelines-ChatService.yml
- azure-pipelines-iOS.yml
- README.md
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
outputDirectory: '$(build.binariesDirectory)/$(buildConfiguration)'
steps:
# Install NuGet tool
- task: NuGetToolInstaller@1
# Restore NuGet packages
- task: NuGetCommand@2
displayName: 'dotnet restore'
inputs:
restoreSolution: '**/*.sln'
# Build the Android project
- task: XamarinAndroid@1
displayName: "Build Xamarin.Android"
inputs:
projectFile: '**/*Android.csproj'
outputDirectory: '$(outputDirectory)'
configuration: '$(buildConfiguration)'
msbuildVersionOption: latest
jdkVersionOption: default
# Sign the APK
- task: AndroidSigning@3
displayName: "Signing and aligning APK file"
inputs:
apkFiles: '$(outputDirectory)/*.apk'
apksignerKeystoreFile: '$(keystore-filename)'
apksignerKeystorePassword: '$(keystore-password)'
apksignerKeystoreAlias: '$(keystore-alias)'
apksignerKeyPassword: '$(keystore-password)'
# Archive the APK and associated files
- task: ArchiveFiles@2
displayName: 'Archive'
inputs:
rootFolderOrFile: '$(outputDirectory)'
includeRootFolder: false
# Create a drop artefact for the project
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(outputDirectory)'