Test RN/BRN Version #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/checkout@v2.3.3 | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v1.0.2 | |
- 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/checkout@v2.3.3 | |
- 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/checkout@v2.3.3 | |
- 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 | |
# 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. |