-
Notifications
You must be signed in to change notification settings - Fork 5
/
codemagic.yaml
269 lines (259 loc) · 8.04 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
workflows:
default-workflow:
name: iOS and Android Release
max_build_duration: 30
environment:
groups:
- play_store
- apple_store
- personal_data
flutter: stable
xcode: latest
cocoapods: default
triggering:
events:
- tag
branch_patterns:
- pattern: '*'
include: true
source: true
tag_patterns:
- pattern: '*'
include: true
scripts:
- |
# set up key.properties
echo $FCI_KEYSTORE | base64 --decode > $FCI_KEYSTORE_PATH
cat >> "$FCI_BUILD_DIR/android/key.properties" <<EOF
storePassword=$FCI_KEYSTORE_PASSWORD
keyPassword=$FCI_KEY_PASSWORD
keyAlias=$FCI_KEY_ALIAS
storeFile=/tmp/keystore.keystore
EOF
- |
# set up local properties
echo "flutter.sdk=$HOME/programs/flutter" > "$FCI_BUILD_DIR/android/local.properties"
- flutter packages pub get
- flutter build appbundle --release --flavor production --target lib/main_profile.dart
- find . -name "Podfile" -execdir pod install \;
- keychain initialize
- app-store-connect fetch-signing-files "app.flutter.rushpuzzle" --type IOS_APP_STORE --platform=IOS --create
- keychain add-certificates
- xcode-project use-profiles
- flutter build ipa --export-options-plist=/Users/builder/export_options.plist --flavor
production --target lib/main_profile.dart
- name: Publish github
ignore_failure: true
script: |
# Publish only for tag builds
if [ -z ${CM_TAG} ]; then
echo "Not a tag build will not publish GitHub release"
exit 0
fi
gh release upload "${CM_TAG}" \
build/**/outputs/bundle/**/*.aab \
build/ios/ipa/*.ipa
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
- build/windows/**/*.exe
- build/macos/**/*.pkg
- flutter_drive.log
publishing:
email:
recipients:
google_play:
credentials: $GOOGLE_PLAY_CREDENTIALS
track: beta
app_store_connect:
api_key: $APPLE_STORE_CONNECT_API_KEY
key_id: $APP_STORE_CONNECT_KEY_IDENTIFIER
issuer_id: $APP_STORE_CONNECT_ISSUER_ID
submit_to_testflight: true
submit_to_app_store: false
beta_groups:
- Flutter community
macos-workflow:
name: MacOS Release
max_build_duration: 30
environment:
groups:
- play_store
- apple_store
- personal_data
flutter: stable
xcode: latest
cocoapods: default
triggering:
events:
- tag
branch_patterns:
- pattern: '*'
include: true
source: true
tag_patterns:
- pattern: '*'
include: true
scripts:
- flutter packages pub get
- flutter config --enable-web
- flutter config --enable-linux-desktop
- flutter config --enable-macos-desktop
- find . -name "Podfile" -execdir pod install \;
- keychain initialize
- app-store-connect fetch-signing-files "app.flutter.rushpuzzle" --type MAC_APP_STORE --platform MAC_OS --create --certificate-key "$MAC_CERTIFICATE_PRIVATE_KEY"
- app-store-connect list-certificates --type MAC_INSTALLER_DISTRIBUTION --certificate-key "$MAC_CERTIFICATE_PRIVATE_KEY" --save
- keychain add-certificates
- xcode-project use-profiles
- |
find . -name "Podfile" -execdir pod install \;
- |
# build macos
flutter build macos --release --target lib/main_profile.dart
- |
# create macos package
set -x
# Command to find the path to your generated app
APP_NAME=$(find $(pwd) -name "*.app")
cd $(dirname "$APP_NAME")
PACKAGE_NAME=$(basename "$APP_NAME" .app).pkg
# Create an unsigned package
xcrun productbuild --component "$APP_NAME" /Applications/ unsigned.pkg
# Find the installer certificate commmon name in keychain
INSTALLER_CERT_NAME=$(keychain list-certificates \
| jq '.[]
| select(.common_name
| contains("Mac Developer Installer"))
| .common_name' \
| xargs)
# Sign the package
xcrun productsign --sign "$INSTALLER_CERT_NAME" unsigned.pkg "$PACKAGE_NAME"
- name: Publish github
ignore_failure: true
script: |
# Publish only for tag builds
if [ -z ${CM_TAG} ]; then
echo "Not a tag build will not publish GitHub release"
exit 0
fi
pwd
gh release upload "${CM_TAG}" build/macos/**/**/**/*.pkg build/macos/**/**/**/*.app.zip
artifacts:
- build/**/outputs/apk/**/*.apk
- build/**/outputs/bundle/**/*.aab
- build/**/outputs/**/mapping.txt
- build/ios/ipa/*.ipa
- /tmp/xcodebuild_logs/*.log
- build/web.zip
- '*.snap'
- build/windows/**/*.msix
- build/windows/**/*.exe
- build/macos/**/*.pkg
- build/macos/**/*.app
- flutter_drive.log
publishing:
email:
recipients:
app_store_connect:
api_key: $APPLE_STORE_CONNECT_API_KEY
key_id: $APP_STORE_CONNECT_KEY_IDENTIFIER
issuer_id: $APP_STORE_CONNECT_ISSUER_ID
submit_to_testflight: true
submit_to_app_store: false
beta_groups:
- Flutter community
windows-workflow:
name: Windows release
instance_type: windows_x2
max_build_duration: 30
environment:
groups:
- windows-signing
- personal_data
flutter: stable
triggering:
events:
- tag
branch_patterns:
- pattern: '*'
include: true
source: true
tag_patterns:
- pattern: '*'
include: true
scripts:
- name: Install gh
ignore_failure: true
script: |
choco install gh -y
- refreshenv
- flutter packages pub get
- flutter config --enable-windows-desktop
- flutter build windows
- flutter pub run msix:create --store --publisher=CN=3A6E7B55-DB95-449E-9605-3397E2C34CAC --identity-name=53278JaimeBlascoAndrs.RushApp
- name: Publish github
ignore_failure: true
script: |
gh release upload $env:CM_TAG build\windows\runner\Release\rush_hour_puzzle.msix build\windows\runner\Release\rush_hour_puzzle.exe
artifacts:
- build/windows/**/*.msix
publishing:
partner_center:
store_id: 9MT8HV3GSGL3
tenant_id: 58f73d80-51d5-4a8a-bd01-a1ea8b4be15f
client_id: e590ae5e-fbac-45b2-854f-90f10f3efdb1
client_secret: $MP_CLIENT_SECRET
email:
recipients:
web-workflow:
name: Deploy web
max_build_duration: 30
environment:
groups:
- play_store
- apple_store
- personal_data
flutter: stable
xcode: latest
cocoapods: default
triggering:
events:
- tag
branch_patterns:
- pattern: '*'
include: true
source: true
tag_patterns:
- pattern: '*'
include: true
scripts:
- flutter packages pub get
- flutter config --enable-web
- |
# build web
flutter build web --release --web-renderer html --target lib/main_profile.dart
cd build/web
7z a -r ../web.zip ./*
cd ../../
- |
# Publish only for tag builds
if [ -z ${CM_TAG} ]; then
echo "Not a tag build will not publish GitHub release"
exit 0
fi
gh release upload "${CM_TAG}" \
build/web.zip
artifacts:
- build/web.zip
publishing:
email:
recipients: