react-native-nami-sdk 3.0.9 → 3.0.11
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 +2 -0
- package/.eslintrc.js +12 -0
- package/.github/workflows/CI.yaml +610 -0
- package/.github/workflows/app_prod.yaml +316 -0
- package/.github/workflows/app_stg.yaml +115 -2
- package/.pre-commit-config.yaml +0 -1
- package/android/build.gradle +4 -4
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgeModule.kt +5 -18
- package/android/src/main/java/com/nami/reactlibrary/NamiBridgePackage.java +0 -1
- package/android/src/main/java/com/nami/reactlibrary/NamiCampaignManagerBridge.kt +45 -27
- package/android/src/main/java/com/nami/reactlibrary/NamiCustomerManagerBridge.kt +26 -20
- package/android/src/main/java/com/nami/reactlibrary/NamiEntitlementManagerBridgeModule.kt +15 -12
- package/android/src/main/java/com/nami/reactlibrary/NamiMLManagerBridgeModule.kt +8 -0
- package/android/src/main/java/com/nami/reactlibrary/NamiPaywallManagerBridgeModule.kt +142 -95
- package/android/src/main/java/com/nami/reactlibrary/NamiPurchaseManagerBridge.kt +12 -14
- package/android/src/main/java/com/nami/reactlibrary/NamiUtil.kt +3 -47
- package/ios/Nami.m +3 -25
- package/ios/NamiCampaignManagerBridge.swift +13 -7
- package/ios/NamiCustomerManager.swift +26 -7
- package/ios/NamiEntitlementManagerBridge.swift +9 -1
- package/ios/NamiMLManagerBridge.m +0 -2
- package/ios/NamiPaywallManagerBridge.m +2 -59
- package/ios/NamiPaywallManagerBridge.swift +67 -58
- package/ios/NamiPurchaseManagerBridge.m +2 -98
- package/ios/NamiPurchaseManagerBridge.swift +45 -5
- package/ios/RNNami-Bridging-Header.h +0 -1
- package/ios/RNNami.xcodeproj/project.pbxproj +1 -62
- package/ios/RNNami.xcworkspace/contents.xcworkspacedata +0 -3
- package/package.json +15 -4
- package/react-native-nami-sdk.podspec +4 -2
- package/src/Nami.d.ts +0 -1
- package/src/NamiCustomerManager.js +2 -2
- package/src/NamiMLManager.d.ts +3 -3
- package/src/NamiMLManager.js +1 -1
- package/src/NamiPaywallManager.d.ts +11 -30
- package/src/NamiPaywallManager.js +13 -8
- package/src/NamiPurchaseManager.d.ts +7 -3
- package/src/types.ts +10 -3
- package/android/src/main/java/com/nami/reactlibrary/NamiEmitter.kt +0 -163
- package/ios/NamiBridgeUtil.h +0 -32
- package/ios/NamiBridgeUtil.m +0 -231
- package/ios/NamiEmitter.m +0 -350
- package/ios/Podfile +0 -71
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
extends: '@react-native-community',
|
|
4
|
+
parser: '@typescript-eslint/parser',
|
|
5
|
+
plugins: ['@typescript-eslint'],
|
|
6
|
+
rules: {
|
|
7
|
+
'react/no-unstable-nested-components': [
|
|
8
|
+
'off' | 'warn' | 'error',
|
|
9
|
+
{ allowAsProps: true | false },
|
|
10
|
+
],
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
name: CI Build Test React Apps
|
|
2
|
+
|
|
3
|
+
on: pull_request
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
eslint:
|
|
7
|
+
name: ESLint
|
|
8
|
+
permissions:
|
|
9
|
+
actions: write
|
|
10
|
+
contents: write
|
|
11
|
+
id-token: write
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/setup-node@v3
|
|
15
|
+
with:
|
|
16
|
+
node-version: "16"
|
|
17
|
+
|
|
18
|
+
- name: 'Checkout ${{ inputs.ref }}'
|
|
19
|
+
uses: actions/checkout@v2
|
|
20
|
+
with:
|
|
21
|
+
path: source
|
|
22
|
+
ref: '${{ inputs.ref }}'
|
|
23
|
+
|
|
24
|
+
- name: Install Basic app dependencies
|
|
25
|
+
run: |
|
|
26
|
+
yarn install
|
|
27
|
+
working-directory: source/examples/Basic
|
|
28
|
+
|
|
29
|
+
- name: Install Basic app dependencies
|
|
30
|
+
run: |
|
|
31
|
+
npx eslint . --ext .js,.jsx,.ts,.tsx
|
|
32
|
+
working-directory: source/examples/Basic
|
|
33
|
+
|
|
34
|
+
- name: Install TestNamiTV app dependencies
|
|
35
|
+
run: |
|
|
36
|
+
yarn install
|
|
37
|
+
working-directory: source/examples/TestNamiTV
|
|
38
|
+
|
|
39
|
+
- name: Install TestNamiTV app dependencies
|
|
40
|
+
run: |
|
|
41
|
+
npx eslint . --ext .js,.jsx,.ts,.tsx
|
|
42
|
+
working-directory: source/examples/TestNamiTV
|
|
43
|
+
build-android-stg:
|
|
44
|
+
name: Build Play Store STG
|
|
45
|
+
permissions:
|
|
46
|
+
actions: write
|
|
47
|
+
contents: write
|
|
48
|
+
id-token: write
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/setup-node@v3
|
|
52
|
+
with:
|
|
53
|
+
node-version: "16"
|
|
54
|
+
|
|
55
|
+
- name: 'Checkout ${{ inputs.ref }}'
|
|
56
|
+
uses: actions/checkout@v2
|
|
57
|
+
with:
|
|
58
|
+
path: source
|
|
59
|
+
ref: '${{ inputs.ref }}'
|
|
60
|
+
|
|
61
|
+
- name: Install Google API python client
|
|
62
|
+
run: |
|
|
63
|
+
pip install google-api-python-client
|
|
64
|
+
|
|
65
|
+
- name: Get new version code
|
|
66
|
+
run: |
|
|
67
|
+
echo $GOOGLE_PLAY_SERVICE_ACCOUNT > $RUNNER_TEMP/.service_account
|
|
68
|
+
python3 build-utils/get_version_code.py $RUNNER_TEMP/.service_account com.namiml.stg.testreactnative internal --quiet >> $RUNNER_TEMP/.new_version_code
|
|
69
|
+
rm -f .service_account
|
|
70
|
+
env:
|
|
71
|
+
GOOGLE_PLAY_SERVICE_ACCOUNT: '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}'
|
|
72
|
+
working-directory: source
|
|
73
|
+
|
|
74
|
+
- name: Update version code
|
|
75
|
+
working-directory: source/examples/Basic/android/app
|
|
76
|
+
run: |
|
|
77
|
+
NEW_VERSION_CODE=`cat $RUNNER_TEMP/.new_version_code`
|
|
78
|
+
echo $NEW_VERSION_CODE
|
|
79
|
+
sed -i "s/versionCode 1/versionCode $NEW_VERSION_CODE/" build.gradle
|
|
80
|
+
|
|
81
|
+
- name: Create the Keystore
|
|
82
|
+
run: |
|
|
83
|
+
# import keystore from secrets
|
|
84
|
+
echo $KEYSTORE_BASE64 | base64 -d > $RUNNER_TEMP/my_production.keystore
|
|
85
|
+
env:
|
|
86
|
+
KEYSTORE_BASE64: '${{ secrets.KEY_STORE_BASE64 }}'
|
|
87
|
+
|
|
88
|
+
- name: Install test app dependencies
|
|
89
|
+
run: |
|
|
90
|
+
yarn install
|
|
91
|
+
working-directory: source/examples/Basic
|
|
92
|
+
|
|
93
|
+
- name: Build Android App Bundle
|
|
94
|
+
run: |
|
|
95
|
+
./gradlew clean bundleStagingRelease
|
|
96
|
+
working-directory: source/examples/Basic/android
|
|
97
|
+
|
|
98
|
+
- name: Sign Android App Bundle
|
|
99
|
+
run: |
|
|
100
|
+
jarsigner -keystore $RUNNER_TEMP/my_production.keystore -storepass '${{ secrets.KEY_STORE_PASSWORD }}' -keypass '${{ secrets.KEY_PASSWORD }}' -sigalg SHA256withRSA -digestalg SHA-256 -signedjar build/outputs/bundle/stagingRelease/app-staging-release-signed.aab build/outputs/bundle/stagingRelease/app-staging-release.aab '${{ secrets.KEY_ALIAS }}'
|
|
101
|
+
working-directory: source/examples/Basic/android/app
|
|
102
|
+
|
|
103
|
+
- name: Uploading to test track
|
|
104
|
+
uses: r0adkll/upload-google-play@v1.0.17
|
|
105
|
+
with:
|
|
106
|
+
packageName: 'com.namiml.stg.testreactnative'
|
|
107
|
+
releaseFiles: source/examples/Basic/android/app/build/outputs/bundle/stagingRelease/app-staging-release-signed.aab
|
|
108
|
+
serviceAccountJsonPlainText: '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}'
|
|
109
|
+
status: completed
|
|
110
|
+
track: internal
|
|
111
|
+
build-ios-stg:
|
|
112
|
+
name: Build TestNami iOS STG
|
|
113
|
+
permissions:
|
|
114
|
+
actions: write
|
|
115
|
+
contents: write
|
|
116
|
+
id-token: write
|
|
117
|
+
runs-on: macos-12
|
|
118
|
+
timeout-minutes: 40
|
|
119
|
+
steps:
|
|
120
|
+
- uses: actions/setup-node@v3
|
|
121
|
+
with:
|
|
122
|
+
node-version: "16"
|
|
123
|
+
|
|
124
|
+
- name: "Checkout ${{ inputs.ref }}"
|
|
125
|
+
uses: actions/checkout@v2
|
|
126
|
+
with:
|
|
127
|
+
path: source
|
|
128
|
+
ref: "${{ inputs.ref }}"
|
|
129
|
+
|
|
130
|
+
- name: Checkout appstoreconnect-build-tools
|
|
131
|
+
uses: actions/checkout@v2
|
|
132
|
+
with:
|
|
133
|
+
path: appstoreconnect-build-tools
|
|
134
|
+
ref: main
|
|
135
|
+
repository: namiml/appstoreconnect-build-tools
|
|
136
|
+
|
|
137
|
+
- name: Set up Python
|
|
138
|
+
uses: actions/setup-python@v1
|
|
139
|
+
with:
|
|
140
|
+
python-version: "3.10"
|
|
141
|
+
|
|
142
|
+
- name: Get expected build number
|
|
143
|
+
run: |
|
|
144
|
+
pip3 install requests
|
|
145
|
+
pip3 install pydantic
|
|
146
|
+
pip3 install cryptography
|
|
147
|
+
pip3 install PyJWT
|
|
148
|
+
echo "1.0" > $RUNNER_TEMP/.current_version
|
|
149
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
150
|
+
python3 get_next_build.py com.namiml.stg.testreactnative --prerelease --version=$CURRENT_VERSION --platform=IOS > $RUNNER_TEMP/.next_build_number
|
|
151
|
+
working-directory: appstoreconnect-build-tools
|
|
152
|
+
env:
|
|
153
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
154
|
+
APPSTORE_API_PRIVATE_KEY: "${{ secrets.APPSTORE_API_PRIVATE_KEY }}"
|
|
155
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
156
|
+
|
|
157
|
+
- name: Install Apple Certificate
|
|
158
|
+
uses: apple-actions/import-codesign-certs@v1
|
|
159
|
+
with:
|
|
160
|
+
p12-file-base64: "${{ secrets.IOS_P12_BASE64 }}"
|
|
161
|
+
p12-password: "${{ secrets.IOS_CERTIFICATE_PASSWORD }}"
|
|
162
|
+
|
|
163
|
+
- name: Install the provisioning profile
|
|
164
|
+
run: |
|
|
165
|
+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
|
|
166
|
+
echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode --output $PP_PATH
|
|
167
|
+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
|
168
|
+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
|
|
169
|
+
env:
|
|
170
|
+
PROVISIONING_CERTIFICATE_BASE64: "${{ secrets.IOS_MOBILE_PROVISION_BASE64_TEST_REACT_STG }}"
|
|
171
|
+
|
|
172
|
+
- name: Store App Store Private Key
|
|
173
|
+
run: |
|
|
174
|
+
mkdir ~/.private_keys
|
|
175
|
+
echo '${{ secrets.APPSTORE_API_PRIVATE_KEY }}' > ~/.private_keys/AuthKey_'${{ secrets.APPSTORE_API_KEY_ID }}'.p8
|
|
176
|
+
|
|
177
|
+
- name: Update ExportOptions.plist
|
|
178
|
+
run: |
|
|
179
|
+
sed -i '' -e "s/APPSTORE_TEAM_ID/${{ secrets.APPSTORE_TEAM_ID }}/" ExportOptions.plist
|
|
180
|
+
sed -i '' -e "s/APPSTORE_PROVISIONING_PROFILE_UUID/${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_STG }}/g" ExportOptions.plist
|
|
181
|
+
working-directory: source/examples/Basic/ios
|
|
182
|
+
|
|
183
|
+
- name: Adjust version & build number
|
|
184
|
+
run: |-
|
|
185
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
186
|
+
export BUILD_NUMBER=`cat $RUNNER_TEMP/.next_build_number`
|
|
187
|
+
sed -i '' -e "s/CURRENT_PROJECT_VERSION = 1/CURRENT_PROJECT_VERSION = $BUILD_NUMBER/" ios/Basic.xcodeproj/project.pbxproj
|
|
188
|
+
sed -i '' -e "s/MARKETING_VERSION = 1.0/MARKETING_VERSION = $CURRENT_VERSION/" ios/Basic.xcodeproj/project.pbxproj
|
|
189
|
+
sed -i '' -e "s/<string>1<\/string>/<string>$BUILD_NUMBER<\/string>/" ios/Basic/Info.plist
|
|
190
|
+
working-directory: source/examples/Basic
|
|
191
|
+
|
|
192
|
+
- name: Install test app dependencies
|
|
193
|
+
run: |
|
|
194
|
+
yarn install
|
|
195
|
+
working-directory: source/examples/Basic
|
|
196
|
+
|
|
197
|
+
- name: Install test iOS dependencies
|
|
198
|
+
run: |
|
|
199
|
+
pod install
|
|
200
|
+
working-directory: source/examples/Basic/ios
|
|
201
|
+
|
|
202
|
+
- name: Build resolve Swift dependencies
|
|
203
|
+
run: |
|
|
204
|
+
xcodebuild -resolvePackageDependencies -workspace ios/Basic.xcworkspace -scheme Basic -configuration Release
|
|
205
|
+
working-directory: source/examples/Basic
|
|
206
|
+
|
|
207
|
+
- name: Build xArchive
|
|
208
|
+
run: |
|
|
209
|
+
xcodebuild -workspace ios/Basic.xcworkspace -scheme Basic -configuration Release DEVELOPMENT_TEAM='${{ secrets.APPSTORE_TEAM_ID }}' -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath build-output/app-stg.xcarchive PROVISIONING_PROFILE='${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_STG }}' clean archive CODE_SIGN_IDENTITY='${{ secrets.CODE_SIGNING_IDENTITY }}'
|
|
210
|
+
working-directory: source/examples/Basic
|
|
211
|
+
|
|
212
|
+
- name: Export IPA
|
|
213
|
+
run: |
|
|
214
|
+
xcodebuild -exportArchive -archivePath build-output/app-stg.xcarchive -exportPath build-output/ios-stg -exportOptionsPlist ios/ExportOptions.plist
|
|
215
|
+
working-directory: source/examples/Basic
|
|
216
|
+
|
|
217
|
+
- name: Upload app to TestFlight
|
|
218
|
+
run: |
|
|
219
|
+
xcrun altool --upload-app --type ios --file build-output/ios-stg/Basic.ipa --apiKey $APPSTORE_API_KEY_ID --apiIssuer $APPSTORE_ISSUER_ID
|
|
220
|
+
working-directory: source/examples/Basic
|
|
221
|
+
env:
|
|
222
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
223
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
224
|
+
build-ios-prod:
|
|
225
|
+
name: Build TestNami iOS PROD
|
|
226
|
+
permissions:
|
|
227
|
+
actions: write
|
|
228
|
+
contents: write
|
|
229
|
+
id-token: write
|
|
230
|
+
runs-on: macos-12
|
|
231
|
+
timeout-minutes: 40
|
|
232
|
+
steps:
|
|
233
|
+
- uses: actions/setup-node@v3
|
|
234
|
+
with:
|
|
235
|
+
node-version: "16"
|
|
236
|
+
|
|
237
|
+
- name: "Checkout ${{ inputs.ref }}"
|
|
238
|
+
uses: actions/checkout@v2
|
|
239
|
+
with:
|
|
240
|
+
path: source
|
|
241
|
+
ref: "${{ inputs.ref }}"
|
|
242
|
+
|
|
243
|
+
- name: Checkout appstoreconnect-build-tools
|
|
244
|
+
uses: actions/checkout@v2
|
|
245
|
+
with:
|
|
246
|
+
path: appstoreconnect-build-tools
|
|
247
|
+
ref: main
|
|
248
|
+
repository: namiml/appstoreconnect-build-tools
|
|
249
|
+
|
|
250
|
+
- name: Set up Python
|
|
251
|
+
uses: actions/setup-python@v1
|
|
252
|
+
with:
|
|
253
|
+
python-version: "3.10"
|
|
254
|
+
|
|
255
|
+
- name: Get expected build number
|
|
256
|
+
run: |
|
|
257
|
+
pip3 install requests
|
|
258
|
+
pip3 install pydantic
|
|
259
|
+
pip3 install cryptography
|
|
260
|
+
pip3 install PyJWT
|
|
261
|
+
echo "1.0" > $RUNNER_TEMP/.current_version
|
|
262
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
263
|
+
python3 get_next_build.py com.namiml.app.testreactnative --prerelease --version=$CURRENT_VERSION --platform=IOS > $RUNNER_TEMP/.next_build_number
|
|
264
|
+
working-directory: appstoreconnect-build-tools
|
|
265
|
+
env:
|
|
266
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
267
|
+
APPSTORE_API_PRIVATE_KEY: "${{ secrets.APPSTORE_API_PRIVATE_KEY }}"
|
|
268
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
269
|
+
|
|
270
|
+
- name: Install Apple Certificate
|
|
271
|
+
uses: apple-actions/import-codesign-certs@v1
|
|
272
|
+
with:
|
|
273
|
+
p12-file-base64: "${{ secrets.IOS_P12_BASE64 }}"
|
|
274
|
+
p12-password: "${{ secrets.IOS_CERTIFICATE_PASSWORD }}"
|
|
275
|
+
|
|
276
|
+
- name: Install the provisioning profile
|
|
277
|
+
run: |
|
|
278
|
+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
|
|
279
|
+
echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode --output $PP_PATH
|
|
280
|
+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
|
281
|
+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
|
|
282
|
+
env:
|
|
283
|
+
PROVISIONING_CERTIFICATE_BASE64: "${{ secrets.IOS_MOBILE_PROVISION_BASE64_TEST_REACT_PROD }}"
|
|
284
|
+
|
|
285
|
+
- name: Store App Store Private Key
|
|
286
|
+
run: |
|
|
287
|
+
mkdir ~/.private_keys
|
|
288
|
+
echo '${{ secrets.APPSTORE_API_PRIVATE_KEY }}' > ~/.private_keys/AuthKey_'${{ secrets.APPSTORE_API_KEY_ID }}'.p8
|
|
289
|
+
|
|
290
|
+
- name: Update ExportOptions.plist
|
|
291
|
+
run: |
|
|
292
|
+
sed -i '' -e "s/APPSTORE_TEAM_ID/${{ secrets.APPSTORE_TEAM_ID }}/" ExportOptions.plist
|
|
293
|
+
sed -i '' -e "s/APPSTORE_PROVISIONING_PROFILE_UUID/${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_PROD }}/g" ExportOptions.plist
|
|
294
|
+
working-directory: source/examples/Basic/ios
|
|
295
|
+
|
|
296
|
+
- name: Adjust version & build number
|
|
297
|
+
run: |-
|
|
298
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
299
|
+
export BUILD_NUMBER=`cat $RUNNER_TEMP/.next_build_number`
|
|
300
|
+
sed -i '' -e "s/CURRENT_PROJECT_VERSION = 1/CURRENT_PROJECT_VERSION = $BUILD_NUMBER/" ios/Basic.xcodeproj/project.pbxproj
|
|
301
|
+
sed -i '' -e "s/MARKETING_VERSION = 1.0/MARKETING_VERSION = $CURRENT_VERSION/" ios/Basic.xcodeproj/project.pbxproj
|
|
302
|
+
sed -i '' -e "s/<string>1<\/string>/<string>$BUILD_NUMBER<\/string>/" ios/BasicProductionInfo.plist
|
|
303
|
+
working-directory: source/examples/Basic
|
|
304
|
+
|
|
305
|
+
- name: Install test app dependencies
|
|
306
|
+
run: |
|
|
307
|
+
yarn install
|
|
308
|
+
working-directory: source/examples/Basic
|
|
309
|
+
|
|
310
|
+
- name: Install test iOS dependencies
|
|
311
|
+
run: |
|
|
312
|
+
pod install
|
|
313
|
+
working-directory: source/examples/Basic/ios
|
|
314
|
+
|
|
315
|
+
- name: Build resolve Swift dependencies
|
|
316
|
+
run: |
|
|
317
|
+
xcodebuild -resolvePackageDependencies -workspace ios/Basic.xcworkspace -scheme BasicProduction -configuration Release
|
|
318
|
+
working-directory: source/examples/Basic
|
|
319
|
+
|
|
320
|
+
- name: Build xArchive
|
|
321
|
+
run: |
|
|
322
|
+
xcodebuild -workspace ios/Basic.xcworkspace -scheme BasicProduction -configuration Release DEVELOPMENT_TEAM='${{ secrets.APPSTORE_TEAM_ID }}' -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath build-output/app-prod.xcarchive PROVISIONING_PROFILE='${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_PROD }}' clean archive CODE_SIGN_IDENTITY='${{ secrets.CODE_SIGNING_IDENTITY }}'
|
|
323
|
+
working-directory: source/examples/Basic
|
|
324
|
+
|
|
325
|
+
- name: Export IPA
|
|
326
|
+
run: |
|
|
327
|
+
xcodebuild -exportArchive -archivePath build-output/app-prod.xcarchive -exportPath build-output/ios-prod -exportOptionsPlist ios/ExportOptions.plist
|
|
328
|
+
working-directory: source/examples/Basic
|
|
329
|
+
|
|
330
|
+
- name: Upload app to TestFlight
|
|
331
|
+
run: |
|
|
332
|
+
xcrun altool --upload-app --type ios --file build-output/ios-prod/BasicProduction.ipa --apiKey $APPSTORE_API_KEY_ID --apiIssuer $APPSTORE_ISSUER_ID
|
|
333
|
+
working-directory: source/examples/Basic
|
|
334
|
+
env:
|
|
335
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
336
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
337
|
+
build-tvos-stg:
|
|
338
|
+
name: Build TestNamiTV tvOS STG
|
|
339
|
+
permissions:
|
|
340
|
+
actions: write
|
|
341
|
+
contents: write
|
|
342
|
+
id-token: write
|
|
343
|
+
runs-on: macos-12
|
|
344
|
+
timeout-minutes: 40
|
|
345
|
+
steps:
|
|
346
|
+
- uses: actions/setup-node@v3
|
|
347
|
+
with:
|
|
348
|
+
node-version: "16"
|
|
349
|
+
|
|
350
|
+
- name: "Checkout ${{ inputs.ref }}"
|
|
351
|
+
uses: actions/checkout@v2
|
|
352
|
+
with:
|
|
353
|
+
path: source
|
|
354
|
+
ref: "${{ inputs.ref }}"
|
|
355
|
+
|
|
356
|
+
- name: Checkout appstoreconnect-build-tools
|
|
357
|
+
uses: actions/checkout@v2
|
|
358
|
+
with:
|
|
359
|
+
path: appstoreconnect-build-tools
|
|
360
|
+
ref: main
|
|
361
|
+
repository: namiml/appstoreconnect-build-tools
|
|
362
|
+
|
|
363
|
+
- name: Set up Python
|
|
364
|
+
uses: actions/setup-python@v1
|
|
365
|
+
with:
|
|
366
|
+
python-version: "3.10"
|
|
367
|
+
|
|
368
|
+
- name: Get expected build number
|
|
369
|
+
run: |
|
|
370
|
+
pip3 install requests
|
|
371
|
+
pip3 install pydantic
|
|
372
|
+
pip3 install cryptography
|
|
373
|
+
pip3 install PyJWT
|
|
374
|
+
echo "1.0" > $RUNNER_TEMP/.current_version
|
|
375
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
376
|
+
python3 get_next_build.py com.namiml.stg.testreactnative --prerelease --platform=TV_OS > $RUNNER_TEMP/.next_build_number
|
|
377
|
+
working-directory: appstoreconnect-build-tools
|
|
378
|
+
env:
|
|
379
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
380
|
+
APPSTORE_API_PRIVATE_KEY: "${{ secrets.APPSTORE_API_PRIVATE_KEY }}"
|
|
381
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
382
|
+
|
|
383
|
+
- name: Install Apple Certificate
|
|
384
|
+
uses: apple-actions/import-codesign-certs@v1
|
|
385
|
+
with:
|
|
386
|
+
p12-file-base64: "${{ secrets.IOS_P12_BASE64 }}"
|
|
387
|
+
p12-password: "${{ secrets.IOS_CERTIFICATE_PASSWORD }}"
|
|
388
|
+
|
|
389
|
+
- name: Install the provisioning profile
|
|
390
|
+
run: |
|
|
391
|
+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
|
|
392
|
+
echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode --output $PP_PATH
|
|
393
|
+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
|
394
|
+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
|
|
395
|
+
env:
|
|
396
|
+
PROVISIONING_CERTIFICATE_BASE64: "${{ secrets.IOS_MOBILE_PROVISION_BASE64_TEST_REACT_TVOS_STG }}"
|
|
397
|
+
|
|
398
|
+
- name: Store App Store Private Key
|
|
399
|
+
run: |
|
|
400
|
+
mkdir ~/.private_keys
|
|
401
|
+
echo '${{ secrets.APPSTORE_API_PRIVATE_KEY }}' > ~/.private_keys/AuthKey_'${{ secrets.APPSTORE_API_KEY_ID }}'.p8
|
|
402
|
+
|
|
403
|
+
- name: Update ExportOptions.plist
|
|
404
|
+
run: |
|
|
405
|
+
sed -i '' -e "s/APPSTORE_TEAM_ID/${{ secrets.APPSTORE_TEAM_ID }}/" ExportOptions.plist
|
|
406
|
+
sed -i '' -e "s/APPSTORE_PROVISIONING_PROFILE_UUID/${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_TVOS_STG }}/g" ExportOptions.plist
|
|
407
|
+
working-directory: source/examples/TestNamiTV/ios
|
|
408
|
+
|
|
409
|
+
- name: Adjust version & build number
|
|
410
|
+
run: |-
|
|
411
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
412
|
+
export BUILD_NUMBER=`cat $RUNNER_TEMP/.next_build_number`
|
|
413
|
+
sed -i '' -e "s/CURRENT_PROJECT_VERSION = 1/CURRENT_PROJECT_VERSION = $BUILD_NUMBER/" ios/Basic.xcodeproj/project.pbxproj
|
|
414
|
+
sed -i '' -e "s/MARKETING_VERSION = 1.0/MARKETING_VERSION = $CURRENT_VERSION/" ios/Basic.xcodeproj/project.pbxproj
|
|
415
|
+
sed -i '' -e "s/<string>1<\/string>/<string>$BUILD_NUMBER<\/string>/" ios/Info-STG.plist
|
|
416
|
+
working-directory: source/examples/TestNamiTV
|
|
417
|
+
|
|
418
|
+
- name: Install test app dependencies
|
|
419
|
+
run: |
|
|
420
|
+
yarn install
|
|
421
|
+
working-directory: source/examples/TestNamiTV
|
|
422
|
+
|
|
423
|
+
- name: Install test tvOS dependencies
|
|
424
|
+
run: |
|
|
425
|
+
RCT_NEW_ARCH_ENABLED=0 SWIFT_VERSION=5 pod install
|
|
426
|
+
working-directory: source/examples/TestNamiTV/ios
|
|
427
|
+
|
|
428
|
+
- name: Build resolve Swift dependencies
|
|
429
|
+
run: |
|
|
430
|
+
xcodebuild -resolvePackageDependencies -workspace ios/Basic.xcworkspace -scheme Basic-tvOS -configuration Release
|
|
431
|
+
working-directory: source/examples/TestNamiTV
|
|
432
|
+
|
|
433
|
+
- name: Build xArchive
|
|
434
|
+
run: |
|
|
435
|
+
xcodebuild -workspace ios/Basic.xcworkspace -scheme Basic-tvOS -configuration Release DEVELOPMENT_TEAM='${{ secrets.APPSTORE_TEAM_ID }}' -sdk 'appletvos' -destination 'generic/platform=tvOS' -archivePath build-output/app-stg.xcarchive PROVISIONING_PROFILE='${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_TVOS_STG }}' clean archive CODE_SIGN_IDENTITY='${{ secrets.CODE_SIGNING_IDENTITY }}'
|
|
436
|
+
working-directory: source/examples/TestNamiTV
|
|
437
|
+
|
|
438
|
+
- name: Export IPA
|
|
439
|
+
run: |
|
|
440
|
+
xcodebuild -exportArchive -archivePath build-output/app-stg.xcarchive -exportPath build-output/tvos-stg -exportOptionsPlist ios/ExportOptions.plist
|
|
441
|
+
working-directory: source/examples/TestNamiTV
|
|
442
|
+
|
|
443
|
+
- name: Upload app to TestFlight
|
|
444
|
+
run: |
|
|
445
|
+
xcrun altool --upload-app --type tvos --file build-output/tvos-stg/Basic-tvOS.ipa --apiKey $APPSTORE_API_KEY_ID --apiIssuer $APPSTORE_ISSUER_ID
|
|
446
|
+
working-directory: source/examples/TestNamiTV
|
|
447
|
+
env:
|
|
448
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
449
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
450
|
+
build-tvos-prod:
|
|
451
|
+
name: Build TestNamiTV tvOS PROD
|
|
452
|
+
permissions:
|
|
453
|
+
actions: write
|
|
454
|
+
contents: write
|
|
455
|
+
id-token: write
|
|
456
|
+
runs-on: macos-12
|
|
457
|
+
timeout-minutes: 40
|
|
458
|
+
steps:
|
|
459
|
+
- uses: actions/setup-node@v3
|
|
460
|
+
with:
|
|
461
|
+
node-version: "16"
|
|
462
|
+
|
|
463
|
+
- name: "Checkout ${{ inputs.ref }}"
|
|
464
|
+
uses: actions/checkout@v2
|
|
465
|
+
with:
|
|
466
|
+
path: source
|
|
467
|
+
ref: "${{ inputs.ref }}"
|
|
468
|
+
|
|
469
|
+
- name: Checkout appstoreconnect-build-tools
|
|
470
|
+
uses: actions/checkout@v2
|
|
471
|
+
with:
|
|
472
|
+
path: appstoreconnect-build-tools
|
|
473
|
+
ref: main
|
|
474
|
+
repository: namiml/appstoreconnect-build-tools
|
|
475
|
+
|
|
476
|
+
- name: Set up Python
|
|
477
|
+
uses: actions/setup-python@v1
|
|
478
|
+
with:
|
|
479
|
+
python-version: "3.10"
|
|
480
|
+
|
|
481
|
+
- name: Get expected build number
|
|
482
|
+
run: |
|
|
483
|
+
pip3 install requests
|
|
484
|
+
pip3 install pydantic
|
|
485
|
+
pip3 install cryptography
|
|
486
|
+
pip3 install PyJWT
|
|
487
|
+
echo "1.0" > $RUNNER_TEMP/.current_version
|
|
488
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
489
|
+
python3 get_next_build.py com.namiml.app.testreactnative --prerelease --platform=TV_OS > $RUNNER_TEMP/.next_build_number
|
|
490
|
+
working-directory: appstoreconnect-build-tools
|
|
491
|
+
env:
|
|
492
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
493
|
+
APPSTORE_API_PRIVATE_KEY: "${{ secrets.APPSTORE_API_PRIVATE_KEY }}"
|
|
494
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
495
|
+
|
|
496
|
+
- name: Install Apple Certificate
|
|
497
|
+
uses: apple-actions/import-codesign-certs@v1
|
|
498
|
+
with:
|
|
499
|
+
p12-file-base64: "${{ secrets.IOS_P12_BASE64 }}"
|
|
500
|
+
p12-password: "${{ secrets.IOS_CERTIFICATE_PASSWORD }}"
|
|
501
|
+
|
|
502
|
+
- name: Install the provisioning profile
|
|
503
|
+
run: |
|
|
504
|
+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
|
|
505
|
+
echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode --output $PP_PATH
|
|
506
|
+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
|
507
|
+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
|
|
508
|
+
env:
|
|
509
|
+
PROVISIONING_CERTIFICATE_BASE64: "${{ secrets.IOS_MOBILE_PROVISION_BASE64_TEST_REACT_TVOS_PROD }}"
|
|
510
|
+
|
|
511
|
+
- name: Store App Store Private Key
|
|
512
|
+
run: |
|
|
513
|
+
mkdir ~/.private_keys
|
|
514
|
+
echo '${{ secrets.APPSTORE_API_PRIVATE_KEY }}' > ~/.private_keys/AuthKey_'${{ secrets.APPSTORE_API_KEY_ID }}'.p8
|
|
515
|
+
|
|
516
|
+
- name: Update ExportOptions.plist
|
|
517
|
+
run: |
|
|
518
|
+
sed -i '' -e "s/APPSTORE_TEAM_ID/${{ secrets.APPSTORE_TEAM_ID }}/" ExportOptions.plist
|
|
519
|
+
sed -i '' -e "s/APPSTORE_PROVISIONING_PROFILE_UUID/${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_TVOS_PROD }}/g" ExportOptions.plist
|
|
520
|
+
working-directory: source/examples/TestNamiTV/ios
|
|
521
|
+
|
|
522
|
+
- name: Adjust version & build number
|
|
523
|
+
run: |-
|
|
524
|
+
export CURRENT_VERSION=`cat $RUNNER_TEMP/.current_version`
|
|
525
|
+
export BUILD_NUMBER=`cat $RUNNER_TEMP/.next_build_number`
|
|
526
|
+
sed -i '' -e "s/CURRENT_PROJECT_VERSION = 1/CURRENT_PROJECT_VERSION = $BUILD_NUMBER/" ios/Basic.xcodeproj/project.pbxproj
|
|
527
|
+
sed -i '' -e "s/MARKETING_VERSION = 1.0/MARKETING_VERSION = $CURRENT_VERSION/" ios/Basic.xcodeproj/project.pbxproj
|
|
528
|
+
sed -i '' -e "s/<string>1<\/string>/<string>$BUILD_NUMBER<\/string>/" ios/Info-PROD.plist
|
|
529
|
+
working-directory: source/examples/TestNamiTV
|
|
530
|
+
|
|
531
|
+
- name: Install test app dependencies
|
|
532
|
+
run: |
|
|
533
|
+
yarn install
|
|
534
|
+
working-directory: source/examples/TestNamiTV
|
|
535
|
+
|
|
536
|
+
- name: Install test tvOS dependencies
|
|
537
|
+
run: |
|
|
538
|
+
RCT_NEW_ARCH_ENABLED=0 SWIFT_VERSION=5 pod install
|
|
539
|
+
working-directory: source/examples/TestNamiTV/ios
|
|
540
|
+
|
|
541
|
+
- name: Build resolve Swift dependencies
|
|
542
|
+
run: |
|
|
543
|
+
xcodebuild -resolvePackageDependencies -workspace ios/Basic.xcworkspace -scheme Basic-tvOS-PROD -configuration Release
|
|
544
|
+
working-directory: source/examples/TestNamiTV
|
|
545
|
+
|
|
546
|
+
- name: Build xArchive
|
|
547
|
+
run: |
|
|
548
|
+
xcodebuild -workspace ios/Basic.xcworkspace -scheme Basic-tvOS-PROD -configuration Release DEVELOPMENT_TEAM='${{ secrets.APPSTORE_TEAM_ID }}' -sdk 'appletvos' -destination 'generic/platform=tvOS' -archivePath build-output/app-prod.xcarchive PROVISIONING_PROFILE='${{ secrets.APPSTORE_PROV_PROFILE_UUID_TEST_REACT_TVOS_PROD }}' clean archive CODE_SIGN_IDENTITY='${{ secrets.CODE_SIGNING_IDENTITY }}'
|
|
549
|
+
working-directory: source/examples/TestNamiTV
|
|
550
|
+
|
|
551
|
+
- name: Export IPA
|
|
552
|
+
run: |
|
|
553
|
+
xcodebuild -exportArchive -archivePath build-output/app-prod.xcarchive -exportPath build-output/tvos-prod -exportOptionsPlist ios/ExportOptions.plist
|
|
554
|
+
working-directory: source/examples/TestNamiTV
|
|
555
|
+
|
|
556
|
+
- name: Upload app to TestFlight
|
|
557
|
+
run: |
|
|
558
|
+
xcrun altool --upload-app --type tvos --file build-output/tvos-prod/Basic-tvOS-PROD.ipa --apiKey $APPSTORE_API_KEY_ID --apiIssuer $APPSTORE_ISSUER_ID
|
|
559
|
+
working-directory: source/examples/TestNamiTV
|
|
560
|
+
env:
|
|
561
|
+
APPSTORE_API_KEY_ID: "${{ secrets.APPSTORE_API_KEY_ID }}"
|
|
562
|
+
APPSTORE_ISSUER_ID: "${{ secrets.APPSTORE_ISSUER_ID }}"
|
|
563
|
+
build-androidtv-stg:
|
|
564
|
+
name: Build TestNamiTV Android STG
|
|
565
|
+
permissions:
|
|
566
|
+
actions: write
|
|
567
|
+
contents: write
|
|
568
|
+
id-token: write
|
|
569
|
+
runs-on: ubuntu-latest
|
|
570
|
+
steps:
|
|
571
|
+
- uses: actions/setup-node@v3
|
|
572
|
+
with:
|
|
573
|
+
node-version: "16"
|
|
574
|
+
|
|
575
|
+
- name: 'Checkout ${{ inputs.ref }}'
|
|
576
|
+
uses: actions/checkout@v2
|
|
577
|
+
with:
|
|
578
|
+
path: source
|
|
579
|
+
ref: '${{ inputs.ref }}'
|
|
580
|
+
|
|
581
|
+
- name: Create the Keystore
|
|
582
|
+
run: |
|
|
583
|
+
# import keystore from secrets
|
|
584
|
+
echo $KEYSTORE_BASE64 | base64 -d > $RUNNER_TEMP/my_production.keystore
|
|
585
|
+
env:
|
|
586
|
+
KEYSTORE_BASE64: '${{ secrets.KEY_STORE_BASE64 }}'
|
|
587
|
+
|
|
588
|
+
- name: Install test app dependencies
|
|
589
|
+
run: |
|
|
590
|
+
yarn install
|
|
591
|
+
working-directory: source/examples/TestNamiTV
|
|
592
|
+
|
|
593
|
+
- name: Build Android App Bundle
|
|
594
|
+
run: |
|
|
595
|
+
./gradlew clean bundleStagingRelease
|
|
596
|
+
working-directory: source/examples/TestNamiTV/android
|
|
597
|
+
|
|
598
|
+
# - name: Sign Android App Bundle
|
|
599
|
+
# run: |
|
|
600
|
+
# jarsigner -keystore $RUNNER_TEMP/my_production.keystore -storepass '${{ secrets.KEY_STORE_PASSWORD }}' -keypass '${{ secrets.KEY_PASSWORD }}' -sigalg SHA256withRSA -digestalg SHA-256 -signedjar build/outputs/bundle/stagingRelease/app-staging-release-signed.aab build/outputs/bundle/stagingRelease/app-staging-release.aab '${{ secrets.KEY_ALIAS }}'
|
|
601
|
+
# working-directory: source/examples/TestNamiTV/android/app
|
|
602
|
+
|
|
603
|
+
# - name: Uploading to test track
|
|
604
|
+
# uses: r0adkll/upload-google-play@v1.0.17
|
|
605
|
+
# with:
|
|
606
|
+
# packageName: 'com.namiml.stg.testreactnative'
|
|
607
|
+
# releaseFiles: source/examples/TestNamiTV/android/app/build/outputs/bundle/stagingRelease/app-staging-release-signed.aab
|
|
608
|
+
# serviceAccountJsonPlainText: '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}'
|
|
609
|
+
# status: completed
|
|
610
|
+
# track: internal
|