diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 000000000..47e502edf --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,42 @@ +name: PR Build +on: + pull_request: + branches: + - master + +jobs: + build-android: + runs-on: macos-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v2.3.1 + with: + submodules: 'recursive' + - name: Setup Ninja + run: brew install ninja + - name: Yarn Install (Playground) + run: yarn install + working-directory: ./Apps/Playground + - name: NPM Install (Binary Package) + run: npm install + working-directory: ./Package + - name: Gulp (Android) + run: npx gulp buildAndroid + working-directory: ./Package + + build-iOS: + runs-on: macos-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v2.3.1 + with: + submodules: 'recursive' + - name: Yarn Install (Playground) + run: yarn install + working-directory: ./Apps/Playground + - name: NPM Install (Binary Package) + run: npm install + working-directory: ./Package + - name: Gulp (iOS) + run: npx gulp buildIOS + working-directory: ./Package diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 09262b476..d26e621ac 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,14 +5,25 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: macos-latest steps: - name: Checkout Repo - uses: actions/checkout@v2.2.0 - - name: Checkout Submodules - uses: textbook/git-checkout-submodule-action@2.1.1 + uses: actions/checkout@v2.3.1 + with: + submodules: 'recursive' + - name: Setup Ninja + run: brew install ninja + - name: Yarn Install (Playground) + run: yarn install + working-directory: ./Apps/Playground + - name: NPM Install (Binary Package) + run: npm install + working-directory: ./Package + - name: Gulp + run: npx gulp + working-directory: ./Package - name: Setup Node.js - uses: actions/setup-node@v1.4.2 + uses: actions/setup-node@v2.1.0 with: node-version: '12.x' registry-url: 'https://registry.npmjs.org' @@ -21,6 +32,6 @@ jobs: run: | npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//} npm publish --access public - working-directory: ./Apps/Playground/node_modules/@babylonjs/react-native + working-directory: ./Package/Assembled env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/Apps/Playground/android/build.gradle b/Apps/Playground/android/build.gradle index 46d1d9802..a2c0590dd 100644 --- a/Apps/Playground/android/build.gradle +++ b/Apps/Playground/android/build.gradle @@ -6,7 +6,7 @@ buildscript { minSdkVersion = 18 compileSdkVersion = 28 targetSdkVersion = 28 - ndkVersion = "21.0.6113669" + ndkVersion = "21.3.6528147" } repositories { google() diff --git a/Apps/Playground/node_modules/@babylonjs/react-native/README.md b/Apps/Playground/node_modules/@babylonjs/react-native/README.md index 9ad759ca9..14284384a 100644 --- a/Apps/Playground/node_modules/@babylonjs/react-native/README.md +++ b/Apps/Playground/node_modules/@babylonjs/react-native/README.md @@ -22,15 +22,6 @@ The minimum Android SDK version is 18. This must be set as `minSdkVersion` in th The minimum deployment target version is 12. This must be set as `iOS Deployment Target` in the consuming project's `project.pbxproj`, and must also be set as `platform` in the consuming project's `podfile`. -Additionally, there are currently a few manual steps required (work is planned to eliminate these): -1. From the Mac terminal (not PowerShell), starting at the React Native project root, run the following commands. This needs to be done on every developer/build machine after installing node modules. -``` -cd node_modules/@babylonjs/react-native/ios -cmake -G Xcode -DCMAKE_TOOLCHAIN_FILE=../submodules/BabylonNative/Dependencies/ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64COMBINED -DENABLE_ARC=0 -DDEPLOYMENT_TARGET=12 -DENABLE_GLSLANG_BINARIES=OFF -DSPIRV_CROSS_CLI=OFF . -``` - -2. Add the generated ReactNativeBabylon.xcodeproj to your projects XCode Workspace (`.xcworkspace`) file. This can be done within XCode, and this change can be committed to source control so it only has to be done once. - ### `useEngine` `useEngine` is a **custom React hook** that manages the lifecycle of a Babylon engine instance in the context of an owning React component. `useEngine` creates an engine instance **asynchronously** which is used to create and configure scenes. Typically scene initialization code should exist in a `useEffect` triggered by an `engine` state change. For example: @@ -72,9 +63,7 @@ const MyComponent: FunctionComponent = (props: MyComponentProp if (engine) { const scene = new Scene(engine); scene.createDefaultCamera(true); - if (scene.activeCamera) { - setCamera(scene.activeCamera); - } + setCamera(scene.activeCamera!); // Setup the scene! } }, [engine]); diff --git a/Apps/Playground/node_modules/@babylonjs/react-native/android/build.gradle b/Apps/Playground/node_modules/@babylonjs/react-native/android/build.gradle index edcde0bd3..e9ab43393 100644 --- a/Apps/Playground/node_modules/@babylonjs/react-native/android/build.gradle +++ b/Apps/Playground/node_modules/@babylonjs/react-native/android/build.gradle @@ -14,7 +14,7 @@ def DEFAULT_COMPILE_SDK_VERSION = 28 def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3' def DEFAULT_MIN_SDK_VERSION = 18 def DEFAULT_TARGET_SDK_VERSION = 28 -def DEFAULT_NDK_VERSION = '21.0.6113669' +def DEFAULT_NDK_VERSION = '21.3.6528147' def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback diff --git a/README.md b/README.md index 63b4ffc8f..4287f479c 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ pod install --repo-update ### **Configuring a Mac Dev Environment** -**Required Tools:** [Android Studio](https://developer.android.com/studio/) (including NDK 21.0.6113669), [CMake](https://cmake.org/), [Ninja](https://ninja-build.org/) +**Required Tools:** [Android Studio](https://developer.android.com/studio/) (including NDK 21.3.6528147), [CMake](https://cmake.org/), [Ninja](https://ninja-build.org/) - The `PATH` environment variable must include the path to adb (typically ~/Library/Android/sdk/platform-tools/). - The `PATH` environment variable must include the path to Ninja, or Ninja must be [installed via a package manager](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages). @@ -72,7 +72,7 @@ export ANDROID_AVD_HOME=~/.android/avd ### **Configuring a Windows Dev Environment** -**Required Tools:** [Android Studio](https://developer.android.com/studio/) (including NDK 21.0.6113669), [CMake](https://cmake.org/), [Ninja](https://ninja-build.org/) +**Required Tools:** [Android Studio](https://developer.android.com/studio/) (including NDK 21.3.6528147), [CMake](https://cmake.org/), [Ninja](https://ninja-build.org/) - The `PATH` environment variable must include the path to adb (typically %LOCALAPPDATA%/Android/sdk/platform-tools/). - The `PATH` environment variable must include the path to Ninja, or Ninja must be [installed via a package manager](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages).