Skip to content

Commit c4e99e3

Browse files
authored
Migrate to a monorepo (#2603)
1 parent 151e080 commit c4e99e3

File tree

2,405 files changed

+118777
-70264
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,405 files changed

+118777
-70264
lines changed

.github/actions/setup/action.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
4+
inputs:
5+
github_token:
6+
description: 'GitHub Token'
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Setup Node.js
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version-file: .nvmrc
16+
17+
- name: Cache dependencies
18+
id: yarn-cache
19+
uses: actions/cache@v3
20+
with:
21+
path: |
22+
**/node_modules
23+
.yarn/install-state.gz
24+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
25+
restore-keys: |
26+
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
27+
${{ runner.os }}-yarn-
28+
29+
- name: Install dependencies
30+
if: steps.yarn-cache.outputs.cache-hit != 'true'
31+
run: yarn install --immutable
32+
shell: bash
33+
34+
- name: Download Skia Binary Artifacts
35+
uses: dawidd6/action-download-artifact@v2
36+
with:
37+
workflow: "build-skia.yml"
38+
repo: shopify/react-native-skia
39+
path: packages/skia/artifacts
40+
branch: main
41+
42+
- name: Copy Artifacts to libs folder
43+
working-directory: packages/skia
44+
run: yarn workflow-copy-libs
45+
shell: bash
46+
47+
- name: Copy Skia Headers
48+
working-directory: packages/skia
49+
run: yarn copy-skia-headers
50+
shell: bash

.github/workflows/android-ubuntu.yml

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,24 @@ jobs:
1212
timeout-minutes: 55
1313
strategy:
1414
matrix:
15-
directory: [example]
15+
directory: [apps/paper] # , apps/fabric
1616
concurrency:
1717
group: android-ubuntu-${{ matrix.directory }}-${{ github.ref }}
1818
cancel-in-progress: true
1919
steps:
2020
- name: checkout
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v2
2222
with:
2323
submodules: recursive
24-
25-
- uses: actions/setup-node@v3
24+
- name: Setup
25+
uses: ./.github/actions/setup
2626
with:
27-
cache: 'yarn'
28-
cache-dependency-path: package/yarn.lock
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
2928

30-
- name: Set up JDK 11
29+
- name: Set up JDK 17
3130
uses: actions/setup-java@v1
3231
with:
33-
java-version: '11'
32+
java-version: '17'
3433

3534
- name: Install NDK
3635
uses: nttld/setup-ndk@v1
@@ -41,41 +40,16 @@ jobs:
4140
- name: Set ANDROID_NDK
4241
run: echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV
4342

44-
- name: Install Package
45-
working-directory: package
46-
run: yarn
47-
48-
- name: Download Skia Binary Artifacts
49-
uses: dawidd6/action-download-artifact@v2
50-
with:
51-
workflow: "build-skia.yml"
52-
repo: shopify/react-native-skia
53-
path: package/artifacts
54-
branch: main
55-
56-
- name: Copy Artifacts to libs folder
57-
working-directory: package
58-
run: yarn workflow-copy-libs
59-
60-
- name: Copy Skia Headers
61-
working-directory: package
62-
run: yarn copy-skia-headers
63-
6443
- name: SDKs - accept licenses
6544
run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
6645

67-
# Install node dependencies in specified directories using matrix
68-
- name: Install app node dependencies
69-
working-directory: ${{ matrix.directory }}
70-
run: yarn
71-
7246
# Cache hermes build for both directories
7347
- name: Cache hermes build
7448
uses: actions/cache@v3
7549
env:
7650
cache-name: cache-rn-hermes-engine
7751
with:
78-
path: ${{ matrix.directory }}/node_modules/react-native
52+
path: node_modules/react-native
7953
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.directory }}-${{ hashFiles('**/react-native/package.json') }}
8054

8155
# Cache android libraries for both directories

.github/workflows/android.yml

