forked from msgbyte/tailchat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codemagic.yaml
92 lines (90 loc) · 3.24 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
workflows:
android:
name: build, test & publish Android version
max_build_duration: 30
instance_type: mac_mini_m1
working_directory: client/mobile
environment:
groups:
- default
- cloudflare_credentials
cache:
cache_paths:
- $CM_BUILD_DIR/node_modules
scripts:
- name: Install npm dependencies
script: |
yarn
- name: Set Android SDK location
script: |
echo "sdk.dir=$ANDROID_SDK_ROOT" > "./android/local.properties"
- name: Set Files
script: |
echo $AGCONNECT_SERVICES | base64 --decode > "./android/app/agconnect-services.json"
echo $KEYSTORE_FILE | base64 --decode > "./android/app/tailchat.keystore"
echo "TAILCHAT_UPLOAD_STORE_FILE=$TAILCHAT_UPLOAD_STORE_FILE" >> "./.env"
echo "TAILCHAT_UPLOAD_STORE_PASSWORD=$TAILCHAT_UPLOAD_STORE_PASSWORD" >> "./.env"
echo "TAILCHAT_UPLOAD_KEY_ALIAS=$TAILCHAT_UPLOAD_KEY_ALIAS" >> "./.env"
echo "TAILCHAT_UPLOAD_KEY_PASSWORD=$TAILCHAT_UPLOAD_KEY_PASSWORD" >> "./.env"
echo "GETUI_APPID=$GETUI_APPID" >> "./.env"
echo "GETUI_APPKEY=$GETUI_APPKEY" >> "./.env"
echo "GETUI_APPSECRET=$GETUI_APPSECRET" >> "./.env"
echo "GETUI_HUAWEI_APP_ID=$GETUI_HUAWEI_APP_ID" >> "./.env"
- name: Build Android release
working_directory: client/mobile/android
script: |
UPDATED_BUILD_NUMBER=$BUILD_NUMBER
./gradlew assembleRelease \
-PversionCode=$UPDATED_BUILD_NUMBER \
-PversionName=1.0.$UPDATED_BUILD_NUMBER
- name: Build finished successfully
script: touch ~/SUCCESS
artifacts:
- android/app/build/outputs/**/**/*.apk
publishing:
email:
recipients:
scripts:
- name: Install wrangler
script: npm install -g wrangler
- name: Deploy to Cloudflare Pages
script: |
if [[ -f ~/SUCCESS ]]; then
if [[ $CM_BRANCH == "master" ]]; then
# deploy to production
wrangler pages publish android/app/build/outputs/apk/release --project-name tailchat --branch main
else
wrangler pages publish android/app/build/outputs/apk/release --project-name tailchat --branch $CM_BRANCH
fi
fi
- name: Notify artifact URL to Tailchat
script: |
node scripts/notify-links.js
ios:
name: build, test & publish iOS version
instance_type: mac_mini_m1
working_directory: client/mobile
environment:
groups:
- default
- cloudflare_credentials
cache:
cache_paths:
- $CM_BUILD_DIR/node_modules
scripts:
- name: Install npm dependencies
script: |
yarn
- name: Build ipa for distribution
working_directory: client/mobile/ios
script: |
xcode-project build-ipa \
--workspace "$CM_BUILD_DIR/client/mobile/ios/$XCODE_WORKSPACE" \
--scheme "$XCODE_SCHEME"
artifacts:
- build/ios/ipa/*.ipa
publishing:
email:
recipients: