Skip to content

Commit 70e003b

Browse files
authored
Build module on Ubuntu (#2021)
1 parent 245c59c commit 70e003b

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

.github/workflows/android-ubuntu.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Android Ubuntu
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
timeout-minutes: 55
9+
steps:
10+
- name: checkout
11+
uses: actions/checkout@v3
12+
with:
13+
submodules: recursive
14+
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 16
18+
cache: 'yarn'
19+
20+
- name: Set up JDK 11
21+
uses: actions/setup-java@v1
22+
with:
23+
java-version: '11'
24+
25+
- name: Install NDK
26+
uses: nttld/setup-ndk@v1
27+
id: setup-ndk
28+
with:
29+
ndk-version: r21d
30+
31+
- name: Set ANDROID_NDK
32+
run: echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV
33+
34+
- name: Install root node dependencies
35+
run: yarn
36+
37+
- name: Download Skia Binary Artifacts
38+
uses: dawidd6/action-download-artifact@v2
39+
with:
40+
workflow: "build-skia.yml"
41+
repo: shopify/react-native-skia
42+
path: artifacts
43+
44+
- name: Copy Artifacts to libs folder
45+
run: yarn workflow-copy-libs
46+
47+
- name: Copy Skia Headers
48+
run: yarn copy-skia-headers
49+
50+
- name: SDKs - accept licenses
51+
run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
52+
53+
- name: Install Package
54+
working-directory: package
55+
run: yarn install
56+
57+
- name: Install example app node dependencies
58+
working-directory: example
59+
run: yarn
60+
61+
- name: Cache hermes build
62+
uses: actions/cache@v3
63+
env:
64+
cache-name: cache-rn-hermes-engine
65+
with:
66+
path: example/node_modules/react-native
67+
key: ${{ runner.os }}-build-${{ env.cache-name }}-example-${{ hashFiles('**/react-native/package.json') }}
68+
69+
- name: Cache android libraries
70+
uses: actions/cache@v3
71+
env:
72+
cache-name: cache-rn
73+
with:
74+
path: example/android/app/build
75+
key: ${{ runner.os }}-build-${{ env.cache-name }}-example-${{ hashFiles('**/react-native/package.json') }}
76+
77+
- name: Build Android app
78+
working-directory: example/android
79+
run: ./gradlew assembleDebug
80+
81+
- name: Cache apk
82+
uses: actions/cache/save@v3
83+
env:
84+
cache-name: cache-apk
85+
with:
86+
path: example/android/app/build/outputs/apk/debug/app-debug.apk
87+
key: apk-${{ github.sha }}

0 commit comments

Comments
 (0)