airbridge-react-native-sdk-restricted 2.8.9 → 4.1.2

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.
Files changed (270) hide show
  1. package/.github/workflows/build.yml +249 -159
  2. package/.github/workflows/documentation.yml +79 -0
  3. package/.github/workflows/qa.yml +187 -0
  4. package/.github/workflows/release.yml +26 -0
  5. package/airbridge-react-native-sdk-restricted.podspec +10 -7
  6. package/airbridge_sdk.json +4 -0
  7. package/android/build.gradle +22 -5
  8. package/android/{copy-config.gradle → copy-airbridge-json.gradle} +2 -2
  9. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeReactNative.kt +153 -0
  10. package/android/src/main/java/co/ab180/airbridge/reactnative/common/AirbridgeLifecycleIntegration.kt +7 -0
  11. package/android/src/main/java/co/ab180/airbridge/reactnative/extension/AirbridgeOptionBuilderApply.kt +79 -0
  12. package/android/src/main/java/co/ab180/airbridge/reactnative/extension/JSONConvert.kt +33 -0
  13. package/android/src/main/java/co/ab180/airbridge/reactnative/module/AttributionInteractor.kt +54 -0
  14. package/android/src/main/java/co/ab180/airbridge/reactnative/module/DeeplinkInteractor.kt +45 -0
  15. package/android/src/main/java/co/ab180/airbridge/reactnative/module/EventInteractor.kt +22 -0
  16. package/android/src/main/java/co/ab180/airbridge/reactnative/module/FetchInteractor.kt +51 -0
  17. package/android/src/main/java/co/ab180/airbridge/reactnative/module/PlacementInteractor.kt +56 -0
  18. package/android/src/main/java/co/ab180/airbridge/reactnative/module/RegisterInteractor.kt +108 -0
  19. package/android/src/main/java/co/ab180/airbridge/reactnative/module/SwitchInteractor.kt +43 -0
  20. package/android/src/main/java/co/ab180/airbridge/reactnative/module/WebInterfaceInteractor.kt +24 -0
  21. package/build/document/.nojekyll +1 -0
  22. package/build/document/assets/highlight.css +22 -0
  23. package/build/document/assets/icons.js +18 -0
  24. package/build/document/assets/icons.svg +1 -0
  25. package/build/document/assets/main.js +60 -0
  26. package/build/document/assets/navigation.js +1 -0
  27. package/build/document/assets/search.js +1 -0
  28. package/build/document/assets/style.css +1448 -0
  29. package/build/document/classes/Airbridge.html +113 -0
  30. package/build/document/classes/AirbridgeAttribute.html +49 -0
  31. package/build/document/classes/AirbridgeCategory.html +28 -0
  32. package/build/document/index.html +8 -0
  33. package/build/document/modules.html +4 -0
  34. package/build/source/Airbridge.d.ts +230 -0
  35. package/build/source/Airbridge.js +277 -0
  36. package/build/source/Airbridge.js.map +1 -0
  37. package/build/source/architecture/Interactor.d.ts +2 -0
  38. package/build/source/architecture/Interactor.js +7 -0
  39. package/build/source/architecture/Interactor.js.map +1 -0
  40. package/build/source/architecture/module.d.ts +1 -0
  41. package/build/source/architecture/module.js +2 -0
  42. package/build/source/architecture/module.js.map +1 -0
  43. package/build/source/constant/AirbridgeAttribute.d.ts +51 -0
  44. package/build/source/constant/AirbridgeAttribute.js +144 -0
  45. package/build/source/constant/AirbridgeAttribute.js.map +1 -0
  46. package/build/source/constant/AirbridgeCategory.d.ts +30 -0
  47. package/build/source/constant/AirbridgeCategory.js +81 -0
  48. package/build/source/constant/AirbridgeCategory.js.map +1 -0
  49. package/build/source/module/Attribution.d.ts +16 -0
  50. package/build/source/module/Attribution.js +39 -0
  51. package/build/source/module/Attribution.js.map +1 -0
  52. package/build/source/module/Deeplink.d.ts +17 -0
  53. package/build/source/module/Deeplink.js +40 -0
  54. package/build/source/module/Deeplink.js.map +1 -0
  55. package/build/source/module/Event.d.ts +14 -0
  56. package/build/source/module/Event.js +50 -0
  57. package/build/source/module/Event.js.map +1 -0
  58. package/build/source/module/Fetch.d.ts +19 -0
  59. package/build/source/module/Fetch.js +100 -0
  60. package/build/source/module/Fetch.js.map +1 -0
  61. package/build/source/module/Placement.d.ts +18 -0
  62. package/build/source/module/Placement.js +95 -0
  63. package/build/source/module/Placement.js.map +1 -0
  64. package/build/source/module/Register.d.ts +49 -0
  65. package/build/source/module/Register.js +138 -0
  66. package/build/source/module/Register.js.map +1 -0
  67. package/build/source/module/Switch.d.ts +24 -0
  68. package/build/source/module/Switch.js +39 -0
  69. package/build/source/module/Switch.js.map +1 -0
  70. package/build/source/module/WebInterface.d.ts +16 -0
  71. package/build/source/module/WebInterface.js +46 -0
  72. package/build/source/module/WebInterface.js.map +1 -0
  73. package/build/source/module.d.ts +3 -0
  74. package/build/source/module.js +4 -0
  75. package/build/source/module.js.map +1 -0
  76. package/build/source/utility/check.d.ts +13 -0
  77. package/build/source/utility/check.js +15 -0
  78. package/build/source/utility/check.js.map +1 -0
  79. package/build/source/utility/compute.d.ts +3 -0
  80. package/build/source/utility/compute.js +5 -0
  81. package/build/source/utility/compute.js.map +1 -0
  82. package/build/source/utility/create.d.ts +5 -0
  83. package/build/source/utility/create.js +12 -0
  84. package/build/source/utility/create.js.map +1 -0
  85. package/build/source/utility/extract.d.ts +3 -0
  86. package/build/source/utility/extract.js +4 -0
  87. package/build/source/utility/extract.js.map +1 -0
  88. package/build/source/utility/json.d.ts +11 -0
  89. package/build/source/utility/json.js +137 -0
  90. package/build/source/utility/json.js.map +1 -0
  91. package/build/source/utility/log.d.ts +4 -0
  92. package/build/source/utility/log.js +9 -0
  93. package/build/source/utility/log.js.map +1 -0
  94. package/changelog.md +14 -3
  95. package/ios/AirbridgeReactNative/AirbridgeReactNative.h +23 -0
  96. package/ios/AirbridgeReactNative/AirbridgeReactNative.m +36 -0
  97. package/ios/AirbridgeReactNative/AirbridgeReactNative.swift +107 -0
  98. package/ios/AirbridgeReactNative/Extension/AirbridgeOptionBuilderApply.swift +86 -0
  99. package/ios/AirbridgeReactNative/Extension/DataFromHex.swift +21 -0
  100. package/ios/AirbridgeReactNative/Extension/Logger.swift +62 -0
  101. package/ios/AirbridgeReactNative/Module/AirbridgeModuleExtern.m +133 -0
  102. package/ios/AirbridgeReactNative/Module/AttributionInteractor.swift +43 -0
  103. package/ios/AirbridgeReactNative/Module/DeeplinkInteractor.swift +49 -0
  104. package/ios/AirbridgeReactNative/Module/EventInteractor.swift +26 -0
  105. package/ios/AirbridgeReactNative/Module/FetchInteractor.swift +66 -0
  106. package/ios/AirbridgeReactNative/Module/PlacementInteractor.swift +72 -0
  107. package/ios/AirbridgeReactNative/Module/RegisterInteractor.swift +104 -0
  108. package/ios/AirbridgeReactNative/Module/SwitchInteractor.swift +48 -0
  109. package/ios/AirbridgeReactNative/Module/WebInterfaceInteractor.swift +30 -0
  110. package/ios/{copy-config.rb → copy-airbridge-json.rb} +1 -1
  111. package/package.json +18 -27
  112. package/qa/Gemfile +3 -4
  113. package/qa/Gemfile.lock +28 -17
  114. package/qa/airbridge_qa.json +6 -0
  115. package/qa/android/app/build.gradle +30 -26
  116. package/qa/android/app/src/main/AndroidManifest.xml +182 -7
  117. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/ConfigurationLoader.kt +5 -5
  118. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/MainActivity.kt +2 -2
  119. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/IdentifiersInteractor.kt +8 -17
  120. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/InstallReferrerInteractor.kt +13 -22
  121. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/ModuleInjector.kt +1 -2
  122. package/qa/android/app/src/main/res/values/airbridge.xml +16 -0
  123. package/qa/android/build.gradle +4 -2
  124. package/qa/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  125. package/qa/android/gradle.properties +0 -2
  126. package/qa/android/gradlew +1 -1
  127. package/qa/android/settings.gradle +3 -1
  128. package/qa/ios/AirbridgeQA/AirbridgeQA.entitlements +12 -0
  129. package/qa/ios/AirbridgeQA/AppDelegate.mm +40 -30
  130. package/qa/ios/AirbridgeQA/DeviceInfoInteractor.swift +0 -1
  131. package/qa/ios/AirbridgeQA/IdentifiersInteractor.swift +4 -8
  132. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-20@2x.png +0 -0
  133. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-20@2x~ipad.png +0 -0
  134. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-20@3x.png +0 -0
  135. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-20~ipad.png +0 -0
  136. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29.png +0 -0
  137. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x.png +0 -0
  138. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29@2x~ipad.png +0 -0
  139. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29@3x.png +0 -0
  140. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-29~ipad.png +0 -0
  141. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x.png +0 -0
  142. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-40@2x~ipad.png +0 -0
  143. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-40@3x.png +0 -0
  144. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-40~ipad.png +0 -0
  145. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-60@2x~car.png +0 -0
  146. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-60@3x~car.png +0 -0
  147. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon-83.5@2x~ipad.png +0 -0
  148. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon@2x.png +0 -0
  149. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon@2x~ipad.png +0 -0
  150. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon@3x.png +0 -0
  151. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon~ios-marketing.png +0 -0
  152. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/AppIcon~ipad.png +0 -0
  153. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/Contents.json +113 -32
  154. package/qa/ios/AirbridgeQA/Info.plist +8 -0
  155. package/qa/ios/AirbridgeQA.xcodeproj/project.pbxproj +47 -29
  156. package/qa/ios/InternalLibrary/airbridge-ios-sdk-qa-library.podspec +32 -0
  157. package/qa/ios/InternalLibrary/airbridge-ios-sdk-restricted.podspec +32 -0
  158. package/qa/ios/Library/airbridge-ios-sdk-qa-library.podspec +6 -1
  159. package/qa/ios/Podfile +13 -1
  160. package/qa/ios/Podfile.lock +689 -316
  161. package/qa/ios/Script/prepare-build-parameter.rb +23 -0
  162. package/qa/metro.config.js +5 -2
  163. package/qa/package-lock.json +3369 -1433
  164. package/qa/package.json +30 -30
  165. package/qa/source/App.js +13 -6
  166. package/qa/source/common/FCMService.js +39 -15
  167. package/qa/source/common/QALog.js +12 -0
  168. package/qa/source/navigations/Stack.js +8 -1
  169. package/qa/source/pages/AppInfo.js +40 -0
  170. package/qa/source/pages/Browse.js +16 -19
  171. package/qa/source/pages/DeviceInfo.js +10 -4
  172. package/qa/source/pages/Event.js +70 -60
  173. package/qa/source/pages/Home.js +77 -17
  174. package/qa/source/pages/Identifiers.js +10 -6
  175. package/qa/source/pages/Placement.js +3 -3
  176. package/qa/source/pages/Skad.js +76 -0
  177. package/qa/source/pages/UserInfo.js +47 -28
  178. package/readme.md +6 -6
  179. package/script/BuildDocument.sh +10 -0
  180. package/{scripts/build-qa.sh → script/BuildQA.sh} +5 -4
  181. package/script/BuildSource.sh +14 -0
  182. package/script/ChangeInternalSDK.sh +22 -0
  183. package/script/ChangeProductionSDK.sh +39 -0
  184. package/script/ChangeRestricted.sh +34 -0
  185. package/script/PrepareBuildParameter.sh +28 -0
  186. package/source/Airbridge.ts +340 -0
  187. package/source/architecture/Interactor.ts +10 -0
  188. package/source/architecture/module.ts +1 -0
  189. package/source/constant/AirbridgeAttribute.ts +188 -0
  190. package/source/constant/AirbridgeCategory.ts +104 -0
  191. package/source/module/Attribution.ts +4 -8
  192. package/source/module/Deeplink.ts +59 -0
  193. package/source/module/Event.ts +71 -0
  194. package/source/module/Fetch.ts +137 -0
  195. package/source/module/Placement.ts +134 -0
  196. package/source/module/Register.ts +203 -0
  197. package/source/module/Switch.ts +61 -0
  198. package/source/module/WebInterface.ts +55 -0
  199. package/source/module.ts +3 -0
  200. package/source/tsconfig.json +14 -0
  201. package/source/utility/check.ts +46 -0
  202. package/source/utility/compute.ts +9 -0
  203. package/source/utility/create.ts +12 -0
  204. package/source/utility/extract.ts +5 -0
  205. package/source/utility/json.ts +180 -0
  206. package/source/utility/log.ts +14 -0
  207. package/test/jest.json +13 -0
  208. package/test/mock.ts +112 -0
  209. package/test/module/Deeplink.test.ts +29 -0
  210. package/test/tsconfig.json +8 -0
  211. package/.eslintrc.json +0 -44
  212. package/.gitattributes +0 -1
  213. package/.github/actions/add-github-check/action.yml +0 -78
  214. package/.github/actions/add-github-comment/action.yml +0 -48
  215. package/.github/actions/add-slack-message/action.yml +0 -32
  216. package/.github/actions/edit-github-check/action.yml +0 -59
  217. package/.github/actions/edit-github-comment/action.yml +0 -41
  218. package/.github/workflows/release-restricted.yml +0 -35
  219. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeAttribution.java +0 -78
  220. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeDeeplink.java +0 -97
  221. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeEvent.java +0 -76
  222. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeLifecycle.java +0 -31
  223. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeLifecycleIntegration.java +0 -8
  224. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgePlacement.java +0 -42
  225. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeRN.java +0 -112
  226. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeState.java +0 -174
  227. package/android/src/main/java/co/ab180/airbridge/reactnative/ConfigReader.java +0 -154
  228. package/android/src/main/java/co/ab180/airbridge/reactnative/Get.java +0 -84
  229. package/index.d.ts +0 -338
  230. package/index.js +0 -8
  231. package/ios/AirbridgeRN/ARNConfigReader.h +0 -19
  232. package/ios/AirbridgeRN/ARNConfigReader.m +0 -80
  233. package/ios/AirbridgeRN/ARNGet.h +0 -20
  234. package/ios/AirbridgeRN/ARNGet.m +0 -40
  235. package/ios/AirbridgeRN/ARNHex.h +0 -16
  236. package/ios/AirbridgeRN/ARNHex.m +0 -44
  237. package/ios/AirbridgeRN/AirbridgeAttribution.h +0 -19
  238. package/ios/AirbridgeRN/AirbridgeAttribution.m +0 -47
  239. package/ios/AirbridgeRN/AirbridgeDeeplink.h +0 -20
  240. package/ios/AirbridgeRN/AirbridgeDeeplink.m +0 -59
  241. package/ios/AirbridgeRN/AirbridgeEvent.h +0 -17
  242. package/ios/AirbridgeRN/AirbridgeEvent.m +0 -63
  243. package/ios/AirbridgeRN/AirbridgePlacement.h +0 -17
  244. package/ios/AirbridgeRN/AirbridgePlacement.m +0 -38
  245. package/ios/AirbridgeRN/AirbridgeRN.h +0 -71
  246. package/ios/AirbridgeRN/AirbridgeRN.m +0 -83
  247. package/ios/AirbridgeRN/AirbridgeState.h +0 -17
  248. package/ios/AirbridgeRN/AirbridgeState.m +0 -94
  249. package/ios/AirbridgeRN.xcodeproj/project.pbxproj +0 -417
  250. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/UserInfoInteractor.kt +0 -74
  251. package/qa/ios/AirbridgeQA/UserInfoInteractor.m +0 -57
  252. package/qa/ios/AirbridgeQA/UserInfoInteractor.swift +0 -49
  253. package/qa/source/pages/appInfo.js +0 -22
  254. package/scripts/addiOSFramework.js +0 -48
  255. package/scripts/change_restricted.sh +0 -21
  256. package/scripts/update_native_version.sh +0 -104
  257. package/src/Airbridge.js +0 -82
  258. package/src/Deeplink.js +0 -75
  259. package/src/Event.js +0 -38
  260. package/src/Placement.js +0 -56
  261. package/src/State.js +0 -175
  262. package/src/WebInterface.js +0 -135
  263. package/src/tool/Log.js +0 -40
  264. package/src/tool/_.js +0 -56
  265. package/src/type/AirbridgeAttributes.js +0 -40
  266. package/src/type/AirbridgeCategory.js +0 -35
  267. package/src/type/AirbridgeProduct.js +0 -18
  268. package/src/typedef/EventOption.js +0 -9
  269. package/src/typedef/Product.js +0 -10
  270. package/src/typedef/User.js +0 -9
