-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (165 loc) · 6.09 KB
/
Copy pathreact-native-build.yml
File metadata and controls
185 lines (165 loc) · 6.09 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: Build React Native App
on:
push:
branches: [master]
paths:
- "AfterburnerControl/package.json"
- "AfterburnerControl/package-lock.json"
- "AfterburnerControl/android/**"
- "AfterburnerControl/ios/**"
- "AfterburnerControl/src/**"
pull_request:
branches: [master]
paths:
- "AfterburnerControl/package.json"
- "AfterburnerControl/package-lock.json"
- "AfterburnerControl/android/**"
- "AfterburnerControl/ios/**"
- "AfterburnerControl/src/**"
workflow_dispatch:
jobs:
build-android:
runs-on: ubuntu-latest
env:
JAVA_HOME: /opt/hostedtoolcache/Java_Zulu_jdk/17.0.10-7/x64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
cache-dependency-path: AfterburnerControl/package-lock.json
- name: Install dependencies
working-directory: ./AfterburnerControl
run: npm ci
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Verify Java and Android SDK
run: |
echo "Java version:"
java -version
echo ""
echo "JAVA_HOME: $JAVA_HOME"
echo ""
echo "Android SDK location:"
echo $ANDROID_HOME
echo ""
echo "Available Android SDK tools:"
ls -la $ANDROID_HOME/cmdline-tools/latest/bin/
- name: Make Gradle wrapper executable
working-directory: ./AfterburnerControl/android
run: |
echo "Checking Android directory structure..."
ls -la
echo ""
echo "Checking Gradle wrapper file..."
ls -la gradlew
echo ""
echo "Making Gradle wrapper executable..."
chmod +x gradlew
echo ""
echo "Verifying permissions..."
ls -la gradlew
echo ""
echo "Testing Gradle wrapper..."
./gradlew --version
- name: Build Android APK
working-directory: ./AfterburnerControl
env:
ANDROID_HOME: ${{ env.ANDROID_HOME }}
JAVA_HOME: ${{ env.JAVA_HOME }}
run: |
cd android
./gradlew assembleRelease --info
cd ..
- name: Upload Android APK
uses: actions/upload-artifact@v4
with:
name: android-apk
path: AfterburnerControl/android/app/build/outputs/apk/release/
retention-days: 7
build-ios:
runs-on: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
cache-dependency-path: AfterburnerControl/package-lock.json
- name: Install dependencies
working-directory: ./AfterburnerControl
run: npm ci
- name: Setup Xcode
run: |
echo "Available Xcode versions:"
ls -la /Applications/ | grep Xcode
echo ""
echo "Current Xcode setup:"
xcode-select --print-path
xcodebuild -version
echo ""
echo "Setting Xcode to latest version..."
if [ -d "/Applications/Xcode_16.1.app" ]; then
sudo xcode-select --switch /Applications/Xcode_16.1.app
elif [ -d "/Applications/Xcode_16.2.app" ]; then
sudo xcode-select --switch /Applications/Xcode_16.2.app
else
echo "Using default Xcode version"
fi
echo ""
echo "Verifying Xcode setup:"
xcodebuild -version
echo "Xcode path: $(xcode-select --print-path)"
- name: Install iOS dependencies
working-directory: ./AfterburnerControl/ios
env:
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer
run: |
pod install --repo-update
- name: List iOS schemes and simulators
working-directory: ./AfterburnerControl/ios
env:
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer
run: |
echo "Available schemes:"
xcodebuild -list -workspace AfterburnerControl.xcworkspace
echo ""
echo "Available simulators:"
xcrun simctl list devices available | grep iPhone
echo ""
echo "Workspace structure:"
ls -la
- name: Build iOS
working-directory: ./AfterburnerControl
env:
DEVELOPER_DIR: /Applications/Xcode_16.1.app/Contents/Developer
run: |
cd ios
echo "Attempting to build with iPhone 16 (iOS 18.2) simulator..."
xcodebuild -workspace AfterburnerControl.xcworkspace -scheme AfterburnerControl -configuration Release -destination 'platform=iOS Simulator,id=1A39A28F-677F-4200-9E54-1F6CF100FE1F' -derivedDataPath build || {
echo "iPhone 16 (iOS 18.2) simulator not available, trying iPhone 16 (iOS 18.1)..."
xcodebuild -workspace AfterburnerControl.xcworkspace -scheme AfterburnerControl -configuration Release -destination 'platform=iOS Simulator,id=B05C1CFC-2036-4762-8451-6D9F1769D3E3' -derivedDataPath build || {
echo "iPhone 16 simulators not available, trying generic iPhone 16..."
xcodebuild -workspace AfterburnerControl.xcworkspace -scheme AfterburnerControl -configuration Release -destination 'platform=iOS Simulator,name=iPhone 16' -derivedDataPath build || {
echo "iPhone 16 simulator not available, trying generic iOS Simulator..."
xcodebuild -workspace AfterburnerControl.xcworkspace -scheme AfterburnerControl -configuration Release -destination 'platform=iOS Simulator' -derivedDataPath build
}
}
}
cd ..
- name: Upload iOS build
uses: actions/upload-artifact@v4
with:
name: ios-build
path: AfterburnerControl/ios/build/
retention-days: 7