-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcodemagic.yaml
116 lines (116 loc) · 4.26 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
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
workflows:
build-chat-application:
name: Build Chat Application
working_directory: chat-application
max_build_duration: 60
triggering:
events:
- push
branch_patterns:
- pattern: 'main'
include: true
source: true
when:
changeset:
includes:
- 'chat-application/'
excludes:
- '**/*.md'
- 'chat-application/ios/fastlane/'
- 'chat-application/ios/Gemfile'
- 'chat-application/ios/Gemfile.lock'
- 'chat-application/android/fastlane/'
- 'chat-application/android/Gemfile'
- 'chat-application/android/Gemfile.lock'
environment:
groups:
- keystore_credentials
- app_store_credentials
- google_play
- other
- ios_config
- certificate_credentials
- custom_networking
- emails
flutter: default
xcode: latest
cocoapods: default
cache:
cache_paths:
- $HOME/Library/Caches/CocoaPods
- $HOME/.gradle/caches
- $FLUTTER_ROOT/.pub-cache
scripts:
- name: Set up key properties
script: |
echo $CM_KEYSTORE | base64 --decode > $CM_KEYSTORE_PATH
cat >> "$CM_BUILD_DIR/chat-application/android/key.properties" <<EOF
storePassword=$CM_KEYSTORE_PASSWORD
keyPassword=$CM_KEY_PASSWORD
keyAlias=$CM_KEY_ALIAS
storeFile=$CM_KEYSTORE_PATH
EOF
- name: Set up local.properties
script: |
echo "flutter.sdk=$HOME/programs/flutter" > "$CM_BUILD_DIR/chat-application/android/local.properties"
- name: Get Flutter packages
script: |
flutter packages pub get
- name: Build APK with Flutter
script: |
flutter build appbundle --release \
--build-number=$(($(google-play get-latest-build-number --package-name "$PACKAGE_NAME") + 1)) \
--dart-define="WEBSOCKET_ENDPOINT=$PRODUCTION_WEBSOCKET_ENDPOINT" \
--dart-define="HTTP_ENDPOINT=$PRODUCTION_HTTP_ENDPOINT"
- name: Set up keychain to be used for codesigning using Codemagic CLI 'keychain' command
script: |
keychain initialize
- name: Set up Provisioning profiles from environment variables
script: |
PROFILES_HOME="$HOME/Library/MobileDevice/Provisioning Profiles"
mkdir -p "$PROFILES_HOME"
PROFILE_PATH="$(mktemp "$PROFILES_HOME"/$(uuidgen).mobileprovision)"
echo ${CM_PROVISIONING_PROFILE} | base64 --decode > "$PROFILE_PATH"
echo "Saved provisioning profile $PROFILE_PATH"
- name: Set up signing certificate
script: |
echo $CM_CERTIFICATE | base64 --decode > /tmp/certificate.p12
keychain add-certificates --certificate /tmp/certificate.p12 --certificate-password $CM_CERTIFICATE_PASSWORD
- name: Set up code signing settings on Xcode project
script: |
xcode-project use-profiles
- name: Install pods
script: |
find . -name "Podfile" -execdir pod install \;
- name: Flutter build ipa and automatic versioning
script: |
flutter build ipa --release \
--build-number=$(($(app-store-connect get-latest-testflight-build-number "$APP_STORE_ID") + 1)) \
--export-options-plist=/Users/builder/export_options.plist \
--dart-define="WEBSOCKET_ENDPOINT=$PRODUCTION_WEBSOCKET_ENDPOINT" \
--dart-define="HTTP_ENDPOINT=$PRODUCTION_HTTP_ENDPOINT"
artifacts:
- ./build/**/outputs/apk/**/*.apk
- ./build/**/outputs/bundle/**/*.aab
- ./build/**/outputs/**/mapping.txt
- ./build/ios/ipa/*.ipa
- /tmp/xcodebuild_logs/*.log
- ./*.snap
- ./build/windows/**/*.msix
- ./flutter_drive.log
publishing:
email:
recipients:
- $ADRKACZ_EMAIL
- $ALICEETRX_EMAIL
- $MAXIBO_EMAIL
google_play:
credentials: $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS
track: alpha
app_store_connect:
api_key: $APP_STORE_CONNECT_PRIVATE_KEY
key_id: $APP_STORE_CONNECT_KEY_IDENTIFIER
issuer_id: $APP_STORE_CONNECT_ISSUER_ID
submit_to_testflight: true
beta_groups:
- App Store Connect Users