-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcodemagic.yaml
59 lines (57 loc) · 1.96 KB
/
codemagic.yaml
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
definitions:
build_env: &build_env
instance_type: mac_mini_m1
environment:
groups:
- keystore_credentials # Comment this out if you are using code-signing-identities <-- Includes - CM_KEYSTORE, CM_KEYSTORE_PASSWORD, CM_KEY_PASSWORD, CM_KEY_ALIAS
- google_play # <-- Includes - GCLOUD_SERVICE_ACCOUNT_CREDENTIALS
- api_keys
- other
# Add the group environment variables in Codemagic UI (either in Application/Team variables) - https://docs.codemagic.io/variables/environment-variable-groups/
node: latest
scripts:
- name: Set up local properties
script: echo "sdk.dir=$ANDROID_SDK_ROOT" > "$CM_BUILD_DIR/local.properties"
- name: Add API key
script: |
touch apikey.properties
echo "OPEN_WEATHER_API_KEY=$OPEN_WEATHER_API_KEY" >> ./apikey.properties
- name: Set up key.properties file for code signing
script: |
echo $CM_KEYSTORE | base64 --decode > $CM_KEYSTORE_PATH
cat >> "$CM_BUILD_DIR/key.properties" <<EOF
storePassword=$CM_KEYSTORE_PASSWORD
keyPassword=$CM_KEY_PASSWORD
keyAlias=$CM_KEY_ALIAS
storeFile=$CM_KEYSTORE_PATH
EOF
- name: Build Android app
script:
./gradlew bundleRelease # To generate an .apk use--> ./gradlew assembleRelease
artifacts:
- app/build/outputs/**/**/*.aab
- app/build/outputs/**/**/*.apk
workflows:
build_internal:
name: Internal build
max_build_duration: 60
<<: *build_env
publishing:
google_play:
credentials: $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS
track: internal
build_beta:
name: Beta build
max_build_duration: 60
<<: *build_env
triggering:
events:
- push
branch_patterns:
- pattern: beta
include: true
source: true
publishing:
google_play:
credentials: $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS
track: beta