-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-pipeline.prod.android.yml
78 lines (65 loc) · 2.54 KB
/
azure-pipeline.prod.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
74
75
76
77
78
# 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:
- master
pool:
vmImage: 'windows-latest'
variables:
- group: VersionNumbers
- name: buildConfiguration
value: 'Release'
- name: outputDirectory
value: '$(build.binariesDirectory)/$(buildConfiguration)'
name: $(MajorVersion).$(MinorVersion).$(Rev:rr)
steps:
# Download and place Google Services JSON file to solution folder
- task: DownloadSecureFile@1
name: GoogleServicesJson
inputs:
secureFile: 'google-services.json'
- script: |
echo Copying google-services.json to project folder
cp $(GoogleServicesJson.secureFilePath) $(Build.SourcesDirectory)/Rocks.Wasabee.Mobile.Android
echo End of copy task
# Download and place ApiKeys.cs file in Solution root folder, referenced in native project properties
# This file contains GoogleMaps And AppCenter API Keys, plus Google OAuth client informations
- task: DownloadSecureFile@1
name: ApiKeysFile
inputs:
secureFile: 'ApiKeys.cs'
- script: |
echo Copying ApiKeys.cs to project folder
cp $(ApiKeysFile.secureFilePath) $(Build.SourcesDirectory)
echo End of copy task
# Download signing Keystore file
- task: DownloadSecureFile@1
name: Keystore
inputs:
secureFile: 'WasabeeAndroid.Keystore'
# ManifestUpdater powershell
# changes PackageName, Version name, App label and icon
- task: PowerShell@2
inputs:
filePath: '_Builds/AndroidManifestUpdater.ps1'
arguments: '-filePath "$(Build.SourcesDirectory)/Rocks.Wasabee.Mobile.Android/Properties/AndroidManifest.xml" -package "$(PackageName)" -versionName "$(Build.BuildNumber)" -label "$(AppLabel)"'
# NuGet Tool install
- task: NuGetToolInstaller@1
# NuGet packages restore
- task: NuGetCommand@2
inputs:
restoreSolution: '**/Rocks.Wasabee.Mobile.sln'
# Build Xamarin.Android app bundle
- task: XamarinAndroid@1
inputs:
projectFile: '**/Rocks.Wasabee.Mobile.Android.csproj'
outputDirectory: '$(outputDirectory)'
configuration: '$(buildConfiguration)'
msbuildArguments: '-p:AndroidPackageFormat=aab -t:SignAndroidPackage -p:AndroidKeyStore=True -p:AndroidSigningKeyStore=$(Keystore.secureFilePath) -p:AndroidSigningStorePass=$(KeystorePassword) -p:AndroidSigningKeyAlias=$(KeystoreAlias) -p:AndroidSigningKeyPass=$(KeystorePassword)'
# Publish artifact
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(outputDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'