forked from staff0rd/react-native-pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-android.yml
67 lines (55 loc) · 1.88 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
# Gradle
# Build your Java project and run tests with Gradle using a Gradle wrapper script.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
trigger:
- master
pool:
vmImage: 'macOS-10.14'
variables:
- group: AndroidKeystore
steps:
- task: NodeTool@0
displayName: 'Install Node'
inputs:
versionSpec: '12.16.1'
- script: npm install
workingDirectory: src
displayName: 'Install node dependencies'
- task: Gradle@2
inputs:
workingDirectory: 'src/android'
gradleWrapperFile: 'src/android/gradlew'
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
tasks: 'assembleRelease'
- task: AndroidSigning@2
inputs:
apkFiles: '**/*.apk'
jarsign: true
jarsignerKeystoreFile: 'android.keystore'
jarsignerKeystorePassword: '$(jarsignerKeystorePassword)'
jarsignerKeystoreAlias: 'react-native-pipeline-key'
jarsignerKeyPassword: '$(jarsignerKeyPassword)'
zipalign: true
- script: mv src/android/app/build/outputs/apk/release/app-release-unsigned.apk ReactNativePipeline$(Build.BuildNumber).apk
displayName: 'Rename apk'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: ReactNativePipeline$(Build.BuildNumber).apk
artifactName: drop
publishLocation: 'container'
- task: AppCenterDistribute@3
displayName: "Create a release on App Center"
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
serverEndpoint: 'app-center'
appSlug: 'stafford.williams/ReactNativePipeline-Android'
appFile: 'ReactNativePipeline$(Build.BuildNumber).apk'
releaseNotesOption: 'input'
releaseNotesInput: |
$(Build.SourceVersionMessage)
latest source: '$(Build.SourceVersion)'
An automated release from Azure DevOps
destinationType: 'groups'