Lines changed: 20 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,26 @@ jobs:
1111
runs-on: macos-12
1212
strategy:
1313
matrix:
14-
working-directory: [example, fabricexample]
14+
working-directory: [apps/paper]
1515
timeout-minutes: 55
1616
concurrency:
1717
group: android-example-${{ matrix.working-directory }}-${{ github.ref }}
1818
cancel-in-progress: true
1919
steps:
2020
- name: checkout
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v2
2222
with:
2323
submodules: recursive
2424

25-
- uses: actions/setup-node@v3
25+
- name: Setup
26+
uses: ./.github/actions/setup
2627
with:
27-
node-version: 16
28-
cache-dependency-path: package/yarn.lock
29-
cache: 'yarn'
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
3029

31-
- name: Set up JDK 11
30+
- name: Set up JDK 17
3231
uses: actions/setup-java@v1
3332
with:
34-
java-version: '11'
33+
java-version: '17'
3534

3635
- name: Install NDK
3736
uses: nttld/setup-ndk@v1
@@ -41,34 +40,10 @@ jobs:
4140

4241
- name: Set ANDROID_NDK
4342
run: echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV
44-
45-
- name: Install Package
46-
working-directory: package
47-
run: yarn install
48-
49-
- name: Download Skia Binary Artifacts
50-
uses: dawidd6/action-download-artifact@v2
51-
with:
52-
workflow: "build-skia.yml"
53-
repo: shopify/react-native-skia
54-
path: package/artifacts
55-
branch: main
56-
57-
- name: Copy Artifacts to libs folder
58-
working-directory: package
59-
run: yarn workflow-copy-libs
60-
61-
- name: Copy Skia Headers
62-
working-directory: package
63-
run: yarn copy-skia-headers
6443

6544
- name: SDKs - accept licenses
6645
run: y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
6746

68-
- name: Install example app node dependencies
69-
working-directory: ${{ matrix.working-directory }}
70-
run: yarn
71-
7247
- name: Cache hermes build
7348
uses: actions/cache@v3
7449
env:
@@ -101,7 +76,7 @@ jobs:
10176
runs-on: macos-12
10277
strategy:
10378
matrix:
104-
working-directory: [example, fabricexample]
79+
working-directory: [apps/paper]
10580
concurrency:
10681
group: android-example-${{ matrix.working-directory }}-${{ github.ref }}
10782
cancel-in-progress: true
@@ -111,15 +86,10 @@ jobs:
11186
with:
11287
submodules: recursive
11388

114-
- uses: actions/setup-node@v3
89+
- name: Setup
90+
uses: ./.github/actions/setup
11591
with:
116-
node-version: 16
117-
cache-dependency-path: package/yarn.lock
118-
cache: 'yarn'
119-
120-
- name: Install root dependencies
121-
working-directory: package
122-
run: yarn bootstrap
92+
github_token: ${{ secrets.GITHUB_TOKEN }}
12393

12494
- name: Restore APK
12595
id: cache-apk
@@ -141,9 +111,9 @@ jobs:
141111
run: adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
142112
timeout-minutes: 10
143113

144-
- name: Reverse TCP
145-
working-directory: ${{ matrix.working-directory }}
146-
run: yarn android-reverse-tcp
114+
# - name: Reverse TCP
115+
# working-directory: ${{ matrix.working-directory }}
116+
# run: yarn android-reverse-tcp
147117

148118
- name: Start Package Manager
149119
working-directory: ${{ matrix.working-directory }}
@@ -162,29 +132,29 @@ jobs:
162132
# run: echo "PACKAGE_NAME=${{ env.PACKAGE_NAME }}" >> $GITHUB_ENV
163133
- name: Launch APK
164134
env:
165-
PACKAGE_NAME: ${{ matrix.working-directory == 'fabricexample' && 'com.fabricexample' || 'com.rnskia' }}
135+
PACKAGE_NAME: ${{ matrix.working-directory == 'fabricexample' && 'com.fabricexample' || 'com.paper' }}
166136
run: adb shell monkey -p ${{ env.PACKAGE_NAME }} 1
167137