@@ -1,39 +1,28 @@
1
1
  name: build
2
2
 
3
3
  on:
4
+ pull_request:
5
+ types: [labeled]
6
+
7
+ workflow_dispatch:
8
+
4
9
  workflow_call:
5
10
  inputs:
6
- reference:
7
- description: Reference to build
8
- type: string
9
- required: true
10
- secrets:
11
- AWS_ROLE_TO_ASSUME:
12
- required: true
13
- APP_STORE_CONNECT_ISSUER_ID:
14
- required: true
15
- APP_STORE_CONNECT_KEY_ID:
16
- required: true
17
- APP_STORE_CONNECT_PRIVATE_KEY:
18
- required: true
19
- CERTIFICATE_DEVELOPMENT_PRIVATE_KEY:
20
- required: true
21
- CERTIFICATE_DEVELOPMENT_PRIVATE_KEY_PASSWORD:
22
- required: true
23
- CERTIFICATE_DISTRIBUTION_PRIVATE_KEY:
24
- required: true
25
- CERTIFICATE_DISTRIBUTION_PRIVATE_KEY_PASSWORD:
26
- required: true
11
+ workflow-call:
12
+ description: Check event is workflow call (Do not use it)
13
+ type: boolean
14
+ default: true
15
+ required: false
27
16
  outputs:
