Skip to content

Commit 708121f

Browse files
author
jikang.wu
committed
feat: update release workflow
0 parents  commit 708121f

File tree

102 files changed

+34654
-0
lines changed

Some content is hidden

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

102 files changed

+34654
-0
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
indent_style = space
10+
indent_size = 2
11+
12+
end_of_line = lf
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pbxproj -text
2+
# specific for windows script files
3+
*.bat text eol=crlf

.github/actions/setup/action.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Node.js
8+
uses: actions/setup-node@v3
9+
with:
10+
node-version-file: .nvmrc
11+
12+
- name: Cache dependencies
13+
id: yarn-cache
14+
uses: actions/cache@v3
15+
with:
16+
path: |
17+
**/node_modules
18+
.yarn/install-state.gz
19+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
20+
restore-keys: |
21+
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
22+
${{ runner.os }}-yarn-
23+
24+
- name: Install dependencies
25+
if: steps.yarn-cache.outputs.cache-hit != 'true'
26+
run: yarn install --immutable
27+
shell: bash

.github/workflows/ci.yml

+151
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Setup
18+
uses: ./.github/actions/setup
19+
20+
- name: Lint files
21+
run: yarn lint
22+
23+
- name: Typecheck files
24+
run: yarn typecheck
25+
26+
test:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v3
31+
32+
- name: Setup
33+
uses: ./.github/actions/setup
34+
35+
- name: Run unit tests
36+
run: yarn test --maxWorkers=2 --coverage
37+
38+
build-library:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v3
43+
44+
- name: Setup
45+
uses: ./.github/actions/setup
46+
47+
- name: Build package
48+
run: yarn prepare
49+
50+
build-android:
51+
runs-on: ubuntu-latest
52+
env:
53+
TURBO_CACHE_DIR: .turbo/android
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v3
57+
58+
- name: Setup
59+
uses: ./.github/actions/setup
60+
61+
- name: Cache turborepo for Android
62+
uses: actions/cache@v3
63+
with:
64+
path: ${{ env.TURBO_CACHE_DIR }}
65+
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('**/yarn.lock') }}
66+
restore-keys: |
67+
${{ runner.os }}-turborepo-android-
68+
69+
- name: Check turborepo cache for Android
70+
run: |
71+
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
72+
73+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
74+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
75+
fi
76+
77+
- name: Install JDK
78+
if: env.turbo_cache_hit != 1
79+
uses: actions/setup-java@v3
80+
with:
81+
distribution: 'zulu'
82+
java-version: '11'
83+
84+
- name: Finalize Android SDK
85+
if: env.turbo_cache_hit != 1
86+
run: |
87+
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
88+
89+
- name: Cache Gradle
90+
if: env.turbo_cache_hit != 1
91+
uses: actions/cache@v3
92+
with:
93+
path: |
94+
~/.gradle/wrapper
95+
~/.gradle/caches
96+
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
97+
restore-keys: |
98+
${{ runner.os }}-gradle-
99+
100+
- name: Build example for Android
101+
run: |
102+
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
103+
104+
build-ios:
105+
runs-on: macos-latest
106+
env:
107+
TURBO_CACHE_DIR: .turbo/ios
108+
steps:
109+
- name: Checkout
110+
uses: actions/checkout@v3
111+
112+
- name: Setup
113+
uses: ./.github/actions/setup
114+
115+
- name: Cache turborepo for iOS
116+
uses: actions/cache@v3
117+
with:
118+
path: ${{ env.TURBO_CACHE_DIR }}
119+
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('**/yarn.lock') }}
120+
restore-keys: |
121+
${{ runner.os }}-turborepo-ios-
122+
123+
- name: Check turborepo cache for iOS
124+
run: |
125+
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
126+
127+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
128+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
129+
fi
130+
131+
- name: Cache cocoapods
132+
if: env.turbo_cache_hit != 1
133+
id: cocoapods-cache
134+
uses: actions/cache@v3
135+
with:
136+
path: |
137+
**/ios/Pods
138+
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
139+
restore-keys: |
140+
${{ runner.os }}-cocoapods-
141+
142+
- name: Install cocoapods
143+
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
144+
run: |
145+
yarn pod-install example/ios
146+
env:
147+
NO_FLIPPER: 1
148+
149+
- name: Build example for iOS
150+
run: |
151+
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"

.gitignore

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# XDE
6+
.expo/
7+
8+
# VSCode
9+
.vscode/
10+
jsconfig.json
11+
12+
# Xcode
13+
#
14+
build/
15+
*.pbxuser
16+
!default.pbxuser
17+
*.mode1v3
18+
!default.mode1v3
19+
*.mode2v3
20+
!default.mode2v3
21+
*.perspectivev3
22+
!default.perspectivev3
23+
xcuserdata
24+
*.xccheckout
25+
*.moved-aside
26+
DerivedData
27+
*.hmap
28+
*.ipa
29+
*.xcuserstate
30+
project.xcworkspace
31+
32+
# Android/IJ
33+
#
34+
.classpath
35+
.cxx
36+
.gradle
37+
.idea
38+
.project
39+
.settings
40+
local.properties
41+
android.iml
42+
43+
# Cocoapods
44+
#
45+
example/ios/Pods
46+
47+
# Ruby
48+
example/vendor/
49+
50+
# node.js
51+
#
52+
node_modules/
53+
npm-debug.log
54+
yarn-debug.log
55+
yarn-error.log
56+
57+
# BUCK
58+
buck-out/
59+
\.buckd/
60+
android/app/libs
61+
android/keystores/debug.keystore
62+
63+
# Yarn
64+
.yarn/*
65+
.yarn
66+
!.yarn/patches
67+
!.yarn/plugins
68+
!.yarn/releases
69+
!.yarn/sdks
70+
!.yarn/versions
71+
72+
# Expo
73+
.expo/
74+
75+
# Turborepo
76+
.turbo/
77+
78+
# generated by bob
79+
lib/

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18

.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.yarnrc.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
nodeLinker: node-modules
2+
nmHoistingLimits: workspaces
3+
4+
plugins:
5+
- path: scripts/pod-install.cjs
6+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
7+
spec: "@yarnpkg/plugin-interactive-tools"
8+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
9+
spec: "@yarnpkg/plugin-workspace-tools"
10+
11+
yarnPath: .yarn/releases/yarn-3.6.1.cjs

0 commit comments

Comments
 (0)