-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
99 lines (85 loc) · 3.15 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
trigger:
branches:
include:
- release
variables:
- group: KeystoreVariableGroup
pool:
vmImage: 'windows-latest'
steps:
- task: JavaToolInstaller@0
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: DownloadSecureFile@1
displayName: 'Download Keystore File'
inputs:
secureFile: 'upload-keystore.jks'
name: keystore
- task: Gradle@3
displayName: 'Build and Sign AAB'
inputs:
workingDirectory: '$(Build.SourcesDirectory)'
gradleWrapperFile: 'gradlew'
tasks: ':app:bundleRelease'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
- task: CmdLine@2
displayName: 'Signing and aligning AAB file'
inputs:
script: |
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore "$(keystore.secureFilePath)" -storepass "$(KEYSTORE_PASSWORD)" -keypass "$(KEY_PASSWORD)" "$(system.defaultworkingdirectory)/app/build/outputs/bundle/release/app-release.aab" "$(KEY_ALIAS)"
- task: CopyFiles@2
displayName: 'Copying AAB'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)/app/build/outputs/bundle/release/'
Contents: '**'
TargetFolder: '$(build.ArtifactStagingDirectory)/AAB'
- task: CopyFiles@2
displayName: 'Copying mapping.txt for AAB'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)/app/build/outputs/mapping/release/'
Contents: 'mapping.txt'
TargetFolder: '$(build.ArtifactStagingDirectory)/AAB'
- task: PublishBuildArtifacts@1
displayName: 'Publish AAB Artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/AAB'
ArtifactName: 'BundleArtifacts'
publishLocation: 'Container'
- task: Gradle@3
displayName: 'Build and Sign APK'
inputs:
workingDirectory: '$(Build.SourcesDirectory)'
gradleWrapperFile: 'gradlew'
tasks: ':app:assembleRelease'
publishJUnitResults: false
- task: AndroidSigning@3
displayName: 'Signing APK'
inputs:
apkFiles: '$(Build.SourcesDirectory)/app/build/outputs/apk/release/app-release-unsigned.apk'
apksignerKeystoreFile: 'upload-keystore.jks'
apksignerKeystorePassword: '$(KEYSTORE_PASSWORD)'
apksignerKeystoreAlias: '$(KEY_ALIAS)'
apksignerKeyPassword: '$(KEY_PASSWORD)'
apksignerArguments: --out $(Build.SourcesDirectory)/app/build/outputs/apk/release/app-release-signed.apk
zipalign: true
- task: CopyFiles@2
displayName: 'Copying APK'
inputs:
SourceFolder: '$(Build.SourcesDirectory)/app/build/outputs/apk/release/'
Contents: 'app-release-signed.apk'
TargetFolder: '$(build.ArtifactStagingDirectory)/APK'
- task: CopyFiles@2
displayName: 'Copying mapping.txt for APK'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)/app/build/outputs/mapping/release/'
Contents: 'mapping.txt'
TargetFolder: '$(build.ArtifactStagingDirectory)/APK'
- task: PublishBuildArtifacts@1
displayName: 'Publish APK Artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/APK'
ArtifactName: 'APKArtifacts'
publishLocation: 'Container'