-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines-android.yml
121 lines (108 loc) · 4.43 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
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
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: macOS-11
variables:
scheme: "Artsorakel"
sdk: "iphoneos"
configuration: "Release"
system.debug: true
steps:
- task: JavaToolInstaller@0
inputs:
versionSpec: "11"
jdkArchitectureOption: "x64"
jdkSourceOption: "PreInstalled"
# - task: InstallAppleCertificate@2
# inputs:
# certSecureFile: 'artsorakel.p12'
# certPwd: $(appCertificatePassword)
# keychain: 'temp'
# deleteCert: true
# - task: InstallAppleProvisioningProfile@1
# inputs:
# provProfileSecureFile: 'ArtsorakelNewProvisionProfile.mobileprovision'
# removeProfile: true
# - task: DownloadSecureFile@1
# inputs:
# secureFile: 'fonts.zip'
# - task: DownloadSecureFile@1
# inputs:
# secureFile: 'build.json'
# displayName: 'npm install and copy keystore'
- task: DownloadSecureFile@1
inputs:
secureFile: "orakel_keystore.jks"
# - task: ExtractFiles@1
# inputs:
# archiveFilePatterns: '/Users/runner/work/_temp/fonts.zip'
# destinationFolder: 'src'
# cleanDestinationFolder: false
# overwriteExistingFiles: true
- task: NodeTool@0
inputs:
versionSpec: "18.14"
displayName: "Install Node.js"
# Cache v2
# Cache files between runs.
# - task: Cache@2
# inputs:
# key: nodemodules # string. Required. Key.
# path: node_modules # string. Required. Path.
# displayName: "Cache node modules"
- script: |
npm install
cd android
cp /Users/runner/work/_temp/build.json .
cp /Users/runner/work/_temp/orakel_keystore.jks ./app/
echo $(KEYSTOREALIAS)
# npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
# cp /Users/runner/Library/Android/sdk/build-tools/32.0.0/d8 /Users/runner/Library/Android/sdk/build-tools/32.0.0/dx
# cp /Users/runner/Library/Android/sdk/build-tools/32.0.0/lib/d8.jar /Users/runner/Library/Android/sdk/build-tools/32.0.0/lib/dx.jar
# cp /Users/runner/Library/Android/sdk/build-tools/33.0.1/d8 /Users/runner/Library/Android/sdk/build-tools/33.0.1/dx
# cp /Users/runner/Library/Android/sdk/build-tools/33.0.1/lib/d8.jar /Users/runner/Library/Android/sdk/build-tools/33.0.1/lib/dx.jar
# ./gradlew bundleRelease
# # cp /Users/runner/Library/Android/sdk/build-tools/32.0.0/d8 /Users/runner/Library/Android/sdk/build-tools/32.0.0/dx
# # cp /Users/runner/Library/Android/sdk/build-tools/32.0.0/lib/d8.jar /Users/runner/Library/Android/sdk/build-tools/32.0.0/lib/dx.jar
# # cp /Users/runner/Library/Android/sdk/build-tools/33.0.1/d8 /Users/runner/Library/Android/sdk/build-tools/33.0.1/dx
# # cp /Users/runner/Library/Android/sdk/build-tools/33.0.1/lib/d8.jar /Users/runner/Library/Android/sdk/build-tools/33.0.1/lib/dx.jar
displayName: "npm install and copy keystore"
- task: Gradle@2
inputs:
workingDirectory: "android/app"
gradleWrapperFile: "android/gradlew"
gradleOptions: "-Xmx3072m"
publishJUnitResults: false
testResultsFiles: "**/TEST-*.xml"
tasks: "bundleRelease"
displayName: Build .aab file
env:
JARSIGNERKEYSTOREPASSWORD: $(jarsignerKeystorePassword)
KEYSTOREALIAS: $(keystoreAlias)
JARSIGNERKEYPASSWORD: $(jarsignerKeyPassword)
# - task: AndroidSigning@2
# inputs:
# apkFiles: 'android/app/build/outputs/**/*.aab'
# jarsign: true
# jarsignerKeystoreFile: 'orakel_keystore.jks'
# jarsignerKeystorePassword: '$(jarsignerKeystorePassword)'
# jarsignerKeystoreAlias: '$(keystoreAlias)'
# jarsignerKeyPassword: '$(jarsignerKeyPassword)'
# jarsignerArguments: '-sigalg SHA256withRSA -digestalg SHA-256'
# zipalign: true
# displayName: Sign .aab files
- task: CopyFiles@2
inputs:
contents: "android/app/build/outputs/**/*.aab"
targetFolder: "$(build.artifactStagingDirectory)"
displayName: Copy .aab files to artifact staging directory
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: "$(build.artifactStagingDirectory)"
artifactName: "drop"
artifactType: "container"
displayName: Publish Android artifacts