-
Notifications
You must be signed in to change notification settings - Fork 332
/
config.yml
90 lines (88 loc) · 3.16 KB
/
config.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
version: 2
jobs:
build:
docker:
- image: circleci/android:api-27-alpha
environment:
JAVA_OPTS: -Xmx1536m
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xmx1536m -XX:+HeapDumpOnOutOfMemoryError"'
steps:
- checkout
- run: echo "source $(git rev-parse --show-toplevel)/.circleci/bash.source" >> $BASH_ENV
- restore_cache:
key: jars-{{ checksum "build.gradle.kts" }}-{{ checksum "app/build.gradle.kts" }}
- restore_cache:
key: bundle-{{ checksum "Gemfile.lock" }}
- run:
name: Bundle install
command: bundle install --path vendor/bundle
- save_cache:
paths:
- vendor/bundle
key: bundle-{{ checksum "Gemfile.lock" }}
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- save_cache:
key: jars-{{ checksum "build.gradle.kts" }}-{{ checksum "app/build.gradle.kts" }}
paths:
- ~/.gradle
- run:
name: decrypt keystore
command: |
if should_be_release; then
openssl aes-256-cbc -k $KEYSTORE_DECRYPT_PASSWORD -d -in encrypted-droidkaigi-key -out release.keystore -md sha256
fi
- run:
name: decrypt json
command: |
if should_be_release; then
openssl aes-256-cbc -k $JSON_DECRYPT_PASSWORD -d -in encrypted-google-services.json -out app/google-services.json -md sha256
fi
- run:
name: Test
command: |
if should_be_release; then
./gradlew --stacktrace testRelease
else
./gradlew --stacktrace test${APP_BUILD_TYPE^}
fi
- run:
name: Build
command: |
if should_be_release; then
./gradlew --offline --stacktrace assembleRelease
else
./gradlew --offline --stacktrace assemble${APP_BUILD_TYPE^}
fi
- run:
name: Check
command: |
if ! is_on_master_or_release && ! deploy_to_google_play; then
./gradlew --stacktrace lint${APP_BUILD_TYPE^}
./gradlew --stacktrace ktlint${APP_BUILD_TYPE^}Check
bundle exec danger
fi
- run:
name: Deploy
command: |
if deploy_to_deploygate; then
./gradlew :app:uploadDeployGateRelease
elif deploy_to_google_play; then
echo "Deploy to Google Play"
openssl aes-256-cbc -k $PUBLISHER_KEYS_JSON_DECRYPT_PASSWORD -d -in encrypted-publisher-keys.json -out app/publisher-keys.json -md md5
./gradlew publishApkRelease
fi
- store_artifacts:
path: app/build/reports
destination: reports
- store_artifacts:
path: app/build/outputs/apk
destination: apk
# workaround for tag trigger
# because workflow git tag trigger does not work well
deployment:
fake_for_deploy:
tag: /.*/
commands:
- echo "make tags run in 2.0"