28
- expire:
29
- description: Expire of build
30
- value: ${{ jobs.build-ios.outputs.expire }}
31
17
  version:
32
18
  description: Version of build
33
19
  value: ${{ jobs.prepare.outputs.version }}
34
20
  commit:
35
21
  description: Commit hash of build
36
22
  value: ${{ jobs.prepare.outputs.commit }}
23
+ build-number:
24
+ description: Build number
25
+ value: ${{ jobs.prepare.outputs.build-number }}
37
26
  qa-ios-application-install-url:
38
27
  description: QA iOS Application install URL of build
39
28
  value: ${{ jobs.build-ios.outputs.install-url }}
@@ -43,29 +32,35 @@ on:
43
32
  qa-android-application-download-url:
44
33
  description: QA Android Application download URL of build
45
34
  value: ${{ jobs.build-android.outputs.download-url }}
46
- issue_comment:
47
- types:
48
- - created
49
- pull_request:
50
- types: labeled
51
- workflow_dispatch:
52
35
 
53
36
  env:
54
- REPOSITORY: ab180/airbridge-react-native-sdk
55
37
  TRIGGER: ${{
56
- (inputs.reference != null) && 'workflow_call'
57
- || (github.event_name == 'issue_comment') && 'issue_comment'
38
+ (inputs.workflow-call != null) && 'workflow_call'
58
39
  || (github.event_name == 'pull_request') && 'pull_request'
59
40
  || (github.event_name == 'workflow_dispatch') && 'workflow_dispatch'
60
41
  }}
