-
Notifications
You must be signed in to change notification settings - Fork 467
181 lines (177 loc) · 5.31 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
review:
name: Review
runs-on: ubuntu-latest
strategy:
matrix:
test-name: [lint, ts]
workspace: [default-storage-backend, api]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 18.16.1
cache: yarn
- name: Install JS dependencies
run: yarn
- name: Run test ${{ matrix.test-name }}
run: yarn test:${{ matrix.test-name }}
working-directory: packages/${{ matrix.workspace }}
android:
name: Android
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 18.16.1
cache: yarn
- name: Install JS dependencies
run: |
yarn
- name: Test Next Storage
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
arguments: react-native-async-storage_async-storage:test
build-root-directory: packages/default-storage-backend/example/android
- name: Build e2e binary
run: |
yarn build:e2e:android
working-directory: packages/default-storage-backend
ios:
name: iOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache /.ccache
uses: actions/cache@v3
with:
path: packages/default-storage-backend/.ccache
key: ccache-ios-${{ hashFiles('yarn.lock') }}
restore-keys: ccache-ios-
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 18.16.1
cache: yarn
- name: Install JS dependencies
run: |
yarn
- name: Bundle JS
run: |
yarn bundle:ios
working-directory: packages/default-storage-backend
- name: Install Pods
run: |
RCT_NEW_ARCH_ENABLED=1 pod install
working-directory: packages/default-storage-backend/example/ios
- name: Build e2e binary
run: |
yarn build:e2e:ios
working-directory: packages/default-storage-backend
macos:
name: macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache /.ccache
uses: actions/cache@v3
with:
path: packages/default-storage-backend/.ccache
key: ccache-macos-${{ hashFiles('yarn.lock') }}
restore-keys: ccache-macos-
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 18.16.1
cache: yarn
- name: Install JS dependencies
run: |
yarn
- name: Bundle JS
run: |
yarn bundle:macos
working-directory: packages/default-storage-backend
- name: Install Pods
run: |
RCT_NEW_ARCH_ENABLED=1 pod install
working-directory: packages/default-storage-backend/example/macos
- name: Build
run: |
yarn build:e2e:macos
working-directory: packages/default-storage-backend
- name: Test
if: false
run: |
yarn test:e2e:macos
working-directory: packages/default-storage-backend
windows:
name: Windows
runs-on: windows-2022
steps:
- name: Set up MSBuild
uses: microsoft/[email protected]
- name: Setup VSTest.console.exe
uses: darenm/[email protected]
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 18.16.1
cache: yarn
- name: Install JS dependencies
run: |
yarn
- name: Install Windows test app
run: |
yarn install-windows-test-app -p example/windows
working-directory: packages/default-storage-backend
- name: Build
run: |
yarn react-native run-windows --release --arch x64 --logging --no-packager --no-launch --no-deploy --msbuildprops "BundleEntryFile=index.ts" --no-telemetry
working-directory: packages/default-storage-backend
release:
name: Release
needs: [review, android, ios, macos, windows]
if: github.event_name == 'push'
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: 18.16.1
cache: yarn
- name: Install JS dependencies
run: |
yarn
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
GIT_AUTHOR_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
GIT_AUTHOR_NAME : ${{ secrets.GH_BOT_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GH_BOT_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GH_BOT_NAME }}
NPM_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }}
run: |
git config user.email ${{ secrets.GH_BOT_EMAIL }}
git config user.name ${{ secrets.GH_BOT_NAME }}
yarn semantic-release
working-directory: packages/default-storage-backend