Skip to content

Commit 2f730da

Browse files
authored
PR builds and binary package builds for releases (#45)
The main change here is to update publish.yml to now prep the environment for building source code, and then actually building the source using gulp, and finally publishing the binary package (instead of the source package). I've already created a release to test the full flow and the created package (https://www.npmjs.com/package/@babylonjs/react-native). I have one more package being built and published now, which updates the README.md to remove the steps that are no longer needed since the source is pre-compiled. - Update publish.yml to install Ninja, do a Yarn install on the Playground app (since we build it to produce the libBabylonNative.so files for Android), do a NPM install in the Package directory (to install a few tools and libraries needed for the Gulp build), then actually run the Gulp build, and finally publish the pre-compiled package instead of the source package. - Update the build.gradle files to switch to a different version of the NDK which is pre-installed on GitHub build agents (and update the associated documentation). - Update the package README.md to remove the steps that are no longer necessary with the pre-compiled package. Additionally, since building the code is now relatively trivial, I am also adding pr.yml to facilitate gated PR builds. This duplicates steps from publish.yml as there doesn't seem to be any way to share a set of steps across jobs with GitHub Actions/Workflows, but the steps are really simple so meh.
1 parent 4bbfb84 commit 2f730da

File tree

6 files changed

+64
-22
lines changed

6 files changed

+64
-22
lines changed

.github/workflows/pr.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: PR Build
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
7+
jobs:
8+
build-android:
9+
runs-on: macos-latest
10+
steps:
11+
- name: Checkout Repo
12+
uses: actions/[email protected]
13+
with:
14+
submodules: 'recursive'
15+
- name: Setup Ninja
16+
run: brew install ninja
17+
- name: Yarn Install (Playground)
18+
run: yarn install
19+
working-directory: ./Apps/Playground
20+
- name: NPM Install (Binary Package)
21+
run: npm install
22+
working-directory: ./Package
23+
- name: Gulp (Android)
24+
run: npx gulp buildAndroid
25+
working-directory: ./Package
26+
27+
build-iOS:
28+
runs-on: macos-latest
29+
steps:
30+
- name: Checkout Repo
31+
uses: actions/[email protected]
32+
with:
33+
submodules: 'recursive'
34+
- name: Yarn Install (Playground)
35+
run: yarn install
36+
working-directory: ./Apps/Playground
37+
- name: NPM Install (Binary Package)
38+
run: npm install
39+
working-directory: ./Package
40+
- name: Gulp (iOS)
41+
run: npx gulp buildIOS
42+
working-directory: ./Package

.github/workflows/publish.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,25 @@ on:
55

66
jobs:
77
build:
8-
runs-on: ubuntu-latest
8+
runs-on: macos-latest
99
steps:
1010
- name: Checkout Repo
11-
uses: actions/[email protected]
12-
- name: Checkout Submodules
13-
uses: textbook/[email protected]
11+
uses: actions/[email protected]
12+
with:
13+
submodules: 'recursive'
14+
- name: Setup Ninja
15+
run: brew install ninja
16+
- name: Yarn Install (Playground)
17+
run: yarn install
18+
working-directory: ./Apps/Playground
19+
- name: NPM Install (Binary Package)
20+
run: npm install
21+
working-directory: ./Package
22+
- name: Gulp
23+
run: npx gulp
24+
working-directory: ./Package
1425
- name: Setup Node.js
15-
uses: actions/setup-node@v1.4.2
26+
uses: actions/setup-node@v2.1.0
1627
with:
1728
node-version: '12.x'
1829
registry-url: 'https://registry.npmjs.org'
@@ -21,6 +32,6 @@ jobs:
2132
run: |
2233
npm version --no-git-tag-version ${GITHUB_REF/refs\/tags\//}
2334
npm publish --access public
24-
working-directory: ./Apps/Playground/node_modules/@babylonjs/react-native
35+
working-directory: ./Package/Assembled
2536
env:
2637
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Apps/Playground/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
minSdkVersion = 18
77
compileSdkVersion = 28
88
targetSdkVersion = 28
9-
ndkVersion = "21.0.6113669"
9+
ndkVersion = "21.3.6528147"
1010
}
1111
repositories {
1212
google()

Apps/Playground/node_modules/@babylonjs/react-native/README.md

Lines changed: 1 addition & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Apps/Playground/node_modules/@babylonjs/react-native/android/build.gradle

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pod install --repo-update
5252

5353
### **Configuring a Mac Dev Environment**
5454

55-
**Required Tools:** [Android Studio](https://developer.android.com/studio/) (including NDK 21.0.6113669), [CMake](https://cmake.org/), [Ninja](https://ninja-build.org/)
55+
**Required Tools:** [Android Studio](https://developer.android.com/studio/) (including NDK 21.3.6528147), [CMake](https://cmake.org/), [Ninja](https://ninja-build.org/)
5656

5757
- The `PATH` environment variable must include the path to adb (typically ~/Library/Android/sdk/platform-tools/).
5858
- 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
7272

7373
### **Configuring a Windows Dev Environment**
7474

75-
**Required Tools:** [Android Studio](https://developer.android.com/studio/) (including NDK 21.0.6113669), [CMake](https://cmake.org/), [Ninja](https://ninja-build.org/)
75+
**Required Tools:** [Android Studio](https://developer.android.com/studio/) (including NDK 21.3.6528147), [CMake](https://cmake.org/), [Ninja](https://ninja-build.org/)
7676

7777
- The `PATH` environment variable must include the path to adb (typically %LOCALAPPDATA%/Android/sdk/platform-tools/).
7878
- 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).

0 commit comments

Comments
 (0)