61
- REFERENCE: ${{
62
- (inputs.reference != null) && inputs.reference
63
- || (github.event_name == 'issue_comment') && format('refs/pull/{0}/merge', github.event.issue.number)
64
- || (github.event_name == 'pull_request') && format('refs/pull/{0}/merge', github.event.pull_request.number)
65
- || (github.event_name == 'workflow_dispatch') && github.event.ref
42
+ BRANCH: ${{ github.event.pull_request.head.label || github.ref_name }}
43
+ TYPE: ${{
44
+ github.event_name == 'pull_request'
45
+ && startsWith(github.event.pull_request.head.label, 'release/')
46
+ && 'Release'
47
+ || 'Feature'
66
48
  }}
67
- AWS_REGION: ap-northeast-1
68
- AWS_ROLE_TO_ASSUME: ${{ secrets.AWS_ROLE_TO_ASSUME }}
49
+ TAG: ${{
50
+ format(
51
+ '@{0} {1}',
52
+ github.event.pull_request.user.login || github.actor,
53
+ github.event_name == 'pull_request' && join(github.event.pull_request.requested_reviewers.*.login, '') != ''
54
+ && format('@{0}', join(github.event.pull_request.requested_reviewers.*.login, ' @'))
55
+ || ''
56
+ )
57
+ }}
58
+
59
+ AWS_REGION: ${{ vars.AWS_REGION }}
60
+ AWS_BUCKET: ${{ vars.INTERNAL_BUCKET }}
61
+ AWS_DOMAIN: ${{ vars.INTERNAL_BUCKET_DOMAIN }}
62
+ DISTRIBUTION_ID: ${{ vars.INTERNAL_DISTRIBUTION }}
63
+
69
64
  APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
70
65
  APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
71
66
  APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY }}
@@ -84,54 +79,60 @@ jobs:
84
79
  prepare:
85
80
  runs-on: ${{ vars.LINUX_INSTANCE }}
86
81
  if: |
