-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodemagic.yaml
More file actions
125 lines (122 loc) · 5 KB
/
codemagic.yaml
File metadata and controls
125 lines (122 loc) · 5 KB
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
# Check out https://docs.codemagic.io/yaml/building-a-react-native-app/ for more information
# Please review and update values
workflows:
react-native-android:
name: React Native Android Workflow
max_build_duration: 120
# instance_type: mac_mini_m2
environment:
android_signing:
- CodeMagic Debug Key
groups:
- google_play # <-- (Includes GCLOUD_SERVICE_ACCOUNT_CREDENTIALS <-- Put your google-services.json)
vars:
PACKAGE_NAME: 'io.codemagic.sample.reactnative' # <-- Put your package name here e.g. com.domain.myapp
GOOGLE_PLAY_TRACK: "alpha"
node: v19.7.0
xcode: 16.2 # need to pick xcode version, to avoid error: The selected Xcode version is not available on this instance
cocoapods: default
scripts:
- name: Install npm dependencies
script: |
npm install
- name: Set Android SDK location
script: |
echo "sdk.dir=$ANDROID_SDK_ROOT" > "$CM_BUILD_DIR/android/local.properties"
- name: Build Android AAB release
# script: |
# LATEST_GOOGLE_PLAY_BUILD_NUMBER=$(google-play get-latest-build-number --package-name "$PACKAGE_NAME")
# if [ -z LATEST_BUILD_NUMBER ]; then
# # fallback in case no build number was found from google play. Alternatively, you can `exit 1` to fail the build
# UPDATED_BUILD_NUMBER=$BUILD_NUMBER
# else
# UPDATED_BUILD_NUMBER=$(($LATEST_GOOGLE_PLAY_BUILD_NUMBER + 1))
# fi
script: |
cd android
./gradlew bundleRelease \
-PversionCode=$PROJECT_BUILD_NUMBER \
-PversionName=1.0.$PROJECT_BUILD_NUMBER
- name: Build Android APK release
script: |
cd android
./gradlew assembleRelease \
-PversionCode=$PROJECT_BUILD_NUMBER \
-PversionName=1.0.$PROJECT_BUILD_NUMBER
artifacts:
- android/app/build/outputs/**/*.aab
- android/app/build/outputs/**/*.apk
- android/app/release/**/*.apk
publishing:
email:
recipients:
- user_1@example.com
- user_2@example.com
notify:
success: true # To not receive a notification when a build succeeds
failure: false # To not receive a notification when a build fails
# google_play:
# credentials: $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS
# track: alpha # Any default or custom track that is not in ‘draft’ status
react-native-ios:
name: React Native iOS Workflow
max_build_duration: 120
# instance_type: mac_mini_m2
# integrations:
# app_store_connect: codemagic
environment:
ios_signing:
distribution_type: development
bundle_identifier: com.prudential.pruservices.dev
vars:
XCODE_WORKSPACE: 'CodemagicCodepush.xcworkspace' # <-- Put the name of your Xcode workspace here
XCODE_SCHEME: 'CodemagicCodepush' # <-- Put the name of your Xcode scheme here
APP_ID: 2LQYQD27P7 # <-- Put the app id number here. This is found in App Store Connect > App > General > App Information
node: v18.20.8
xcode: 16.2
cocoapods: default
scripts:
- name: Install npm dependencies
script: |
npm install
- name: Install CocoaPods dependencies
script: |
cd ios && pod install
- name: Set up code signing settings on Xcode project
script: |
xcode-project use-profiles --warn-only
- name: Increment build number
script: |
# Information about getting the latest build version can be found here: https://docs.codemagic.io/knowledge-codemagic/build-versioning/#app-store-or-testflight-latest-build-number
cd $CM_BUILD_DIR/ios
LATEST_BUILD_NUMBER=$(app-store-connect get-latest-testflight-build-number "$APP_ID")
agvtool new-version -all $(($LATEST_BUILD_NUMBER + 1))
- name: Build ipa for distribution
script: |
xcode-project build-ipa \
--workspace "$CM_BUILD_DIR/ios/$XCODE_WORKSPACE" \
--scheme "$XCODE_SCHEME"
artifacts:
- build/ios/ipa/*.ipa
- /tmp/xcodebuild_logs/*.log
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.app
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.dSYM
publishing:
email:
recipients:
- user_1@example.com
- user_2@example.com
notify:
success: true
failure: false
# app_store_connect:
# auth: integration
# # Configuration related to TestFlight (optional)
# # Note: This action is performed during post-processing.
# submit_to_testflight: false
# beta_groups: # Specify the names of beta tester groups that will get access to the build once it has passed beta review.
# - group name 1
# - group name 2
# # Configuration related to App Store (optional)
# # Note: This action is performed during post-processing.
# submit_to_app_store: false