-
Notifications
You must be signed in to change notification settings - Fork 59
211 lines (200 loc) · 9.32 KB
/
testVersion.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
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: Test RN/BRN Version
on:
workflow_dispatch:
inputs:
RN_Version:
description: 'ReactNative Version'
required: true
type: string
default: '0.71.0'
BRN_Version:
description: 'BRN package version'
required: true
type: string
default: '1.5.3-preview'
BRN_Postfix:
description: 'BRN package postfix'
required: true
type: string
default: '0-71'
BJS_Version:
description: 'Babylon.js version'
required: true
type: string
default: '6.0'
jobs:
build-windows:
runs-on: windows-2019
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Build Playground Windows x64
run: |
npx react-native init Playground --version ${{ github.event.inputs.RN_Version }}
cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx
cd Playground
npx react-native-windows-init --overwrite
npm install @babylonjs/core@${{ github.event.inputs.BJS_Version }}
npm install @babylonjs/loaders@${{ github.event.inputs.BJS_Version }}
npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }}
npm install @babylonjs/react-native-windows-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }}
npm install @react-native-community/slider
# npm install react-native-permissions
npx react-native autolink-windows
msbuild.exe /r "./windows/Playground.sln"
msbuild.exe /p:Configuration="Release" /p:Platform="x64" /m "./windows/Playground.sln"
- name: Upload UWP x64
uses: actions/upload-artifact@v2
with:
name: 'WindowsAppx'
path: Playground/windows/AppPackages/Playground/Playground_1.0.0.0_x64_Test/ #Playground_1.0.0.0_x64.appx
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Build Playground Android
run: |
npm uninstall -g react-native-cli @react-native-community/cli
npx react-native init Playground --version "${{ github.event.inputs.RN_Version }}" --verbose
cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx
cp Apps/Playground/0.71/android/app/src/main/AndroidManifest.xml ./Playground/android/app/src/main/
cd Playground
npm install @babylonjs/core@${{ github.event.inputs.BJS_Version }}
npm install @babylonjs/loaders@${{ github.event.inputs.BJS_Version }}
npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }}
npm install @babylonjs/react-native-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }}
npm install @react-native-community/slider
npm install react-native-permissions
cd android
./gradlew app:assembleRelease --stacktrace --info
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: 'AndroidAPK'
path: Playground/android/app/build/outputs/apk/release/app-release.apk
build-ios:
runs-on: macos-latest
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Clone iOS Toolchain
run: |
git clone https://github.com/leetal/ios-cmake.git
- name: Build Playground iOS
run: |
brew install node
brew install watchman
npm uninstall -g react-native-cli @react-native-community/cli
npx react-native init Playground --version "${{ github.event.inputs.RN_Version }}" --verbose --skip-install
cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx
cd Playground
yarn install
npm install @babylonjs/core@${{ github.event.inputs.BJS_Version }}
npm install @babylonjs/loaders@${{ github.event.inputs.BJS_Version }}
npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }}
npm install @babylonjs/react-native-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }}
npm install @react-native-community/slider
npm install react-native-permissions
cd ios
pod install
#xcodebuild -sdk iphoneos -configuration Release -workspace Playground.xcworkspace -scheme Playground build CODE_SIGNING_ALLOWED=NO
xcodebuild -sdk iphonesimulator -arch x86_64 -configuration Release -workspace Playground.xcworkspace -scheme Playground build CODE_SIGNING_ALLOWED=NO -archivePath ./playgroundSimulator.xcarchive archive
- name: Upload iOS App
uses: actions/upload-artifact@v2
with:
name: 'iOSApp'
path: Playground/ios/playgroundSimulator.xcarchive
build-android-basekit:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Build Playground Android
run: |
npm uninstall -g react-native-cli @react-native-community/cli
npx react-native init Playground --version "${{ github.event.inputs.RN_Version }}" --verbose
cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx
cd Playground
npm install @babylonjs/core@${{ github.event.inputs.BJS_Version }}
npm install @babylonjs/loaders@${{ github.event.inputs.BJS_Version }}
npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }}
npm install @babylonjs/react-native-basekit-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }}
npm install @react-native-community/slider
cd android
./gradlew app:assembleRelease --stacktrace --info
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: 'AndroidBasekitAPK'
path: Playground/android/app/build/outputs/apk/release/app-release.apk
build-ios-basekit:
runs-on: macos-latest
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Clone iOS Toolchain
run: |
git clone https://github.com/leetal/ios-cmake.git
- name: Build Playground iOS
run: |
brew install node
brew install watchman
npm uninstall -g react-native-cli @react-native-community/cli
npx react-native init Playground --version "${{ github.event.inputs.RN_Version }}" --verbose --skip-install
cp Apps/Playground/playground-shared/App.tsx ./Playground/App.tsx
cd Playground
yarn install
npm install @babylonjs/core@${{ github.event.inputs.BJS_Version }}
npm install @babylonjs/loaders@${{ github.event.inputs.BJS_Version }}
npm install @babylonjs/react-native@${{ github.event.inputs.BRN_Version }}
npm install @babylonjs/react-native-basekit-iosandroid-${{ github.event.inputs.BRN_Postfix }}@${{ github.event.inputs.BRN_Version }}
npm install @react-native-community/slider
cd ios
pod install
#xcodebuild -sdk iphoneos -configuration Release -workspace Playground.xcworkspace -scheme Playground build CODE_SIGNING_ALLOWED=NO
xcodebuild -sdk iphonesimulator -arch x86_64 -configuration Release -workspace Playground.xcworkspace -scheme Playground build CODE_SIGNING_ALLOWED=NO -archivePath ./playgroundSimulator.xcarchive archive
- name: Upload iOS App
uses: actions/upload-artifact@v2
with:
name: 'iOSBasekitApp'
path: Playground/ios/playgroundSimulator.xcarchive
# test jobs not working
# test-android:
# needs: [build-android]
# runs-on: macos-latest
# steps:
# - name: Download APK
# uses: actions/download-artifact@v2
# with:
# name: 'AndroidAPK'
# path: ./
# - name: Install Android Emulator
# run: |
# echo Install Android image
# echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;android-27;default;x86_64"
# echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --licenses
# echo Create AVD
# $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_27 -d pixel -k "system-images;android-27;default;x86_64"
#
# - name: Start emulator
# run: |
# echo Start emulator
# nohup $ANDROID_HOME/emulator/emulator -avd Pixel_API_27 -gpu host -no-audio -no-boot-anim -camera-back none -camera-front none -qemu -m 2048 2>&1 &
# echo Wait for emulator
# adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do echo "."; sleep 1; done; input keyevent 82'
# adb devices
# adb install -t ./app-release.apk
# echo APK installation done.
# adb wait-for-device shell am start -n com.playground/com.playground.MainActivity
# echo Activity started.
# adb wait-for-device shell pidof com.playground
# echo Activity PID
# adb wait-for-device shell while [[ -z $(pidof com.playground | tr -d "\r") ]]; do echo "."; sleep 1; done; input keyevent 82
# echo Activity is running. Waiting 10s.
# sleep 10
# echo Checking it's still alive
# if [[ -z "$(pidof com.playground | tr -d '\r')" ]]; then echo "com.playground is not running."; exit 1; fi
# echo Checks done.