-
Notifications
You must be signed in to change notification settings - Fork 0
/
codemagic.yaml
79 lines (77 loc) · 2.64 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
68
69
70
71
72
73
74
75
76
77
78
79
# Automatically generated on 2022-08-25 UTC from https://codemagic.io/app/6306f6b6fd736a5341e7d846/settings
# Note that this configuration is not an exact match to UI settings. Review and adjust as necessary.
workflows:
prod:
name: Production
max_build_duration: 60
environment:
flutter: 3.10.6
# ndk: r21e
# java: 1.8
groups:
- prod
cache:
cache_paths:
- $HOME/.gradle/caches
- $FLUTTER_ROOT/.pub-cache
scripts:
#- |
# set up debug keystore
#rm -f ~/.android/debug.keystore
#keytool -genkeypair \
# -alias androiddebugkey \
# -keypass android \
# -keystore ~/.android/debug.keystore \
# -storepass android \
# -dname 'CN=Android Debug,O=Android,C=US' \
# -keyalg 'RSA' \
# -keysize 2048 \
# -validity 10000
- |
# set up key.properties
echo $CM_KEYSTORE | base64 --decode > $CM_KEYSTORE_PATH
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
- |
# set up local properties
echo "flutter.sdk=$HOME/programs/flutter" > "$CM_BUILD_DIR/android/local.properties"
- flutter packages pub get
# - flutter build appbundle --debug
- flutter build appbundle --release --build-number=$(($PROJECT_BUILD_NUMBER
+ 100))
- |
# generate signed universal apk with user specified keys
android-app-bundle build-universal-apk \
--bundle build/**/outputs/**/*.aab \
--ks /tmp/keystore.keystore \
--ks-pass $CM_KEYSTORE_PASSWORD \
--ks-key-alias $CM_KEY_ALIAS \
--key-pass $CM_KEY_PASSWORD
artifacts:
- build/**/outputs/**/*.apk
- build/**/outputs/**/*.aab
- build/**/outputs/**/mapping.txt
- '*.snap'
- build/windows/**/*.msix
- flutter_drive.log
publishing:
email:
recipients:
scripts:
- |
# Publish to Firebase App Distribution
#!/usr/bin/env sh
set -e # exit on first failed command
set -x # print all executed commands to the log
if [[ -f "$FCI_BUILD_OUTPUT_DIR/app-release-universal.apk" ]]
then
# Android Firebase App Distribution CLI
firebase appdistribution:distribute $FCI_BUILD_OUTPUT_DIR/app-release-universal.apk --app \
1:772563497111:android:490baf9ffc5548186ab9d2 --groups "Testers" \
--token "$FIREBASE_TOKEN"
fi