168138
# On fabric, the system fonts are slightly different
169139
# so wont run the paragraph tests there for now
170140
- name: Run e2e Tests
171-
working-directory: package
141+
working-directory: packages/skia
172142
run: |
173-
if [ "${{ matrix.working-directory }}" = "example" ]; then
143+
if [ "${{ matrix.working-directory }}" = "apps/paper" ]; then
174144
CI=true yarn e2e
175-
elif [ "${{ matrix.working-directory }}" = "fabricexample" ]; then
145+
elif [ "${{ matrix.working-directory }}" = "apps/none" ]; then
176146
CI=true yarn e2e --testPathIgnorePatterns Paragraphs
177147
fi
178148
179149
- uses: actions/upload-artifact@v2
180150
if: failure()
181151
with:
182-
path: package/src/__tests__/snapshots/
152+
path: packages/skia/src/__tests__/snapshots/
183153
name: ${{ matrix.working-directory }}-snapshots-screenshots
184154

185155
- uses: actions/upload-artifact@v2
186156
if: failure()
187157
with:
188-
path: docs/static
158+
path: apps/docs/static
189159
name: ${{ matrix.working-directory }}-docs-screenshots
190160

.github/workflows/build-npm.yml

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,18 @@ jobs:
1515
with:
1616
submodules: recursive
1717

18-
- uses: actions/setup-node@v3
18+
- name: checkout
19+
uses: actions/checkout@v2
1920
with:
20-
node-version: "lts/*"
21-
cache-dependency-path: package/yarn.lock
22-
cache: 'yarn'
23-
24-
- name: Install package dependencies
25-
working-directory: package
26-
run: yarn
21+
submodules: recursive
2722

28-
- name: Download Skia Binary Artifacts
29-
uses: dawidd6/action-download-artifact@v2
23+
- name: Setup
24+
uses: ./.github/actions/setup
3025
with:
31-
workflow: "build-skia.yml"
32-
path: package/artifacts
33-
branch: main
34-
35-
- name: Copy Artifacts to libs folder
36-
working-directory: package
37-
run: yarn workflow-copy-libs
38-
39-
- name: Copy Skia Headers
40-
working-directory: package
41-
run: yarn copy-skia-headers
26+
github_token: ${{ secrets.GITHUB_TOKEN }}
4227

4328
- name: Build NPM Package
44-
working-directory: package
29+
working-directory: packages/skia
4530
run: |
4631
yarn build
4732
npx semantic-release
@@ -50,12 +35,12 @@ jobs:
5035
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5136

5237
- name: Install & Build Docs
53-
run: cd package; yarn; cd ../docs; yarn; yarn build;
38+
run: cd apps/docs; yarn build;
5439

5540
- name: Deploy to GitHub Pages
5641
uses: peaceiris/actions-gh-pages@v3
5742
with:
5843
github_token: ${{ secrets.GITHUB_TOKEN }}
59-
publish_dir: ./docs/build
44+
publish_dir: ./apps/docs/build
6045
user_name: github-actions[bot]
6146
user_email: 41898282+github-actions[bot]@users.noreply.github.com

.github/workflows/docs.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on:
88
jobs:
99
build_and_deploy_docs:
1010
runs-on: ubuntu-latest
11-
env:
12-
WORKING_DIRECTORY: ./
1311
steps:
1412
- name: Checkout repository
1513
uses: actions/checkout@v2
@@ -21,20 +19,16 @@ jobs:
2119
with:
2220
cache: yarn
2321

24-
- name: Install dependencies
25-
working-directory: package
26-
run: yarn bootstrap
27-
2822
- name: Build Documentation
2923
run: |
30-
cd docs
24+
cd apps/docs
3125
yarn install
3226
yarn build
3327
3428
- name: Deploy to GitHub Pages
3529
uses: peaceiris/actions-gh-pages@v3
3630
with:
3731
github_token: ${{ secrets.GITHUB_TOKEN }}
38-
publish_dir: ./docs/build
32+
publish_dir: ./apps/docs/build
3933
user_name: github-actions[bot]
4034
user_email: 41898282+github-actions[bot]@users.noreply.github.com

0 commit comments

Comments
 (0)