-
Notifications
You must be signed in to change notification settings - Fork 17
120 lines (101 loc) · 3.35 KB
/
mobile-build.yml
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
name: Build Mobile App
on:
push:
branches:
- main
pull_request:
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Set up matrix
run: echo "starting...."
build:
needs: prepare
strategy:
matrix:
include:
- platform: android
runner: ubuntu-latest
folder-id: https://drive.google.com/drive/folders/1NHG4yH-LMXwBnvgmwDnYKWdoIizfh3Ed
framework-path: ./weshd/android/
build-cmd: eas build --local --non-interactive --platform=android
- platform: ios
runner: macos-13
folder-id: https://drive.google.com/drive/folders/1UiIZ913lh_mrv7oKnI_u9418b5m8xttl
framework-path: ./weshd/ios/
build-cmd: eas build --local --non-interactive --platform=ios
runs-on: ${{ matrix.runner }}
continue-on-error: true
steps:
- uses: maxim-lobanov/setup-xcode@v1
if: matrix.platform == 'ios'
with:
xcode-version: "15.1.0"
- uses: actions/setup-go@v3
if: matrix.platform == 'ios'
with:
go-version: "1.19"
- name: Select xcode
if: matrix.platform == 'ios'
run: sudo xcode-select -s /Applications/Xcode_15.1.app
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: 18
- name: Fix gitignore
run: node ./cmd/fix-app-build.js
- name: Fix package.json
run: yarn remove @lottiefiles/react-lottie-player
- name: Install node modules
run: yarn install
- name: Build weshframework
if: matrix.platform == 'ios'
run: make check-ios-weshframework
- name: Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Download frameworks
if: matrix.platform == 'android'
run: |
pip install gdown
gdown ${{matrix.folder-id}} -O ${{matrix.framework-path}} --folder
- name: Build ${{ matrix.platform }}
run: ${{ matrix.build-cmd }}
- name: EAS Submit iOS IPA
if: matrix.platform == 'ios'
run: |
IPA_FILE=$(find ./ -name 'build-*.ipa' -type f)
if [ -z "$IPA_FILE" ]; then
echo "Error: IPA file not found."
exit 1
fi
# eas submit --platform=ios --path=$IPA_FILE
echo "IPA_FILE=$IPA_FILE" >> $GITHUB_ENV
- name: Upload IPA
uses: actions/upload-artifact@v3
if: matrix.platform == 'ios'
with:
name: teritori-${{ github.sha }}-${{ matrix.platform }}.ipa
path: ${{ env.IPA_FILE }}
if-no-files-found: error
- name: EAS Submit aab
if: matrix.platform == 'android'
run: |
AAB_FILE=$(find ./ -name 'build-*.aab' -type f)
if [ -z "$AAB_FILE" ]; then
echo "Error: apk file not found."
exit 1
fi
# eas submit --platform=android --path=$AAB_FILE
echo "AAB_FILE=$AAB_FILE" >> $GITHUB_ENV
- name: Upload aab
uses: actions/upload-artifact@v3
if: matrix.platform == 'android'
with:
name: teritori-${{ github.sha }}-${{ matrix.platform }}.aab
path: ${{ env.AAB_FILE }}
if-no-files-found: error