87
- (
88
- (inputs.reference != null)
89
- || (
90
- (github.event_name == 'issue_comment' && github.event.issue.pull_request != null)
91
- && startsWith(github.event.comment.body, '!build')
92
- )
93
- || (
94
- (github.event_name == 'pull_request')
95
- && github.event.label.name == '!Build'
96
- )
97
- || (github.event_name == 'workflow_dispatch')
82
+ inputs.workflow-call != null
83
+ || (
84
+ github.event_name == 'pull_request'
85
+ && github.event.label.name == '!Build'
98
86
  )
87
+ || (github.event_name == 'workflow_dispatch')
99
88
 
100
89
  outputs:
101
- check-id: ${{ steps.report-start-github-check.outputs.check-id }}
102
- comment-id: ${{ steps.report-start-github-comment.outputs.comment-id }}
103
- uuid: ${{ steps.prepare-environment.outputs.uuid }}
104
90
  version: ${{ steps.prepare-environment.outputs.version }}
105
91
  commit: ${{ steps.prepare-environment.outputs.commit }}
92
+ branch: ${{ steps.prepare-environment.outputs.branch }}
93
+
94
+ build-number: ${{ steps.prepare-build-number.outputs.build-number }}
95
+
96
+ build-version: ${{ steps.prepare-build.outputs.build-version }}
97
+ identifier: ${{ steps.prepare-build.outputs.identifier }}
98
+ path: ${{ steps.prepare-build.outputs.path }}
99
+
100
+ comment-id: ${{ steps.report-start-github-comment.outputs.comment-id }}
101
+
106
102
  steps:
107
103
  - name: Checkout
108
104
  uses: actions/checkout@v4
109
- with:
110
- repository: ${{ env.REPOSITORY }}
111
- ref: ${{ env.REFERENCE }}
112
105
 
113
- - name: Report start to GitHub check
114
- id: report-start-github-check
115
- if: env.TRIGGER == 'issue_comment'
116
- uses: ./.github/actions/add-github-check
106
+ - name: Prepare environment
107
+ id: prepare-environment
108
+ run: |
109
+ echo "version=$(grep -E '"version": *"[^"]+"' package.json | awk -F '"' '{print $4}')" >> $GITHUB_OUTPUT
110
+ echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
111
+ echo "branch=$(git branch --show-current)" >> $GITHUB_OUTPUT
112
+
113
+ - name: Prepare build number
114
+ id: prepare-build-number
115
+ uses: ab180/airbridge-sdk-tool/action/prepare-github-build-number@v1
117
116
  with:
118
- status: in_progress
117
+ github-app-id: ${{ secrets.SDK_TEAM_APP_ID }}
118
+ github-app-private-key: ${{ secrets.SDK_TEAM_APP_PRIVATE_KEY }}
119
+ github-app-owner: ab180
119
120
 
121
+ - name: prepare build
122
+ id: prepare-build
123
+ run: |
124
+ echo "build-version=${{ steps.prepare-build-number.outputs.build-number }},Android,${{ steps.prepare-environment.outputs.version }},${{ steps.prepare-environment.outputs.branch }}" >> $GITHUB_OUTPUT
125
+ IDENTIFIER='${{ steps.prepare-environment.outputs.version }}-build-${{ steps.prepare-build-number.outputs.build-number }}'
126
+ echo "identifier=$IDENTIFIER" >> $GITHUB_OUTPUT
127
+ echo "path=build/${{ github.event.repository.name }}/$IDENTIFIER" >> $GITHUB_OUTPUT
128
+
120
129
  - name: Report start to GitHub comment
121
130
  id: report-start-github-comment
122
- if: env.TRIGGER == 'issue_comment' || env.TRIGGER == 'pull_request'
123
- uses: ./.github/actions/add-github-comment
131
+ if: env.TRIGGER == 'pull_request'
132
+ uses: ab180/airbridge-sdk-tool/action/add-github-comment@v1
124
133
  with:
125
134
  comment: 'Build is started.'
126
135
 
127
- - name: Prepare environment
128
- id: prepare-environment
129
- run: |
130
- git fetch --tags --quiet
131
- echo "uuid=$(uuidgen)" >> $GITHUB_OUTPUT
132
- echo "version=1.0" >> $GITHUB_OUTPUT
133
- echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
134
-
135
136
  build-ios:
136
137
  runs-on: ${{ vars.MACOS_INSTANCE }}
137
138
  needs: ['prepare']
@@ -143,9 +144,6 @@ jobs:
143
144
  steps:
144
145
  - name: Checkout
145
146
  uses: actions/checkout@v4
146
- with:
147
- repository: ${{ env.REPOSITORY }}
148
- ref: ${{ env.REFERENCE }}
149
147
 
150
148
  - name: Prepare certificate
151
149
  uses: ab180/apple-action/prepare-certificate@v3
@@ -170,7 +168,7 @@ jobs:
170
168
  - name: Prepare aws
171
169
  uses: aws-actions/configure-aws-credentials@v4
172
170
  with:
173
- role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
171
+ role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
174
172
  aws-region: ${{ env.AWS_REGION }}
175
173
 
176
174
  - name: Prepare Node
@@ -191,39 +189,39 @@ jobs:
191
189
  ${{ runner.os }}-pods-
192
190
 
193
191
  - name: Build QA
194
- run: ./scripts/build-qa.sh
192
+ run: |
193
+ ./script/BuildQA.sh
195
194
  env:
196
195
  BUILD_QA: ios
196
+ BUILD_NUMBER: ${{ needs.prepare.outputs.build-number }}
197
197
 
198
198
  - name: Deploy QA iOS Application
199
199
  id: deploy-qa-ios-application
200
200
  uses: ab180/apple-action/deploy-ios-application-to-aws@v3
201
201
  with:
202
- application: build/ios-application.ipa
202
+ application: build/qa/ios-application.ipa
203
203
  application-version: ${{ needs.prepare.outputs.version }}
204
204
  application-identifier: co.ab180.airbridge.qa.application
205
- bucket: ${{ vars.INTERNAL_BUCKET }}
206
- distribution: ${{ vars.INTERNAL_DISTRIBUTION }}
207
- domain: sdk-internal.airbridge.io
208
- directory: build/${{ needs.prepare.outputs.uuid }}
205
+ bucket: ${{ env.AWS_BUCKET }}
206
+ distribution: ${{ env.DISTRIBUTION_ID }}
207
+ domain: ${{ env.AWS_DOMAIN }}
208
+ directory: ${{ needs.prepare.outputs.path }}
209
209
 
210
210
  build-android:
211
211
  runs-on: ${{ vars.LINUX_INSTANCE }}
212
212
  needs: ['prepare']
213
213
 
214
214
  outputs:
215
- download-url: ${{ steps.deploy-qa-android-application.outputs.download-url }}
215
+ expire: ${{ steps.prepare-environment.outputs.expire }}
216
+ download-url: ${{ steps.result.outputs.download-url }}
216
217
  steps:
217
218
  - name: Checkout
218
219
  uses: actions/checkout@v4
219
- with:
220
- repository: ${{ env.REPOSITORY }}
221
- ref: ${{ env.REFERENCE }}
222
220
 
223
221
  - name: Prepare aws
224
222
  uses: aws-actions/configure-aws-credentials@v4
225
223
  with:
226
- role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
224
+ role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
227
225
  aws-region: ${{ env.AWS_REGION }}
228
226
 
229
227
  - name: Prepare Node
@@ -241,127 +239,219 @@ jobs:
241
239
  cache: 'gradle'
242
240
 
243
241
  - name: Build QA
244
- run: ./scripts/build-qa.sh
242
+ run: |
243
+ ./script/BuildQA.sh
245
244
  env:
246
245
  BUILD_QA: android
246
+ BUILD_NUMBER: ${{ needs.prepare.outputs.build-number }}
247
247
  KEYSTORE: ${{ secrets.KEYSTORE }}
248
248
  KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
249
249
  KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
250
250
  KEYSTORE_ALIAS_PASSWORD: ${{ secrets.KEYSTORE_ALIAS_PASSWORD }}
251
251
 
252
+ - name: prepare environment
253
+ id: prepare-environment
254
+ run: |
255
+ echo "expire=$(date -d '+90 days' '+%Y-%m-%d')" >> $GITHUB_OUTPUT
256
+ shell: bash
257
+
252
258
  - name: Deploy QA Android Application
253
259
  id: deploy-qa-android-application
254
260
  run: |
255
261
  aws s3 cp \
256
- 'build/android-application.apk' \
257
- 's3://${{ vars.INTERNAL_BUCKET }}/build/${{ needs.prepare.outputs.uuid }}/android-application.apk'
262
+ --expires '${{ steps.prepare-environment.outputs.expire }}' \
263
+ 'build/qa/android-application.apk' \
264
+ 's3://${{ env.AWS_BUCKET }}/${{ needs.prepare.outputs.path }}/android-application.apk'
258
265
  aws cloudfront create-invalidation \
259
- --distribution-id '${{ vars.INTERNAL_DISTRIBUTION }}' \
260
- --paths '/build/${{ needs.prepare.outputs.uuid }}/android-application.apk'
261
- echo "download-url=https://sdk-internal.airbridge.io/build/${{ needs.prepare.outputs.uuid }}/android-application.apk" >> $GITHUB_OUTPUT
266
+ --distribution-id ${{ env.DISTRIBUTION_ID }} \
267
+ --paths "/${{ needs.prepare.outputs.path }}/android-application.apk"
268
+
269
+ - name: result
270
+ id: result
271
+ run: |
272
+ echo "download-url=https://${{ env.AWS_DOMAIN }}/${{ needs.prepare.outputs.path }}/android-application.apk" >> $GITHUB_OUTPUT
262
273
 
263
- finish-success:
274
+ report-success:
264
275
  runs-on: ${{ vars.LINUX_INSTANCE }}
265
- needs: ['prepare', 'build-ios', 'build-android']
276
+ needs:
277
+ - prepare
278
+ - build-ios
279
+ - build-android
280
+ if: ${{ always() && needs.prepare.result != 'skipped' && !contains(needs.*.result, 'failure') }}
266
281
 
267
282
  steps:
268
283
  - name: Checkout
269
284
  uses: actions/checkout@v4
270
- with:
271
- repository: ${{ env.REPOSITORY }}
272
- ref: ${{ env.REFERENCE }}
273
-
274
- - name: Report complete to GitHub check
275
- if: env.TRIGGER == 'issue_comment'
276
- uses: ./.github/actions/edit-github-check
277
- with:
278
- check-id: ${{ needs.prepare.outputs.check-id }}
279
- status: completed
280
- conclusion: success
281
285
 
282
- - name: Report complete to GitHub comment
283
- if: env.TRIGGER == 'issue_comment' || env.TRIGGER == 'pull_request'
284
- uses: ./.github/actions/edit-github-comment
285
- with:
286
- comment-id: ${{ needs.prepare.outputs.comment-id }}
287
- comment: "${{
286
+ - name: Generate github message
287
+ id: generate-github-message
288
+ run: |
289
+ echo 'message<<EOF' >> $GITHUB_OUTPUT
290
+ echo "$MESSAGE" >> $GITHUB_OUTPUT
291
+ echo 'EOF' >> $GITHUB_OUTPUT
292
+ env:
293
+ MESSAGE: "${{
288
294
  format(
289
- '{0}\\n{1}\\n{2}\\n\\n{3}',
290
- 'Build is finished.',
295
+ '{0}\\n{1}{2}{3}{4}{5}{6}\\n{7}{8}\\n{9}{10}',
291
296
  format(
292
- '- iOS Application: [Download]({0}), [Install]({1})',
293
- needs.build-ios.outputs.download-url,
294
- needs.build-ios.outputs.install-url
297
+ '*Airbridge React Native SDK Build {0}*\\n',
298
+ needs.prepare.outputs.build-number
295
299
  ),
300
+ env.TRIGGER == 'pull_request' && format(
301
+ '*Pull Request*: [{1}]({0})\\n',
302
+ github.event.pull_request.html_url,
303
+ github.event.pull_request.title
304
+ ) || '',
296
305
  format(
297
- '- Android Application: [Download]({0})',
298
- needs.build-android.outputs.download-url
306
+ '*Type*: {0}\\n',
307
+ env.TYPE
299
308
  ),
300
309
  format(
301
- 'Expire: {0}',
302
- needs.build-ios.outputs.expire
303
- )
304
- )
305
- }}"
306
-
307
- - name: Report complete to Slack
308
- if: env.TRIGGER != 'workflow_call'
309
- uses: ./.github/actions/add-slack-message
310
- with:
311
- message: "${{
312
- format(
313
- '{0}\\n\\n{1}{2}\\n{3}\\n\\n{4}',
310
+ '*Identifier*: {0}\\n',
311
+ needs.prepare.outputs.identifier
312
+ ),
314
313
  format(
315
- 'Airbridge React Native SDK Build - {0}',
316
- env.REFERENCE
314
+ '*Version*: {0}\\n',
315
+ needs.prepare.outputs.build-version
317
316
  ),
