Ver código fonte

feat(ci) improve mobile CI

- Run Android and iOS on macOS (same as our release process)
- Simplify checking for Podfile changes
- Simplify frontend actions
- Add CI for building the native Android and iOS SDK
factor2
Saúl Ibarra Corretgé 6 meses atrás
pai
commit
c95d1d7f7e
1 arquivos alterados com 74 adições e 22 exclusões
  1. 74
    22
      .github/workflows/ci.yml

+ 74
- 22
.github/workflows/ci.yml Ver arquivo

@@ -34,9 +34,13 @@ jobs:
34 34
     - name: Check if the git repository is clean
35 35
       run: $(exit $(git status --porcelain --untracked-files=no | head -255 | wc -l)) || (echo "Dirty git tree"; git diff; exit 1)
36 36
     - run: npm run lint:ci && npm run tsc:ci
37
-  linux-build:
38
-    name: Build Frontend (Linux)
39
-    runs-on: ubuntu-latest
37
+  frontend:
38
+    name: Build Frontend
39
+    runs-on: ${{ matrix.os }}
40
+    strategy:
41
+      fail-fast: false
42
+      matrix:
43
+        os: [macos-latest, ubuntu-latest]
40 44
     steps:
41 45
     - uses: actions/checkout@v4
42 46
     - uses: actions/setup-node@v4
@@ -49,20 +53,55 @@ jobs:
49 53
         npm -v
50 54
     - run: npm install
51 55
     - run: make
52
-  macos-ci:
53
-    name: Build Frontend (macOS)
54
-    runs-on: macOS-latest
56
+  android-rn-bundle-build:
57
+    name: Build mobile bundle (Android)
58
+    runs-on: macos-15
55 59
     steps:
56 60
     - uses: actions/checkout@v4
57 61
     - uses: actions/setup-node@v4
58 62
       with:
59
-        node-version: 20
63
+        node-version-file: '.nvmrc'
60 64
         cache: 'npm'
65
+    - name: Check Node / npm versions
66
+      run: |
67
+        node -v
68
+        npm -v
61 69
     - run: npm install
62
-    - run: make
63
-  android-build:
64
-    name: Build mobile bundle (Android)
70
+    - run: npx react-native bundle --entry-file react/index.native.js --platform android --bundle-output /tmp/android.bundle --reset-cache
71
+  ios-rn-bundle-build:
72
+    name: Build mobile bundle (iOS)
73
+    runs-on: macos-15
74
+    steps:
75
+    - uses: actions/checkout@v4
76
+    - uses: actions/setup-node@v4
77
+      with:
78
+        node-version-file: '.nvmrc'
79
+        cache: 'npm'
80
+    - name: Check Node / npm versions
81
+      run: |
82
+        node -v
83
+        npm -v
84
+    - run: npm install
85
+    - name: setup Xcode
86
+      run: |
87
+        uname -a
88
+        xcode-select -p
89
+        sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer
90
+        xcodebuild -version
91
+    - name: setup-cocoapods
92
+      uses: maxim-lobanov/setup-cocoapods@v1
93
+      with:
94
+        podfile-path: ios/Podfile.lock
95
+    - name: Install Pods
96
+      run: |
97
+        pod --version
98
+        cd ios
99
+        pod install --repo-update --deployment
100
+    - run: npx react-native bundle --entry-file react/index.native.js --platform ios --bundle-output /tmp/ios.bundle --reset-cache
101
+  android-sdk-build:
102
+    name: Build mobile SDK (Android)
65 103
     runs-on: ubuntu-latest
104
+    container: reactnativecommunity/react-native-android:v13.0
66 105
     steps:
67 106
     - uses: actions/checkout@v4
68 107
     - uses: actions/setup-node@v4
@@ -74,14 +113,13 @@ jobs:
74 113
         node -v
75 114
         npm -v
76 115
     - run: npm install
77
-    - run: npx react-native bundle --entry-file react/index.native.js --platform android --bundle-output /tmp/android.bundle --reset-cache
78
-  ios-build:
79
-    name: Build mobile bundle (iOS)
80
-    runs-on: ${{ matrix.os }}
81
-    strategy:
82
-      fail-fast: false
83
-      matrix:
84
-        os: [macos-15]
116
+    - run: |
117
+        cd android
118
+        ./gradlew :sdk:clean
119
+        ./gradlew :sdk:assembleRelease
120
+  ios-sdk-build:
121
+    name: Build mobile SDK (iOS)
122
+    runs-on: macos-15
85 123
     steps:
86 124
     - uses: actions/checkout@v4
87 125
     - uses: actions/setup-node@v4
@@ -107,10 +145,24 @@ jobs:
107 145
       run: |
108 146
         pod --version
109 147
         cd ios
110
-        pod install --repo-update
111
-    - name: Check if the git repository is clean
112
-      run: $(exit $(git status --porcelain --untracked-files=no | head -255 | wc -l)) || (echo "Dirty git tree"; git diff; exit 1)
113
-    - run: npx react-native bundle --entry-file react/index.native.js --platform ios --bundle-output /tmp/ios.bundle --reset-cache
148
+        pod install --repo-update --deployment
149
+    - run: |
150
+        xcodebuild clean \
151
+          -workspace ios/jitsi-meet.xcworkspace \
152
+          -scheme JitsiMeetSDK
153
+        xcodebuild archive \
154
+          -workspace ios/jitsi-meet.xcworkspace \
155
+          -scheme JitsiMeetSDK  \
156
+          -configuration Release \
157
+          -sdk iphoneos \
158
+          -destination='generic/platform=iOS' \
159
+          -archivePath ios/sdk/out/ios-device \
160
+          SKIP_INSTALL=NO \
161
+          BUILD_LIBRARY_FOR_DISTRIBUTION=YES
162
+        xcodebuild -create-xcframework \
163
+          -framework ios/sdk/out/ios-device.xcarchive/Products/Library/Frameworks/JitsiMeetSDK.framework \
164
+          -output ios/sdk/out/JitsiMeetSDK.xcframework
165
+    - run: ls -lR ios/sdk/out
114 166
   debian-build:
115 167
     name: Test Debian packages build
116 168
     runs-on: ubuntu-latest

Carregando…
Cancelar
Salvar