-
Notifications
You must be signed in to change notification settings - Fork 0
/
codemagic.yaml
133 lines (131 loc) · 5.32 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
# Check out https://docs.codemagic.io/yaml-quick-start/building-a-react-native-app/ for more information
# https://docs.codemagic.io/flutter-publishing/publishing-to-google-play/
# Please review and update values
workflows:
react-native-android:
name: React Native Android
max_build_duration: 120
instance_type: mac_mini_m1
environment:
android_signing:
- keystore_tago
groups:
- tago # <-- (Includes GCLOUD_SERVICE_ACCOUNT_CREDENTIALS <-- Put your google-services.json)
# - google_play # <-- (Includes GCLOUD_SERVICE_ACCOUNT_CREDENTIALS <-- Put your google-services.json)
vars:
PACKAGE_NAME: 'com.tago' # <-- Put your package name here e.g. com.domain.myapp
node: v16.13.0
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 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
cd android
./gradlew bundleRelease \
-PversionCode=$UPDATED_BUILD_NUMBER \
-PversionName=1.0.$UPDATED_BUILD_NUMBER
artifacts:
- android/app/build/outputs/**/*.aab
publishing:
email:
recipients:
- tombonaventure@protonmail.com
notify:
success: true # To not receive a notification when a build succeeds
failure: true # 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
track: internal
submit_as_draft: true
react-native-ios:
name: React Native iOS
max_build_duration: 120
instance_type: mac_mini_m1
integrations:
app_store_connect: Personal Tago
environment:
ios_signing:
distribution_type: app_store
bundle_identifier: com.tago
groups:
- tago
vars:
XCODE_WORKSPACE: 'tago.xcworkspace' # <-- Put the name of your Xcode workspace here
XCODE_SCHEME: 'tago' # <-- Put the name of your Xcode scheme here
APP_ID: 6444935919 # <-- Put the app id number here. This is found in App Store Connect > App > General > App Information
node: v16.13.0
xcode: latest
cocoapods: default
scripts:
- name: Decode firebase ios
script: |
echo $FIREBASE_IOS | base64 --decode > /Users/builder/clone/ios/GoogleService-Info.plist
- name: Install dependencies
script: |
yarn
- name: Install CocoaPods dependencies
script: |
cd ios && pod install
- name: Set Info.plist values
script: |
# This allows publishing without manually answering the question about encryption
PLIST=$CM_BUILD_DIR/$XCODE_SCHEME/Info.plist
PLIST_BUDDY=/usr/libexec/PlistBuddy
$PLIST_BUDDY -c "Add :ITSAppUsesNonExemptEncryption bool false" $PLIST
- name: Set up code signing settings on Xcode project
script: |
xcode-project use-profiles --warn-only
# - name: Get the latest build number
# script: |
# LATEST_BUILD_NUMBER=$(app-store-connect get-latest-app-store-build-number $APP_APPLE_ID)
# cd ./ios # avgtool must run in the folder where xcodeproj file is located
# agvtool new-version -all $(($LATEST_BUILD_NUMBER + 1))
# - name: Increment build number
# script: |
# #!/bin/sh
# set -e
# set -x
# cd $CM_BUILD_DIR/ios
# LATEST_BUILD_NUMBER=$(app-store-connect get-latest-app-store-build-number "$APP_ID")
# agvtool new-version -all $(($LATEST_BUILD_NUMBER + 1))
# # change to next-version (original is new-version)?
- 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:
- tombonaventure@protonmail.com
notify:
success: true
failure: true
app_store_connect:
auth: integration
# Configuration related to TestFlight (optional)
submit_to_testflight: false
# Note: This action is performed during post-processing.
# beta_groups: # Specify the names of beta tester groups that will get access to the build once it has passed beta review.
# - App Store Connect Users
# - Beta Testers
# Configuration related to App Store (optional)
# Note: This action is performed during post-processing.
submit_to_app_store: false