318
- (github.event.issue != null || github.event.pull_request.html_url)
319
- && format(
320
- '- Pull Request: <{0}|{1}>\\n',
321
- github.event.issue.url || github.event.pull_request.html_url,
322
- github.event.issue.title || github.event.pull_request.title
323
- )
324
- || '',
325
317
  format(
326
- '- iOS Application: <{0}|Download>, <{1}|Install>',
318
+ '*Commit*: {0}\\n',
319
+ needs.prepare.outputs.commit
320
+ ),
321
+ format(
322
+ '*Tag*: {0}\\n',
323
+ env.TAG
324
+ ),
325
+ format(
326
+ '*iOS Application*: [Download]({0}), [Install]({1})\\n',
327
327
  needs.build-ios.outputs.download-url,
328
328
  needs.build-ios.outputs.install-url
329
329
  ),
330
330
  format(
331
- '- Android Application: <{0}|Download>',
331
+ '*iOS Expire*: {0}\\n',
332
+ needs.build-ios.outputs.expire
333
+ ),
334
+ format(
335
+ '*Android Application*: [Download]({0})\\n',
332
336
  needs.build-android.outputs.download-url
333
337
  ),
334
338
  format(
335
- 'Expire: {0}',
336
- needs.build-ios.outputs.expire
339
+ '*Android Expire*: {0}\\n',
340
+ needs.build-android.outputs.expire
337
341
  )
