-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
codemagic.yaml
86 lines (83 loc) · 2.89 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
# Copyright (c) 2022 Sharezone UG (haftungsbeschränkt)
# Licensed under the EUPL-1.2-or-later.
#
# You may obtain a copy of the Licence at:
# https://joinup.ec.europa.eu/software/page/eupl
#
# SPDX-License-Identifier: EUPL-1.2
# We are using Codemagic beside GitHub Actions for our mobile CI/CD.
#
# The "codemagic.yaml" allows us to configure workflows without using the
# UI-Editor. This has the advantage that changes are tracked in Git.
#
# You find the documentation about the codemagic.yaml here:
# https://docs.codemagic.io/yaml/yaml-getting-started/
# With "definitions" we are able to reuse code. Therefore, we can a script once
# and use reuse this script in other workflows without duplicating it. Just
# define a section with &NAME and use it with *NAME.
#
# Docs for definitions:
# https://docs.codemagic.io/yaml/yaml-getting-started/#reusing-sections
#
# Sample by Codemagic:
# https://github.com/codemagic-ci-cd/codemagic-sample-projects/blob/main/yaml/yaml_anchors_aliases_sample/codemagic.yaml
workflows:
app-preview:
name: App Preview
max_build_duration: 75
environment:
xcode: 15.4
# Our Android app uses Java 17.
java: 17
groups:
- github
- ios-publishing
- android_publishing
- certificate_credentials
- codemagic
vars:
BUNDLE_ID: de.codingbrain.sharezone.app.dev
# Sets the Flutter version to the version from fvm_config.json.
flutter: fvm
working_directory: app
scripts:
- name: iOS code signing
script: |
keychain initialize
app-store-connect fetch-signing-files "$BUNDLE_ID" --type IOS_APP_ADHOC --create
keychain add-certificates
xcode-project use-profiles
- name: Set up key properties (Android)
script: |
echo $FCI_KEYSTORE | base64 --decode > android/app/key.jks
cat >> "android/key.properties" <<EOF
storePassword=$FCI_KEYSTORE_PASSWORD
keyPassword=$FCI_KEY_PASSWORD
keyAlias=$FCI_KEY_ALIAS
storeFile=key.jks
EOF
- name: Install dependencies
script: flutter pub get
- name: Build APK
script: |
flutter build apk \
--flavor dev \
--target lib/main_dev.dart
- name: Build IPA
script: |
flutter build ipa \
--export-options-plist=/Users/builder/export_options.plist \
--flavor dev \
--target lib/main_dev.dart
artifacts:
- build/**/outputs/apk/**/*.apk
- build/ios/ipa/*.ipa
publishing:
scripts:
- name: Post App Preview
script: |
dart pub global activate codemagic_app_preview 0.2.1
app_preview post \
--github_token $GITHUB_PAT \
--codemagic_token $CODEMAGIC_TOKEN \
--message "_Note_: Only Sharezone team members are able to install the iOS app."