-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcodemagic.yaml
67 lines (67 loc) · 2.69 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
60
61
62
63
64
65
66
67
workflows:
android-workflow:
name: Android Workflow
max_build_duration: 120
environment:
groups:
- keystore_credentials # <-- (Includes CM_KEYSTORE, CM_KEYSTORE_PASSWORD, CM_KEY_PASSWORD, CM_KEY_ALIAS)
# Add the above group environment variables in Codemagic UI (either in Application/Team variables) - https://docs.codemagic.io/variables/environment-variable-groups/
vars:
CM_KEYSTORE_PATH: /tmp/keystore.keystore
PACKAGE_NAME: 'io.codemagic.marijanapp' # <-- Put your package name here e.g. "io.codemagic.flutteryaml"
GOOGLE_PLAY_TRACK: 'alpha' # <-- Any default or custom track that is not in ‘draft’ status
flutter: stable
xcode: latest
cocoapods: default
scripts:
- name: Set up key properties
script: |
echo $CM_KEYSTORE | base64 --decode > /tmp/keystore.keystore
cat >> "$CM_BUILD_DIR/android/key.properties" <<EOF
storePassword=$CM_KEYSTORE_PASSWORD
keyPassword=$CM_KEY_PASSWORD
keyAlias=$CM_KEY_ALIAS
storeFile=/tmp/keystore.keystore
EOF
- name: Set up local.properties
script: |
echo "flutter.sdk=$HOME/programs/flutter" > "$CM_BUILD_DIR/android/local.properties"
- name: Get Flutter packages
script: |
cd . && flutter packages pub get
- name: Flutter analyze
script: |
cd . && flutter analyze
- name: Flutter unit tests
script: |
cd . && flutter test
ignore_failure: true
- name: Set up Firebase properties
script: |
echo $ANDROID_FIREBASE_CONFIG | base64 --decode > $CM_BUILD_DIR/android/app/google-services.json
echo Decoded google-services.json! Here is the directory after.
ls $CM_BUILD_DIR/android/app
- name: Build APK with Flutter
script: |
cd . && flutter build apk --release --build-name=1.0.5 --build-number=1
artifacts:
- build/**/outputs/bundle/**/*.aab
- build/**/outputs/apk/**/*.apk
- build/**/outputs/**/mapping.txt
- flutter_drive.log
publishing:
firebase:
firebase_token: $FIREBASE_TOKEN
android:
app_id: 1:347043928061:android:1cdbf0c292fe8bc0d1eb94
groups:
- androidTesters
artifact_type: 'apk'
# See the following link for details about email publishing - https://docs.codemagic.io/yaml-publishing/email
# email:
# recipients:
# notify:
# success: true # To receive a notification when a build succeeds
# failure: false # To not receive a notification when a build fails