338
342
  )
339
343
  }}"
344
+
345
+ - name: Generate slack message
346
+ id: generate-slack-message
347
+ uses: ab180/airbridge-sdk-tool/action/replace-markdown@v1
348
+ with:
349
+ message: ${{ steps.generate-github-message.outputs.message }}
350
+ source: github
351
+ destination: slack
352
+
353
+ - name: Report complete to GitHub comment
354
+ if: ${{ env.TRIGGER == 'pull_request' }}
355
+ uses: ab180/airbridge-sdk-tool/action/edit-github-comment@v1
356
+ with:
357
+ comment-id: ${{ needs.prepare.outputs.comment-id }}
358
+ comment: ${{ steps.generate-github-message.outputs.message }}
359
+
360
+ - name: Report complete to Slack
361
+ uses: ab180/airbridge-sdk-tool/action/add-slack-message@v1
362
+ with:
363
+ message: ${{ steps.generate-slack-message.outputs.message }}
340
364
  incoming-webhook-url: ${{ secrets.SLACK_SDK_BUILD_INCOMING_WEBHOOK_URL }}
341
365
 
342
- finish-failure:
343
- runs-on: ${{ vars.LINUX_INSTANCE }}
344
- needs: ['prepare', 'build-ios', 'build-android']
345
- if: failure()
366
+ report-failure:
367
+ runs-on: ubuntu-latest
368
+ needs:
369
+ - prepare
370
+ - build-ios
371
+ - build-android
372
+ if: ${{ always() && needs.prepare.result != 'skipped' && contains(needs.*.result, 'failure') }}
346
373
 
347
374
  steps:
348
375
  - name: Checkout
349
376
  uses: actions/checkout@v4
377
+
378
+ - name: Generate github message
379
+ id: generate-github-message
380
+ run: |
381
+ echo 'message<<EOF' >> $GITHUB_OUTPUT
382
+ echo "$MESSAGE" >> $GITHUB_OUTPUT
383
+ echo 'EOF' >> $GITHUB_OUTPUT
384
+ env:
385
+ MESSAGE: "${{
386
+ format(
387
+ '{0}\\n{1}{2}{3}{4}{5}{6}',
388
+ format(
389
+ '*Airbridge React Native SDK Build fail {0}*\\n',
390
+ needs.prepare.outputs.build-number
391
+ ),
392
+ env.TRIGGER == 'pull_request' && format(
393
+ '*Pull Request*: [{1}]({0})\\n',
394
+ github.event.pull_request.html_url,
395
+ github.event.pull_request.title
396
+ ) || '',
397
+ format(
398
+ '*Type*: {0}\\n',
399
+ env.TYPE
400
+ ),
401
+ format(
402
+ '*Identifier*: {0}\\n',
403
+ needs.prepare.outputs.identifier
404
+ ),
405
+ format(
406
+ '*Version*: {0}\\n',
407
+ needs.prepare.outputs.build-version
408
+ ),
409
+ format(
410
+ '*Commit*: {0}\\n',
411
+ needs.prepare.outputs.commit
412
+ ),
413
+ format(
414
+ '*Tag*: {0}\\n',
415
+ env.TAG
416
+ )
417
+ )
418
+ }}"
419
+
420
+ - name: Generate slack message
421
+ id: generate-slack-message
422
+ uses: ab180/airbridge-sdk-tool/action/replace-markdown@v1
350
423
  with:
