-
Notifications
You must be signed in to change notification settings - Fork 26
164 lines (136 loc) · 4.44 KB
/
build-examples.yml
File metadata and controls
164 lines (136 loc) · 4.44 KB
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: 🏗️ Build Example Apps
on:
push:
branches:
- main
paths:
- 'example/**'
- 'packages/react-native-sortables/**'
- '.github/workflows/build-examples.yml'
workflow_dispatch: # Allow manual triggering
env:
NODE_VERSION: '20'
jobs:
# Build Expo app locally (no EAS required)
build-expo:
name: 📱 Build Expo App
runs-on: ubuntu-latest
concurrency:
group: build-expo-${{ github.ref }}
cancel-in-progress: true
steps:
- name: 🛒 Checkout code
uses: actions/checkout@v4
- name: 🔧 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: 📦 Install dependencies
run: yarn install --immutable
- name: 📱 Install Expo CLI
run: npm install -g @expo/cli
- name: 🔍 Validate Expo configuration
working-directory: example/expo
env:
EXPO_DOCTOR_SKIP_DEPENDENCY_VERSION_CHECK: true
run: npx expo-doctor
- name: 🏗️ Build Expo bundle
working-directory: example/expo
run: npx expo export --platform all
- name: 📦 Upload Expo build artifacts
uses: actions/upload-artifact@v4
with:
name: expo-build
path: example/expo/dist/
retention-days: 7
# Build React Native apps (Fabric and Paper)
build-react-native:
name: 📱 Build ${{ matrix.app }} (${{ matrix.platform }})
runs-on: macos-15
concurrency:
group: build-react-native-${{ matrix.app }}-${{ matrix.platform }}-${{ github.ref }}
cancel-in-progress: true
strategy:
matrix:
app: [fabric, paper]
platform: [ios, android]
fail-fast: false
steps:
- name: 🛒 Checkout code
uses: actions/checkout@v4
- name: 🔧 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: 📦 Install dependencies
run: yarn install --immutable
- name: 🍎 Setup Ruby (iOS only)
if: matrix.platform == 'ios'
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: 🍎 Select Xcode (iOS only)
if: matrix.platform == 'ios'
run: sudo xcode-select --switch /Applications/Xcode_16.4.app
- name: ☕ Setup Java (Android only)
if: matrix.platform == 'android'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: 🤖 Setup Android SDK (Android only)
if: matrix.platform == 'android'
uses: android-actions/setup-android@v3
- name: 🍎 Install pods (iOS only)
if: matrix.platform == 'ios'
working-directory: example/${{ matrix.app }}/ios
run: |
bundle install
bundle exec pod install
- name: 🍎 Build iOS
if: matrix.platform == 'ios'
working-directory: example/${{ matrix.app }}
run: yarn react-native run-ios --no-packager --scheme "reactNativeSortable${{ matrix.app == 'fabric' && 'Fabric' || 'Paper' }}"
- name: 🤖 Build Android
if: matrix.platform == 'android'
working-directory: example/${{ matrix.app }}
run: |
cd android
./gradlew assembleDebug
- name: 📦 Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.app }}-${{ matrix.platform }}-build
path: |
example/${{ matrix.app }}/ios/build/
example/${{ matrix.app }}/android/app/build/
retention-days: 7
# Build Web app
build-web:
name: 🌐 Build Web App
runs-on: ubuntu-latest
concurrency:
group: build-web-${{ github.ref }}
cancel-in-progress: true
steps:
- name: 🛒 Checkout code
uses: actions/checkout@v4
- name: 🔧 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: 📦 Install dependencies
run: yarn install --immutable
- name: 🌐 Build web app
working-directory: example/web
run: yarn expo export -p web
- name: 📦 Upload web build artifacts
uses: actions/upload-artifact@v4
with:
name: web-build
path: example/web/dist/
retention-days: 7