forked from ferredoxin/QNotified
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
151 lines (142 loc) · 5.1 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
# Android
# Build your Android project with Gradle.
# Add steps that test, sign, and distribute the APK, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/android
trigger:
branches:
include:
- master
pr: none
pool:
vmImage: 'ubuntu-latest'
variables:
GRADLE_USER_HOME: $(Pipeline.Workspace)/.gradle
jobs:
- job: Build
steps:
- checkout: self
submodules: true
- task: Cache@2
inputs:
key: 'gradle | "$(Agent.OS)" | **/build.gradle.kts | **/build.gradle' # Swap build.gradle.kts for build.gradle when using Groovy
restoreKeys: |
gradle | "$(Agent.OS)"
gradle
path: $(GRADLE_USER_HOME)
displayName: Configure gradle caching
- task: Gradle@2
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
tasks: ':app:assembleRelease'
options: '--build-cache'
- script: |
# stop the Gradle daemon to ensure no files are left open (impacting the save cache operation later)
./gradlew --stop
displayName: Build
- task: AndroidSigning@3
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
apkFiles: '**/*.apk'
apksignerKeystoreFile: 'en-YCH.jks'
apksignerKeystorePassword: '$(keyStorePassword)'
apksignerKeystoreAlias: '$(keyAlias)'
apksignerKeyPassword: '$(keyPassword)'
- task: CopyFiles@2
inputs:
Contents: '**/*.apk'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
CleanTargetFolder: true
flattenFolders: true
- publish: $(Build.ArtifactStagingDirectory)
artifact: APK
- job: Pull
steps:
- checkout: self
- script: |
git config --global user.name "QNotified Auto Deploy Bot"
git config --global user.email "[email protected]"
git remote rm origin
git remote add origin https://$(GITHUB_TOKEN)@github.com/Xposed-Modules-Repo/nil.nadph.qnotified.git
git push -f origin HEAD:master
- job: Distribute
dependsOn: Build
condition: and(succeeded('Build'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
steps:
- checkout: none
- download: current
artifact: APK
- task: AppCenterDistribute@3
displayName: AppCenter Canary
inputs:
serverEndpoint: 'QNotified'
appSlug: 'QNotifiedDev/QNotified'
appFile: '$(Pipeline.Workspace)/APK/*.apk'
symbolsOption: 'Android'
releaseNotesOption: 'input'
releaseNotesInput: '$(Build.SourceVersionMessage)'
destinationType: 'groups'
distributionGroupId: 'c7a5954e-6861-438f-ad02-fb765d4d889f'
- task: AppCenterDistribute@3
displayName: AppCenter Weekly
condition: contains(variables['Build.SourceVersionMessage'], 'release')
inputs:
serverEndpoint: 'QNotified'
appSlug: 'QNotifiedDev/QNotified'
appFile: '$(Pipeline.Workspace)/APK/*.apk'
symbolsOption: 'Android'
releaseNotesOption: 'input'
releaseNotesInput: '$(Build.SourceVersionMessage)'
destinationType: 'groups'
distributionGroupId: '8a11cc3e-47da-4e3b-84e7-ac306a128aaf'
- task: GitHubRelease@1
displayName: LSPosed Release CI
condition: and(succeeded(),not(contains(variables['Build.SourceVersionMessage'], 'release')))
inputs:
gitHubConnection: 'github.com_singleNeuron'
repositoryName: 'Xposed-Modules-Repo/nil.nadph.qnotified'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: $(Build.BuildNumber)
title: '$(Build.SourceVersion)'
releaseNotesSource: 'inline'
releaseNotesInline: '$(Build.SourceVersionMessage)'
assets: '$(Pipeline.Workspace)/APK/*.apk'
isPreRelease: true
changeLogCompareToRelease: 'lastNonDraftRelease'
changeLogType: 'commitBased'
- task: GitHubRelease@1
displayName: LSPosed Release Weekly
condition: and(succeeded(),contains(variables['Build.SourceVersionMessage'], 'release'))
inputs:
gitHubConnection: 'github.com_singleNeuron'
repositoryName: 'Xposed-Modules-Repo/nil.nadph.qnotified'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: $(Build.BuildNumber)
title: '$(Build.SourceVersionMessage)'
releaseNotesSource: 'inline'
releaseNotesInline: '$(Build.SourceVersionMessage)'
assets: '$(Pipeline.Workspace)/APK/*.apk'
changeLogCompareToRelease: 'lastNonDraftRelease'
changeLogType: 'commitBased'
- task: GitHubRelease@1
displayName: Github Release Weekly
condition: contains(variables['Build.SourceVersionMessage'], 'release')
inputs:
gitHubConnection: 'github.com_singleNeuron'
repositoryName: 'ferredoxin/QNotified'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: $(Build.BuildNumber)
title: '$(Build.SourceVersionMessage)'
releaseNotesSource: 'inline'
releaseNotesInline: '$(Build.SourceVersionMessage)'
assets: '$(Pipeline.Workspace)/APK/*.apk'
addChangeLog: false