forked from dkanada/gelli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure.yml
110 lines (93 loc) · 2.46 KB
/
azure.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
trigger:
batch: true
branches:
include:
- '*'
tags:
include:
- '*'
pr:
branches:
include:
- '*'
jobs:
- job: Build
displayName: 'Build'
strategy:
matrix:
Release:
Gradle: Release
Suffix: release
Debug:
Gradle: Debug
Suffix: debug
pool:
vmImage: 'ubuntu-latest'
steps:
- script: 'echo "##vso[task.setvariable variable=TAG]$(git describe --tags)"'
displayName: 'Set Variable'
- task: Gradle@2
displayName: 'Build APK'
inputs:
gradleWrapperFile: 'gradlew'
tasks: 'assemble$(Gradle)'
javaHomeOption: 'JDKVersion'
- task: CopyFiles@2
displayName: 'Copy APK'
inputs:
SourceFolder: 'app/build/outputs/apk/'
Contents: '**/*.apk'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: Bash@3
displayName: 'Rename APK'
inputs:
targetType: 'inline'
script: 'mv *.apk gelli-${SUFFIX}-${TAG}.apk'
workingDirectory: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish APK'
inputs:
PathToPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'gelli-$(SUFFIX)-$(TAG)'
publishLocation: 'Container'
- job: Publish
displayName: 'Publish'
dependsOn: Build
strategy:
matrix:
Release:
Suffix: release
Debug:
Suffix: debug
pool:
vmImage: 'ubuntu-latest'
steps:
- script: 'echo "##vso[task.setvariable variable=TAG]$(git describe --tags)"'
displayName: 'Set Variable'
- task: DownloadBuildArtifacts@0
displayName: 'Download APK'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'gelli-$(Suffix)-$(TAG)'
downloadPath: '$(System.ArtifactsDirectory)'
- task: AndroidSigning@3
displayName: 'Sign APK'
condition: eq(variables['Suffix'], 'release')
inputs:
apkFiles: '$(System.ArtifactsDirectory)/**/*.apk'
apksignerKeystoreFile: 'KeyStore'
apksignerKeystorePassword: '$(KeyStorePassword)'
apksignerKeystoreAlias: 'gelli'
apksignerKeyPassword: '$(KeyStorePassword)'
- task: GithubRelease@0
displayName: 'Upload APK'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
inputs:
gitHubConnection: github
repositoryName: dkanada/gelli
assets: '$(System.ArtifactsDirectory)/**/*.apk'
action: 'edit'
assetUploadMode: 'replace'
tag: '$(TAG)'