forked from bluesky-social/social-app
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcodemagic.yaml
125 lines (118 loc) · 4.42 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
# Check out https://docs.codemagic.io/yaml/building-a-react-native-app/ for more information
# Please review and update values
workflows:
react-native-ios-android:
name: React Native iOS and Android
max_build_duration: 120
# instance_type: mac_mini_m1
# integrations:
# app_store_connect: Codemagic
environment:
ios_signing:
distribution_type: app_store
bundle_identifier: cm.blueskyweb.app
android_signing:
- codemagic_keystore
vars:
XCODE_PROJECT: "Bluesky.xcodeproj" # <-- Put the name of your Xcode workspace here
XCODE_SCHEME: "Bluesky" # <-- Put the name of your Xcode scheme here
BUNDLE_ID: "cm.blueskyweb.app" # <-- Put your Bundle Id here e.g com.domain.myapp
APP_ID: 6480049997 # <-- Put the app id number here. This is found in App Store Connect > App > General > App Information
xcode: 15.4
java: 17
cache:
cache_paths:
- $HOME/Library/Caches/CocoaPods
- $CM_BUILD_DIR/node_modules
scripts:
- name: Install dependencies and set up app
script: |
yarn install --legacy-peer-deps
npx expo prebuild
- 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: Customise iOS entitlements
script: |
sed -i.bak '/com.apple.security.application-groups/d' $CM_BUILD_DIR/ios/Bluesky/Bluesky.entitlements
sed -i.bak '/com.apple.security.application-groups/d' $CM_BUILD_DIR/ios/Share-with-Bluesky/Share-with-Bluesky.entitlements
- name: Build iOS app
script: |
xcode-project build-ipa \
--workspace "$CM_BUILD_DIR/ios/Bluesky.xcworkspace" \
--scheme "$XCODE_SCHEME"
- name: Set Android SDK location
script: |
echo "sdk.dir=$ANDROID_SDK_ROOT" > "$CM_BUILD_DIR/android/local.properties"
- name: Build Android app
script: |
cd android
./gradlew bundleRelease
artifacts:
- build/ios/ipa/*.ipa
- android/app/build/outputs/**/*.aab
- /tmp/xcodebuild_logs/*.log
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.app
- $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.dSYM
react-native-android:
name: React Native Android
max_build_duration: 120
instance_type: linux_x2
environment:
android_signing:
- codemagic_keystore
# groups:
# - google_play # <-- (Includes GCLOUD_SERVICE_ACCOUNT_CREDENTIALS <-- Put your google-services.json)
vars:
PACKAGE_NAME: "io.codemagic.expoapp" # <-- Put your package name here e.g. com.domain.myapp
java: 17
triggering:
events:
- push
- tag
- pull_request
branch_patterns:
- pattern: develop
include: true
source: true
scripts:
- name: Install dependencies and set up app
script: |
yarn install --legacy-peer-deps
npx expo prebuild
# - name: Set up app/build.gradle
# script: |
# mv ./support-files/build.gradle android/app
- 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:
# notify:
# success: true
# failure: false
# google_play:
# credentials: $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS
# track: internal
# submit_as_draft: true