react-native-nami-sdk 3.3.0-beta.22 → 3.3.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +3 -0
- package/.eslintrc.js +52 -0
- package/.github/workflows/CI.yaml +341 -0
- package/.github/workflows/app_prod.yaml +387 -0
- package/.github/workflows/app_stg.yaml +398 -0
- package/.github/workflows/build.yml +70 -0
- package/.pre-commit-config.yaml +24 -0
- package/.prettierrc.js +7 -0
- package/README.md +9 -9
- package/android/README.md +2 -3
- package/android/build.gradle +19 -27
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradlew +0 -0
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/nami/reactlibrary/Constants.kt +3 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgeModule.kt +141 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgePackage.java +51 -0
- package/android/src/main/java/com/{namiml/reactnative → nami/reactlibrary}/NamiCampaignManagerBridge.kt +33 -25
- package/android/src/main/java/com/{namiml/reactnative → nami/reactlibrary}/NamiCustomerManagerBridge.kt +6 -14
- package/android/src/main/java/com/{namiml/reactnative/NamiEntitlementManagerBridge.kt → nami/reactlibrary/NamiEntitlementManagerBridgeModule.kt} +8 -18
- package/android/src/main/java/com/nami/reactlibrary/NamiFlowManagerBridge.kt +58 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiMLManagerBridgeModule.kt +58 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiManagerBridge.kt +26 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiPaywallManagerBridgeModule.kt +258 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiPurchaseManagerBridge.kt +108 -0
- package/android/src/main/java/com/{namiml/reactnative → nami/reactlibrary}/NamiUtil.kt +23 -26
- package/build-utils/get_version_code.py +140 -0
- package/build-utils/preflight.py +46 -0
- package/{dist/index.d.ts → index.d.ts} +2 -0
- package/index.ts +2 -0
- package/ios/Nami.m +88 -8
- package/ios/NamiCampaignManagerBridge.m +3 -3
- package/ios/NamiCampaignManagerBridge.swift +61 -49
- package/ios/NamiCustomerManager.m +2 -2
- package/ios/NamiCustomerManager.swift +3 -13
- package/ios/NamiEntitlementManagerBridge.m +3 -2
- package/ios/NamiEntitlementManagerBridge.swift +39 -48
- package/ios/NamiFlowManagerBridge.m +2 -2
- package/ios/NamiFlowManagerBridge.swift +6 -10
- package/ios/NamiMLManagerBridge.m +93 -0
- package/ios/NamiManager.m +18 -0
- package/ios/NamiManager.swift +30 -0
- package/ios/NamiPaywallManagerBridge.m +3 -3
- package/ios/NamiPaywallManagerBridge.swift +6 -16
- package/ios/NamiPurchaseManagerBridge.m +2 -3
- package/ios/NamiPurchaseManagerBridge.swift +10 -15
- package/ios/RNNami-Bridging-Header.h +3 -1
- package/ios/RNNami.h +10 -0
- package/ios/RNNami.m +13 -0
- package/package.json +8 -20
- package/react-native-nami-sdk.podspec +2 -10
- package/src/Nami.d.ts +8 -0
- package/src/Nami.ts +18 -28
- package/src/NamiCampaignManager.d.ts +18 -0
- package/src/NamiCampaignManager.ts +53 -57
- package/{dist/src → src}/NamiCustomerManager.d.ts +13 -11
- package/src/NamiCustomerManager.ts +81 -55
- package/src/NamiEntitlementManager.d.ts +15 -0
- package/src/NamiEntitlementManager.ts +36 -49
- package/src/NamiFlowManager.d.ts +32 -0
- package/src/NamiFlowManager.ts +45 -35
- package/src/NamiMLManager.d.ts +7 -0
- package/src/NamiMLManager.ts +13 -0
- package/src/NamiManager.d.ts +5 -0
- package/src/NamiManager.ts +14 -0
- package/src/NamiPaywallManager.d.ts +34 -0
- package/src/NamiPaywallManager.ts +139 -84
- package/src/NamiPurchaseManager.d.ts +20 -0
- package/src/NamiPurchaseManager.ts +70 -69
- package/{dist/src → src}/types.d.ts +6 -35
- package/src/types.ts +7 -39
- package/tsconfig.json +22 -24
- package/.prettierrc +0 -4
- package/android/src/main/java/com/namiml/reactnative/Constants.kt +0 -3
- package/android/src/main/java/com/namiml/reactnative/NamiBridgeModule.kt +0 -91
- package/android/src/main/java/com/namiml/reactnative/NamiBridgePackage.java +0 -140
- package/android/src/main/java/com/namiml/reactnative/NamiFlowManagerBridge.kt +0 -67
- package/android/src/main/java/com/namiml/reactnative/NamiPaywallManagerBridgeModule.kt +0 -196
- package/android/src/main/java/com/namiml/reactnative/NamiPurchaseManagerBridge.kt +0 -114
- package/dist/specs/NativeNami.d.ts +0 -15
- package/dist/specs/NativeNamiCampaignManager.d.ts +0 -82
- package/dist/specs/NativeNamiCustomerManager.d.ts +0 -29
- package/dist/specs/NativeNamiEntitlementManager.d.ts +0 -45
- package/dist/specs/NativeNamiFlowManager.d.ts +0 -8
- package/dist/specs/NativeNamiPaywallManager.d.ts +0 -71
- package/dist/specs/NativeNamiPurchaseManager.d.ts +0 -28
- package/dist/src/Nami.d.ts +0 -5
- package/dist/src/NamiCampaignManager.d.ts +0 -29
- package/dist/src/NamiEntitlementManager.d.ts +0 -13
- package/dist/src/NamiFlowManager.d.ts +0 -11
- package/dist/src/NamiPaywallManager.d.ts +0 -30
- package/dist/src/NamiPurchaseManager.d.ts +0 -17
- package/dist/src/transformers.d.ts +0 -3
- package/dist/src/version.d.ts +0 -5
- package/ios/Nami.swift +0 -85
- package/react-native-config.js +0 -9
- package/scripts/generate-version.ts +0 -18
- package/specs/NativeNami.ts +0 -16
- package/specs/NativeNamiCampaignManager.ts +0 -94
- package/specs/NativeNamiCustomerManager.ts +0 -37
- package/specs/NativeNamiEntitlementManager.ts +0 -54
- package/specs/NativeNamiFlowManager.ts +0 -12
- package/specs/NativeNamiPaywallManager.ts +0 -85
- package/specs/NativeNamiPurchaseManager.ts +0 -33
- package/src/transformers.ts +0 -21
- package/src/version.ts +0 -5
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
extends: '@react-native-community',
|
|
4
|
+
parser: '@typescript-eslint/parser',
|
|
5
|
+
plugins: ['@typescript-eslint'],
|
|
6
|
+
parserOptions: {
|
|
7
|
+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
|
|
8
|
+
sourceType: 'module', // Allows for the use of imports
|
|
9
|
+
ecmaFeatures: {
|
|
10
|
+
jsx: true, // Allows for the parsing of JSX
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
'react/no-unstable-nested-components': [
|
|
15
|
+
'off' | 'warn' | 'error',
|
|
16
|
+
{ allowAsProps: true | false },
|
|
17
|
+
],
|
|
18
|
+
'prettier/prettier': [
|
|
19
|
+
'error',
|
|
20
|
+
{
|
|
21
|
+
bracketSpacing: true,
|
|
22
|
+
jsxBracketSameLine: true,
|
|
23
|
+
singleQuote: true,
|
|
24
|
+
trailingComma: 'all',
|
|
25
|
+
arrowParens: 'avoid',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
quotes: ['error', 'single'],
|
|
29
|
+
indent: ['error', 2, { SwitchCase: 1 }],
|
|
30
|
+
'comma-dangle': [2, 'always-multiline'],
|
|
31
|
+
'react/prop-types': 'off',
|
|
32
|
+
'@typescript-eslint/no-namespace': 'off',
|
|
33
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
34
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
|
35
|
+
'@typescript-eslint/interface-name-prefix': 'off',
|
|
36
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
37
|
+
'@typescript-eslint/no-unused-vars': [
|
|
38
|
+
2,
|
|
39
|
+
{ args: 'none', ignoreRestSiblings: true },
|
|
40
|
+
],
|
|
41
|
+
'@typescript-eslint/no-use-before-define': ['error', { variables: false }],
|
|
42
|
+
'react/jsx-first-prop-new-line': [1, 'multiline'],
|
|
43
|
+
'react/jsx-max-props-per-line': [
|
|
44
|
+
1,
|
|
45
|
+
{
|
|
46
|
+
maximum: 1,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
'no-unused-vars': 'off',
|
|
50
|
+
'object-curly-spacing': ['error', 'always'],
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
name: CI PR Checks
|
|
2
|
+
env:
|
|
3
|
+
DEVELOPER_DIR: /Applications/Xcode_16.0.0.app/Contents/Developer
|
|
4
|
+
on: pull_request
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
eslint:
|
|
8
|
+
name: ESLint
|
|
9
|
+
permissions:
|
|
10
|
+
actions: write
|
|
11
|
+
contents: write
|
|
12
|
+
id-token: write
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/setup-node@v3
|
|
16
|
+
with:
|
|
17
|
+
node-version: "18"
|
|
18
|
+
|
|
19
|
+
- name: 'Checkout ${{ inputs.ref }}'
|
|
20
|
+
uses: actions/checkout@v3
|
|
21
|
+
with:
|
|
22
|
+
path: source
|
|
23
|
+
ref: '${{ inputs.ref }}'
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: yarn --frozen-lockfile --prefer-offline
|
|
27
|
+
working-directory: source/
|
|
28
|
+
|
|
29
|
+
- name: Linter
|
|
30
|
+
run: |
|
|
31
|
+
npx eslint . --ext .js,.jsx,.ts,.tsx
|
|
32
|
+
working-directory: source/
|
|
33
|
+
tsc:
|
|
34
|
+
name: Generate Declaration Files
|
|
35
|
+
permissions:
|
|
36
|
+
actions: write
|
|
37
|
+
contents: write
|
|
38
|
+
id-token: write
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/setup-node@v3
|
|
42
|
+
with:
|
|
43
|
+
node-version: "18"
|
|
44
|
+
|
|
45
|
+
- name: 'Checkout ${{ inputs.ref }}'
|
|
46
|
+
uses: actions/checkout@v3
|
|
47
|
+
with:
|
|
48
|
+
path: source
|
|
49
|
+
ref: '${{ inputs.ref }}'
|
|
50
|
+
|
|
51
|
+
- name: Install dependencies
|
|
52
|
+
run: yarn --frozen-lockfile --prefer-offline
|
|
53
|
+
working-directory: source/
|
|
54
|
+
|
|
55
|
+
- name: Generate .d files
|
|
56
|
+
run: |
|
|
57
|
+
npx tsc
|
|
58
|
+
working-directory: source/
|
|
59
|
+
eslintapps:
|
|
60
|
+
name: ESLint Sample Apps
|
|
61
|
+
permissions:
|
|
62
|
+
actions: write
|
|
63
|
+
contents: write
|
|
64
|
+
id-token: write
|
|
65
|
+
runs-on: ubuntu-latest
|
|
66
|
+
steps:
|
|
67
|
+
- uses: actions/setup-node@v3
|
|
68
|
+
with:
|
|
69
|
+
node-version: "18"
|
|
70
|
+
|
|
71
|
+
- name: 'Checkout ${{ inputs.ref }}'
|
|
72
|
+
uses: actions/checkout@v3
|
|
73
|
+
with:
|
|
74
|
+
path: source
|
|
75
|
+
ref: '${{ inputs.ref }}'
|
|
76
|
+
|
|
77
|
+
- name: Install Basic app dependencies
|
|
78
|
+
run: yarn --frozen-lockfile --prefer-offline
|
|
79
|
+
working-directory: source/examples/Basic
|
|
80
|
+
|
|
81
|
+
- name: Linter Basic
|
|
82
|
+
run: |
|
|
83
|
+
npx eslint . --ext .js,.jsx,.ts,.tsx
|
|
84
|
+
working-directory: source/examples/Basic
|
|
85
|
+
|
|
86
|
+
- name: Install TestNamiTV app dependencies
|
|
87
|
+
run: yarn --frozen-lockfile --prefer-offline
|
|
88
|
+
working-directory: source/examples/TestNamiTV
|
|
89
|
+
|
|
90
|
+
- name: Linter TestNamiTV
|
|
91
|
+
run: |
|
|
92
|
+
npx eslint . --ext .js,.jsx,.ts,.tsx
|
|
93
|
+
working-directory: source/examples/TestNamiTV
|
|
94
|
+
e2e-ios:
|
|
95
|
+
runs-on: macos-15
|
|
96
|
+
env:
|
|
97
|
+
DETOX_CONFIGURATION: ios.sim.release
|
|
98
|
+
|
|
99
|
+
steps:
|
|
100
|
+
- uses: actions/setup-node@v3
|
|
101
|
+
with:
|
|
102
|
+
node-version: 18
|
|
103
|
+
|
|
104
|
+
- name: 'Checkout ${{ inputs.ref }}'
|
|
105
|
+
uses: actions/checkout@v3
|
|
106
|
+
with:
|
|
107
|
+
path: source
|
|
108
|
+
ref: '${{ inputs.ref }}'
|
|
109
|
+
|
|
110
|
+
- name: Cache node_modules
|
|
111
|
+
uses: actions/cache@v3
|
|
112
|
+
id: cache
|
|
113
|
+
with:
|
|
114
|
+
path: source/examples/Basic/node_modules
|
|
115
|
+
key: node-modules-${{ hashFiles('**/yarn.lock') }}
|
|
116
|
+
|
|
117
|
+
- name: Install Yarn Dependencies
|
|
118
|
+
run: yarn install
|
|
119
|
+
working-directory: source/examples/Basic
|
|
120
|
+
|
|
121
|
+
- name: Install macOS dependencies
|
|
122
|
+
run: |
|
|
123
|
+
brew tap wix/brew
|
|
124
|
+
brew install applesimutils
|
|
125
|
+
sudo gem install cocoapods
|
|
126
|
+
gem install CFPropertyList
|
|
127
|
+
env:
|
|
128
|
+
# Speed up build could be updated 0/1 for full install
|
|
129
|
+
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
130
|
+
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
|
131
|
+
|
|
132
|
+
- name: Update App Platform ID
|
|
133
|
+
working-directory: source/examples/Basic/config/
|
|
134
|
+
run: |
|
|
135
|
+
sed -i '' -e "s/APPLE_PROD_APP_PLATFORM_ID/$BASIC_APPLE_PROD_APP_PLATFORM_ID/" index.ts
|
|
136
|
+
env:
|
|
137
|
+
BASIC_APPLE_PROD_APP_PLATFORM_ID: '${{ secrets.APPLE_PROD_APP_PLATFORM_ID }}'
|
|
138
|
+
|
|
139
|
+
# - name: Cache Pods
|
|
140
|
+
# uses: actions/cache@v3
|
|
141
|
+
# id: podcache
|
|
142
|
+
# with:
|
|
143
|
+
# path: source/examples/Basic/ios
|
|
144
|
+
# key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
|
145
|
+
# restore-keys: |
|
|
146
|
+
# ${{ runner.os }}-pods-
|
|
147
|
+
|
|
148
|
+
- name: Clean node_modules tree
|
|
149
|
+
run: rm -rf node_modules/react-native-nami-sdk/examples
|
|
150
|
+
working-directory: source/examples/Basic
|
|
151
|
+
|
|
152
|
+
- name: Install iOS pods
|
|
153
|
+
run: RCT_NEW_ARCH_ENABLED=0 SWIFT_VERSION=5 pod install --repo-update
|
|
154
|
+
working-directory: source/examples/Basic/ios
|
|
155
|
+
|
|
156
|
+
- name: Rebuild cache detox
|
|
157
|
+
run: yarn detox rebuild-framework-cache
|
|
158
|
+
working-directory: source/examples/Basic
|
|
159
|
+
|
|
160
|
+
- name: Cache Detox build
|
|
161
|
+
id: cache-detox-build
|
|
162
|
+
uses: actions/cache@v3
|
|
163
|
+
with:
|
|
164
|
+
path: source/examples/Basic/ios/Pods
|
|
165
|
+
key: ${{ runner.os }}-detox-build
|
|
166
|
+
restore-keys: |
|
|
167
|
+
${{ runner.os }}-detox-build
|
|
168
|
+
|
|
169
|
+
- name: Detox build
|
|
170
|
+
run: yarn detox build --configuration ${{ env.DETOX_CONFIGURATION }}
|
|
171
|
+
working-directory: source/examples/Basic
|
|
172
|
+
|
|
173
|
+
- name: Detox test
|
|
174
|
+
run: |
|
|
175
|
+
export DETOX_SYNCHRONIZATION_DEBUG=1
|
|
176
|
+
yarn start &
|
|
177
|
+
METRO_BUNDLER_PID=$!
|
|
178
|
+
yarn detox test --configuration ${{ env.DETOX_CONFIGURATION }} e2e/ios --cleanup --headless --record-logs all --loglevel trace
|
|
179
|
+
DETOX_EXIT_CODE=$?
|
|
180
|
+
kill $METRO_BUNDLER_PID
|
|
181
|
+
exit $DETOX_EXIT_CODE
|
|
182
|
+
working-directory: source/examples/Basic
|
|
183
|
+
|
|
184
|
+
- name: Upload artifacts
|
|
185
|
+
if: failure()
|
|
186
|
+
uses: actions/upload-artifact@v4
|
|
187
|
+
with:
|
|
188
|
+
name: detox-artifacts
|
|
189
|
+
path: artifacts
|
|
190
|
+
e2e-android:
|
|
191
|
+
runs-on: ubuntu-latest
|
|
192
|
+
env:
|
|
193
|
+
DETOX_CONFIGURATION: android.emu.release
|
|
194
|
+
|
|
195
|
+
steps:
|
|
196
|
+
- name: Checkout repository
|
|
197
|
+
uses: actions/checkout@v3
|
|
198
|
+
with:
|
|
199
|
+
path: source
|
|
200
|
+
ref: '${{ inputs.ref }}'
|
|
201
|
+
|
|
202
|
+
- name: Setup Node.js
|
|
203
|
+
uses: actions/setup-node@v3
|
|
204
|
+
with:
|
|
205
|
+
node-version: "18"
|
|
206
|
+
|
|
207
|
+
- name: Cache node_modules
|
|
208
|
+
uses: actions/cache@v3
|
|
209
|
+
id: cache
|
|
210
|
+
with:
|
|
211
|
+
path: source/examples/Basic/node_modules
|
|
212
|
+
key: node-modules-${{ hashFiles('**/yarn.lock') }}
|
|
213
|
+
|
|
214
|
+
- name: Install Yarn dependencies
|
|
215
|
+
run: yarn install
|
|
216
|
+
working-directory: source/examples/Basic
|
|
217
|
+
|
|
218
|
+
- name: Setup Java
|
|
219
|
+
uses: actions/setup-java@v3
|
|
220
|
+
with:
|
|
221
|
+
cache: gradle
|
|
222
|
+
distribution: temurin
|
|
223
|
+
java-version: 17
|
|
224
|
+
|
|
225
|
+
- name: Update App Platform ID
|
|
226
|
+
working-directory: source/examples/Basic/config/
|
|
227
|
+
run: |
|
|
228
|
+
sed -i "s/ANDROID_PROD_APP_PLATFORM_ID/$BASIC_ANDROID_PROD_APP_PLATFORM_ID/" index.ts
|
|
229
|
+
#sed -i '' -e "s/ANDROID_PROD_APP_PLATFORM_ID/$BASIC_ANDROID_PROD_APP_PLATFORM_ID/" index.ts
|
|
230
|
+
env:
|
|
231
|
+
BASIC_ANDROID_PROD_APP_PLATFORM_ID: '${{ secrets.ANDROID_PROD_APP_PLATFORM_ID }}'
|
|
232
|
+
|
|
233
|
+
- name: Rebuild cache detox
|
|
234
|
+
run: yarn detox rebuild-framework-cache
|
|
235
|
+
working-directory: source/examples/Basic
|
|
236
|
+
|
|
237
|
+
- name: Cache Detox build
|
|
238
|
+
id: cache-detox-build
|
|
239
|
+
uses: actions/cache@v3
|
|
240
|
+
with:
|
|
241
|
+
path: source/examples/Basic/android/app/build
|
|
242
|
+
key: ${{ runner.os }}-detox-build
|
|
243
|
+
restore-keys: |
|
|
244
|
+
${{ runner.os }}-detox-build
|
|
245
|
+
|
|
246
|
+
- name: Detox build
|
|
247
|
+
run: |
|
|
248
|
+
rm -rf node_modules/react-native-nami-sdk/examples
|
|
249
|
+
yarn detox build --configuration ${{ env.DETOX_CONFIGURATION }}
|
|
250
|
+
working-directory: source/examples/Basic
|
|
251
|
+
|
|
252
|
+
- name: Create the Keystore
|
|
253
|
+
run: |
|
|
254
|
+
# import keystore from secrets
|
|
255
|
+
echo $KEYSTORE_BASE64 | base64 -d > $RUNNER_TEMP/my_production.keystore
|
|
256
|
+
env:
|
|
257
|
+
KEYSTORE_BASE64: '${{ secrets.KEY_STORE_BASE64 }}'
|
|
258
|
+
|
|
259
|
+
- name: Encode the keystore to base64
|
|
260
|
+
id: encode_keystore
|
|
261
|
+
run: |
|
|
262
|
+
echo "SIGNINGKEYBASE64=$(openssl base64 < $RUNNER_TEMP/my_production.keystore | tr -d '\n')" >> $GITHUB_ENV
|
|
263
|
+
|
|
264
|
+
- name: Sign APK
|
|
265
|
+
id: sign_apk
|
|
266
|
+
uses: r0adkll/sign-android-release@v1
|
|
267
|
+
with:
|
|
268
|
+
releaseDirectory: source/examples/Basic/android/app/build/outputs/apk/production/release
|
|
269
|
+
signingKeyBase64: ${{ env.SIGNINGKEYBASE64 }}
|
|
270
|
+
alias: ${{ secrets.KEY_ALIAS }}
|
|
271
|
+
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
272
|
+
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
|
273
|
+
env:
|
|
274
|
+
BUILD_TOOLS_VERSION: "34.0.0"
|
|
275
|
+
|
|
276
|
+
- name: Sign AndroidTest APK for Detox
|
|
277
|
+
id: sign_androidTest_apk
|
|
278
|
+
uses: r0adkll/sign-android-release@v1
|
|
279
|
+
with:
|
|
280
|
+
releaseDirectory: source/examples/Basic/android/app/build/outputs/apk/androidTest/production/release/
|
|
281
|
+
signingKeyBase64: ${{ env.SIGNINGKEYBASE64 }}
|
|
282
|
+
alias: ${{ secrets.KEY_ALIAS }}
|
|
283
|
+
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
284
|
+
keyPassword: ${{ secrets.KEY_PASSWORD }}
|
|
285
|
+
env:
|
|
286
|
+
BUILD_TOOLS_VERSION: "34.0.0"
|
|
287
|
+
|
|
288
|
+
- name: Get device name
|
|
289
|
+
id: device
|
|
290
|
+
run: node -e "console.log('AVD_NAME=' + require('./.detoxrc').devices.emulator.device.avdName)" >> $GITHUB_OUTPUT
|
|
291
|
+
working-directory: source/examples/Basic
|
|
292
|
+
|
|
293
|
+
# - name: Cache AVD snapshot
|
|
294
|
+
# uses: actions/cache@v3
|
|
295
|
+
# id: avd-cache
|
|
296
|
+
# with:
|
|
297
|
+
# path: |
|
|
298
|
+
# ~/.android/avd/*
|
|
299
|
+
# ~/.android/adb*
|
|
300
|
+
# key: avd-30-aosp-atd
|
|
301
|
+
#
|
|
302
|
+
# - name: Create AVD and generate snapshot for caching
|
|
303
|
+
# if: steps.avd-cache.outputs.cache-hit != 'true'
|
|
304
|
+
# uses: reactivecircus/android-emulator-runner@v2
|
|
305
|
+
# with:
|
|
306
|
+
# target: aosp_atd
|
|
307
|
+
# api-level: 30
|
|
308
|
+
# arch: x86
|
|
309
|
+
# channel: canary
|
|
310
|
+
# profile: pixel
|
|
311
|
+
# ram-size: 2048M
|
|
312
|
+
# heapSize: 576M
|
|
313
|
+
# # avd-name: ${{ steps.device.outputs.AVD_NAME }}
|
|
314
|
+
# avd-name: Pixel_3a_API_30_AOSP
|
|
315
|
+
# force-avd-creation: false
|
|
316
|
+
# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
|
317
|
+
# disable-animations: false
|
|
318
|
+
# script: echo "Generated AVD snapshot for caching"
|
|
319
|
+
# working-directory: source/examples/Basic
|
|
320
|
+
|
|
321
|
+
- name: Detox test
|
|
322
|
+
uses: reactivecircus/android-emulator-runner@v2
|
|
323
|
+
with:
|
|
324
|
+
target: aosp_atd
|
|
325
|
+
api-level: 30
|
|
326
|
+
arch: x86_64
|
|
327
|
+
disable-animations: true
|
|
328
|
+
ram-size: 4096
|
|
329
|
+
heap-size: 512
|
|
330
|
+
channel: canary
|
|
331
|
+
profile: pixel
|
|
332
|
+
avd-name: Pixel_4_API_34
|
|
333
|
+
script: yarn detox test --configuration ${{ env.DETOX_CONFIGURATION }} e2e/android --headless --record-logs all --loglevel trace
|
|
334
|
+
working-directory: source/examples/Basic
|
|
335
|
+
|
|
336
|
+
- name: Upload artifacts
|
|
337
|
+
if: failure()
|
|
338
|
+
uses: actions/upload-artifact@v4
|
|
339
|
+
with:
|
|
340
|
+
name: detox-artifacts
|
|
341
|
+
path: artifacts
|