-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodemagic.yaml
208 lines (202 loc) · 5.79 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
workflows:
android-app-store:
name: Android App Store
max_build_duration: 60
environment:
flutter: stable
groups:
- common
cache:
cache_paths:
- $FLUTTER_ROOT/.pub-cache
- $HOME/.gradle/caches
- $HOME/Library/Caches/CocoaPods
- $FCI_BUILD_DIR/node_modules
scripts:
- name: Set up local.properties
script: |
echo "
sdk.dir=$ANDROID_SDK_ROOT
flutter.sdk=$FLUTTER_ROOT
" > android/local.properties
- name: Set up keystore
script: |
echo $ANDROID_KEYSTORE | base64 --decode > /tmp/keystore
echo $ANDROID_KEY_PROPERTIES | base64 --decode > android/key.properties
- name: Build for Android
script: |
flutter build appbundle --release
artifacts:
- build/**/*.aab
publishing:
google_play:
credentials: $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS
track: production
ios-app-store:
name: iOS App Store
max_build_duration: 60
environment:
flutter: stable
xcode: 13.4.1
cocoapods: 1.11.3
groups:
- common
cache:
cache_paths:
- $FLUTTER_ROOT/.pub-cache
- $HOME/Library/Caches/CocoaPods
- $HOME/.gradle/caches
- $FCI_BUILD_DIR/node_modules
scripts:
- name: Set up Certificates & Provisioning Profiles
script: |
keychain initialize
KEYCHAIN_PATH=$(keychain get-default)
cd ios
fastlane ios get_certificates_profiles keychain_name:$KEYCHAIN_PATH username:$APPLE_ID
- name: Build for iOS
script: |
flutter build ipa --release --no-codesign
cd ios
fastlane ios build
artifacts:
- build/**/*.ipa
publishing:
app_store_connect:
apple_id: $APPLE_ID
password: $APPLE_APPLICATION_SPECIFIC_PASSWORD
macos-app-store:
name: macOS App Store
max_build_duration: 60
environment:
flutter: stable
xcode: 13.4.1
cocoapods: 1.11.3
groups:
- common
cache:
cache_paths:
- $FLUTTER_ROOT/.pub-cache
- $HOME/Library/Caches/CocoaPods
- $HOME/.gradle/caches
- $FCI_BUILD_DIR/node_modules
scripts:
- name: Set up Certificates & Provisioning Profiles
script: |
keychain initialize
KEYCHAIN_PATH=$(keychain get-default)
cd macos
fastlane mac get_certificates_profiles keychain_name:$KEYCHAIN_PATH username:$APPLE_ID
- name: Build for macOS
script: |
flutter build macos --release
cd macos
fastlane mac build_app_store
artifacts:
# - macos/build/Ejimo.app.zip
# - macos/build/Ejimo.app.dSYM.zip
- macos/build/Ejimo.pkg
publishing:
app_store_connect:
apple_id: $APPLE_ID
password: $APPLE_APPLICATION_SPECIFIC_PASSWORD
macos-standalone:
name: macOS Standalone
max_build_duration: 60
environment:
flutter: stable
xcode: 13.4.1
cocoapods: 1.11.3
groups:
- common
cache:
cache_paths:
- $FLUTTER_ROOT/.pub-cache
- $HOME/Library/Caches/CocoaPods
- $HOME/.gradle/caches
- $FCI_BUILD_DIR/node_modules
scripts:
- name: Set up Certificates & Provisioning Profiles
script: |
keychain initialize
KEYCHAIN_PATH=$(keychain get-default)
cd macos
fastlane mac get_certificates_profiles keychain_name:$KEYCHAIN_PATH username:$APPLE_ID
- name: Build for macOS
script: |
flutter build macos --release
cd macos
fastlane mac build_standalone
- name: Notarize
script: |
cd macos
fastlane mac publish_standalone username:$APPLE_ID password:$APPLE_APPLICATION_SPECIFIC_PASSWORD
artifacts:
- macos/build/Ejimo.app.zip
- macos/build/Ejimo.app.dSYM.zip
# publishing:
# TODO upload to Firebase
web:
name: Web
max_build_duration: 60
environment:
flutter: stable
xcode: 13.4.1
cocoapods: 1.11.3
groups:
- common
cache:
cache_paths:
- $FLUTTER_ROOT/.pub-cache
- $HOME/Library/Caches/CocoaPods
- $HOME/.gradle/caches
- $FCI_BUILD_DIR/node_modules
scripts:
- name: Set up environment
script: |
npm install -g @sentry/cli
- name: Build for Web
script: |
flutter build web --release --source-maps
- name: Upload source maps to Sentry
script: |
APP_VERSION=$(sed -n 's/^version: //p' pubspec.yaml)
SENTRY_RELEASE="me.albemala.ejimo@$APP_VERSION"
# SENTRY_ORG is defined in .env
SENTRY_PROJECT=ejimo
# login
sentry-cli login --auth-token $SENTRY_TOKEN
# create sentry release
sentry-cli releases \
-o $SENTRY_ORG \
-p $SENTRY_PROJECT \
new $SENTRY_RELEASE
# upload source maps
sentry-cli releases \
-o $SENTRY_ORG \
-p $SENTRY_PROJECT \
files $SENTRY_RELEASE \
upload-sourcemaps build/web --ext map --ext js
# finalize release
sentry-cli releases \
-o $SENTRY_ORG \
-p $SENTRY_PROJECT \
finalize $SENTRY_RELEASE
- name: Upload to Firebase Hosting
script: |
firebase deploy --only hosting
# artifacts:
# - macos/build/Ejimo.app.zip
# - macos/build/Ejimo.app.dSYM.zip
# publishing:
# - |
# # build web
# flutter build web --release
# cd build/web
# 7z a -r ../web.zip ./*
# Web
# - build/web.zip
# Windows
# - build/windows/**/*.msix
# Linux
# - '*.snap'