-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcodemagic.yaml
66 lines (64 loc) · 2.47 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
# This is example for using the codemagic_app_preview package in a
# `codemagic.yaml`.
workflows:
app_preview:
name: app_preview
environment:
flutter: default
groups:
# Adding environment group "github" which includes the GITHUB_PAT
# variable.
- "github"
# Adding environment group "codemagic" which includes the CODEMAGIC_TOKEN
# variable.
- "codemagic"
# Adding environment group "appstore_credentials" to sign iOS apps.
- appstore_credentials
triggering:
cancel_previous_builds: true
working_directory: packages/app_preview_example
when:
changeset:
includes:
- "codemagic.yaml"
- "packages/app_preview_example/**"
- "packages/app_preview_lints/**"
- "packages/codemagic_app_preview/**"
excludes:
- "**/*.md"
scripts:
- name: Fetch dependencies
script: flutter pub get
- name: Build APK (Android)
script: flutter build apk
# Sign with the type "IOS_APP_ADHOC". See more information about code
# signing: https://docs.codemagic.io/yaml-code-signing/signing-ios/
- name: Build macOS
script: flutter build macos
- name: Sign iOS
script: |
keychain initialize
app-store-connect fetch-signing-files "io.nilsreichardt.codemagicapppreviewexample" --type IOS_APP_ADHOC --create
keychain add-certificates
xcode-project use-profiles
- name: Build IPA (iOS)
# Don't forget the "export-options" argument.
script: flutter build ipa --export-options-plist=/Users/builder/export_options.plist
artifacts:
- build/**/outputs/apk/**/*.apk # Build output for Android
- build/ios/ipa/*.ipa # Build output for iOS
- build/macos/Build/Products/Release/*.app # Build output for macOS
publishing:
scripts:
- name: Post App Preview
script: |
# You should use for app the following line instead of "dart pub
# global activate -s path...":
# dart pub global activate codemagic_app_preview
# Using local path to test changes and ensure everything is working
# when someone opens PR.
dart pub global activate -s path ../codemagic_app_preview
app_preview post \
--github_token $GITHUB_PAT \
--codemagic_token $CODEMAGIC_TOKEN \
--message "This is a custom message."