351
- repository: ${{ env.REPOSITORY }}
352
- ref: ${{ env.REFERENCE }}
424
+ message: ${{ steps.generate-github-message.outputs.message }}
425
+ source: github
426
+ destination: slack
353
427
 
354
- - name: Report fail to GitHub check
355
- if: (env.TRIGGER == 'issue_comment')
356
- uses: ./.github/actions/edit-github-check
428
+ - name: Report to Slack
429
+ uses: ab180/airbridge-sdk-tool/action/add-slack-message@v1
357
430
  with:
358
- check-id: ${{ needs.prepare.outputs.check-id }}
359
- status: completed
360
- conclusion: failure
431
+ message: ${{ steps.generate-slack-message.outputs.message }}
432
+ incoming-webhook-url: ${{ secrets.SLACK_SDK_BUILD_INCOMING_WEBHOOK_URL }}
361
433
 
362
434
  - name: Report fail to GitHub comment
363
- if: (env.TRIGGER == 'issue_comment' || env.TRIGGER == 'pull_request')
364
- uses: ./.github/actions/edit-github-comment
435
+ if: ${{ env.TRIGGER == 'pull_request' }}
436
+ uses: ab180/airbridge-sdk-tool/action/edit-github-comment@v1
365
437
  with:
366
438
  comment-id: ${{ needs.prepare.outputs.comment-id }}
367
439
  comment: 'Build is failed.'
440
+
441
+ finish:
442
+ runs-on: ubuntu-latest
443
+ needs:
444
+ - prepare
445
+ - report-success
446
+ - report-failure
447
+ if: ${{ always() && needs.prepare.result != 'skipped' }}
448
+
449
+ steps:
450
+ - name: Checkout
451
+ uses: actions/checkout@v4
452
+
453
+ - name: Remove GitHub label
454
+ if: ${{ env.TRIGGER == 'pull_request' }}
455
+ uses: ab180/airbridge-sdk-tool/action/remove-github-label@v1
456
+ with:
457
+ label: '!Build'
@@ -0,0 +1,79 @@
1
+ name: documentation
2
+
3
+ on:
4
+ workflow_run:
5
+ workflows: [ "release" ]
6
+ types:
7
+ - completed
8
+
9
+ workflow_dispatch:
10
+ inputs:
11
+ latest:
12
+ description: 'upload latest version'
13
+ type: boolean
14
+ required: true
15
+ default: true
16
+
17
+ env:
18
+ AWS_REGION: ap-northeast-1
19
+ AWS_ROLE_TO_ASSUME: ${{ secrets.AWS_ROLE_TO_ASSUME }}
20
+ AWS_BUCKET: ${{ vars.REFERENCE_BUCKET }}
21
+ DISTRIBUTION_ID: ${{ vars.REFERENCE_DISTRIBUTION_ID }}
22
+ AWS_BUCKET_PATH: airbridge-react-native-sdk
23
+ IS_LATEST: "${{ github.event.workflow_run.conclusion == 'success' || github.event.inputs.latest }}"
24
+
25
+ jobs:
26
+ documentation:
27
+ if: |
28
+ ${{ github.event.workflow_run.conclusion == 'success' }} ||
29
+ ${{ github.event.inputs.latest != null }}
30
+
31
+ runs-on: ubuntu-latest
32
+
33
+ permissions:
34
+ id-token: write
35
+ contents: read
36
+
37
+ steps:
38
+ - name: clone repository
39
+ uses: actions/checkout@v3
40
+
41
+ - name: Install dependencies
42
+ run: npm ci
43
+
44
+ - name: documentation
45
+ run: |
46
+ sh script/BuildDocument.sh
47
+
48
+ - name: prepare environment
49
+ id: prepare-environment
50
+ run: |
51
+ VERSION_NAME=$(cat package.json | grep version | head -1 | awk -F: '{print $2}' | sed 's/[", ]//g')
52
+ echo "version=$VERSION_NAME" >> $GITHUB_OUTPUT
53
+ shell: bash
54
+
55
+ - name: Configure aws credential for publish
56
+ uses: aws-actions/configure-aws-credentials@v1
57
+ with:
58
+ role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
59
+ aws-region: ${{ env.AWS_REGION }}
60
+
61
+ - name: publish
62
+ run: |
63
+ aws s3 cp \
64
+ build/document/ \
65
+ s3://${{ env.AWS_BUCKET }}/${{ env.AWS_BUCKET_PATH }}/${{ steps.prepare-environment.outputs.version }}/ \
66
+ --recursive
67
+ aws cloudfront create-invalidation \
68
+ --distribution-id ${{ env.DISTRIBUTION_ID }} \
69
+ --paths "/${{ env.AWS_BUCKET_PATH }}/${{ steps.prepare-environment.outputs.version }}/*"
70
+
71
+ - name: publish to latest
72
+ if: ${{ env.IS_LATEST == 'true' }}
73
+ run: |
74
+ aws s3 sync --delete \
75
+ build/document \
76
+ s3://${{ env.AWS_BUCKET }}/${{ env.AWS_BUCKET_PATH }}/latest
77
+ aws cloudfront create-invalidation \
78
+ --distribution-id ${{ env.DISTRIBUTION_ID }} \
79
+ --paths "/${{ env.AWS_BUCKET_PATH }}/latest/*"