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

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 (139) hide show
  1. package/.github/actions/add-github-check/action.yml +78 -0
  2. package/.github/actions/add-github-comment/action.yml +48 -0
  3. package/.github/actions/add-slack-message/action.yml +32 -0
  4. package/.github/actions/edit-github-check/action.yml +59 -0
  5. package/.github/actions/edit-github-comment/action.yml +41 -0
  6. package/.github/pull_request_template.md +5 -0
  7. package/.github/readme.md +53 -0
  8. package/.github/workflows/build.yml +367 -0
  9. package/.github/workflows/gitflow.yml +20 -0
  10. package/.github/workflows/release-restricted.yml +35 -0
  11. package/.github/workflows/release.yml +32 -0
  12. package/android/.settings/org.eclipse.buildship.core.prefs +2 -0
  13. package/android/src/main/java/co/ab180/airbridge/reactnative/AirbridgeRN.java +19 -4
  14. package/android/src/main/java/co/ab180/airbridge/reactnative/ConfigReader.java +63 -40
  15. package/changelog.md +10 -0
  16. package/ios/AirbridgeRN/ARNConfigReader.h +1 -1
  17. package/ios/AirbridgeRN/ARNConfigReader.m +31 -30
  18. package/ios/AirbridgeRN/AirbridgeRN.m +26 -2
  19. package/ios/copy-config.rb +1 -1
  20. package/package.json +1 -1
  21. package/qa/.bundle/config +2 -0
  22. package/qa/.eslintrc.js +4 -0
  23. package/qa/.prettierrc.js +7 -0
  24. package/qa/.watchmanconfig +1 -0
  25. package/qa/Gemfile +9 -0
  26. package/qa/Gemfile.lock +105 -0
  27. package/qa/__tests__/App.test.tsx +17 -0
  28. package/qa/airbridge.json +7 -0
  29. package/qa/android/app/build.gradle +130 -0
  30. package/qa/android/app/debug.keystore +0 -0
  31. package/qa/android/app/google-services.json +29 -0
  32. package/qa/android/app/proguard-rules.pro +10 -0
  33. package/qa/android/app/src/debug/AndroidManifest.xml +9 -0
  34. package/qa/android/app/src/main/AndroidManifest.xml +65 -0
  35. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/ConfigurationLoader.kt +49 -0
  36. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/MainActivity.kt +35 -0
  37. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/MainApplication.kt +46 -0
  38. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/DeviceInfoInteractor.kt +60 -0
  39. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/DeviceInfoUtils.kt +115 -0
  40. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/IdentifiersInteractor.kt +83 -0
  41. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/InstallReferrerInteractor.kt +91 -0
  42. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/ModuleInjector.kt +22 -0
  43. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/PermissionInteractor.kt +55 -0
  44. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/UserInfoInteractor.kt +74 -0
  45. package/qa/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  46. package/qa/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  47. package/qa/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  48. package/qa/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  49. package/qa/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  50. package/qa/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  51. package/qa/android/app/src/main/res/values/strings.xml +3 -0
  52. package/qa/android/app/src/main/res/values/styles.xml +9 -0
  53. package/qa/android/build.gradle +28 -0
  54. package/qa/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  55. package/qa/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  56. package/qa/android/gradle.properties +41 -0
  57. package/qa/android/gradlew +249 -0
  58. package/qa/android/gradlew.bat +92 -0
  59. package/qa/android/settings.gradle +4 -0
  60. package/qa/app.json +4 -0
  61. package/qa/babel.config.js +3 -0
  62. package/qa/index.js +5 -0
  63. package/qa/ios/.xcode.env +11 -0
  64. package/qa/ios/AirbridgeQA/AirbridgeQA.entitlements +17 -0
  65. package/qa/ios/AirbridgeQA/AppDelegate.h +6 -0
  66. package/qa/ios/AirbridgeQA/AppDelegate.mm +123 -0
  67. package/qa/ios/AirbridgeQA/DeviceInfoInteractor.m +14 -0
  68. package/qa/ios/AirbridgeQA/DeviceInfoInteractor.swift +151 -0
  69. package/qa/ios/AirbridgeQA/IdentifiersInteractor.m +14 -0
  70. package/qa/ios/AirbridgeQA/IdentifiersInteractor.swift +40 -0
  71. package/qa/ios/AirbridgeQA/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  72. package/qa/ios/AirbridgeQA/Images.xcassets/Contents.json +6 -0
  73. package/qa/ios/AirbridgeQA/Info.plist +66 -0
  74. package/qa/ios/AirbridgeQA/LaunchScreen.storyboard +47 -0
  75. package/qa/ios/AirbridgeQA/PermissionInteractor.m +14 -0
  76. package/qa/ios/AirbridgeQA/PermissionInteractor.swift +19 -0
  77. package/qa/ios/AirbridgeQA/PrivacyInfo.xcprivacy +39 -0
  78. package/qa/ios/AirbridgeQA/UserInfoInteractor.m +57 -0
  79. package/qa/ios/AirbridgeQA/UserInfoInteractor.swift +49 -0
  80. package/qa/ios/AirbridgeQA/main.m +10 -0
  81. package/qa/ios/AirbridgeQA.xcodeproj/project.pbxproj +790 -0
  82. package/qa/ios/AirbridgeQA.xcodeproj/xcshareddata/xcschemes/AirbridgeQA.xcscheme +88 -0
  83. package/qa/ios/AirbridgeQA.xcworkspace/contents.xcworkspacedata +10 -0
  84. package/qa/ios/AirbridgeQA.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  85. package/qa/ios/AirbridgeQATests/AirbridgeQATests.m +66 -0
  86. package/qa/ios/AirbridgeQATests/Info.plist +24 -0
  87. package/qa/ios/GoogleService-Info.plist +30 -0
  88. package/qa/ios/Library/airbridge-ios-sdk-qa-library.podspec +26 -0
  89. package/qa/ios/Podfile +44 -0
  90. package/qa/ios/Podfile.lock +1634 -0
  91. package/qa/jest.config.js +3 -0
  92. package/qa/metro.config.js +67 -0
  93. package/qa/package-lock.json +14289 -0
  94. package/qa/package.json +47 -0
  95. package/qa/resource/arrow_back.png +0 -0
  96. package/qa/resource/home.png +0 -0
  97. package/qa/resource/info.png +0 -0
  98. package/qa/resource/link.png +0 -0
  99. package/qa/resource/refresh.png +0 -0
  100. package/qa/resource/token.png +0 -0
  101. package/qa/source/App.js +58 -0
  102. package/qa/source/common/Colors.js +20 -0
  103. package/qa/source/common/FCMService.js +94 -0
  104. package/qa/source/common/Native.ts +39 -0
  105. package/qa/source/common/Storage.js +13 -0
  106. package/qa/source/common/Styles.js +39 -0
  107. package/qa/source/component/AttributeEntryInputDialog.js +117 -0
  108. package/qa/source/component/AttributeTypeInputDialog.js +100 -0
  109. package/qa/source/component/ConfirmDialog.js +72 -0
  110. package/qa/source/component/CustomButton.js +50 -0
  111. package/qa/source/component/CustomEventParamsDialog.js +150 -0
  112. package/qa/source/component/CustomTextInput.js +40 -0
  113. package/qa/source/component/EntryInputDialog.js +89 -0
  114. package/qa/source/component/HorizontalPreference.js +46 -0
  115. package/qa/source/component/ImageButton.js +35 -0
  116. package/qa/source/component/InjectInputDialog.js +80 -0
  117. package/qa/source/component/MessageDialog.js +81 -0
  118. package/qa/source/component/UrlInputDialog.js +80 -0
  119. package/qa/source/component/ValueInputDialog.js +80 -0
  120. package/qa/source/component/VerticalPreference.js +42 -0
  121. package/qa/source/navigations/Stack.js +110 -0
  122. package/qa/source/pages/Browse.js +118 -0
  123. package/qa/source/pages/DeviceInfo.js +135 -0
  124. package/qa/source/pages/Event.js +171 -0
  125. package/qa/source/pages/Home.js +136 -0
  126. package/qa/source/pages/Identifiers.js +108 -0
  127. package/qa/source/pages/InstallReferrer.js +64 -0
  128. package/qa/source/pages/Placement.js +38 -0
  129. package/qa/source/pages/RequestPermissions.tsx +41 -0
  130. package/qa/source/pages/UserInfo.js +168 -0
  131. package/qa/source/pages/appInfo.js +22 -0
  132. package/qa/tsconfig.json +3 -0
  133. package/scripts/addiOSFramework.js +48 -0
  134. package/scripts/build-qa.sh +64 -0
  135. package/scripts/change_restricted.sh +21 -0
  136. package/scripts/update_native_version.sh +104 -0
  137. package/source/module/Attribution.ts +60 -0
  138. package/src/State.js +10 -2
  139. package/src/WebInterface.js +1 -1
@@ -0,0 +1,78 @@
1
+ name: 'Add GitHub check'
2
+ description: Add GitHub check
3
+
4
+ inputs:
5
+ owner:
6
+ description: Owner of repository
7
+ type: string
8
+ default: ${context.repo.owner}
9
+ required: false
10
+ repository:
11
+ description: Repository of release
12
+ type: string
13
+ default: ${context.repo.repo}
14
+ required: false
15
+ name:
16
+ description: Name of check
17
+ type: string
18
+ default: ${{ github.workflow }}
19
+ required: false
20
+ pull-request-number:
21
+ description: Pull request of check
22
+ type: string
23
+ default: ${context.issue.number}
24
+ required: false
25
+ detail-url:
26
+ description: Detail URL of check
27
+ type: string
28
+ default: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
29
+ required: false
30
+ conclusion:
31
+ description: Conclusion of check if status is completed (success, failure)
32
+ type: string
33
+ default: 'success'
34
+ required: false
35
+ token:
36
+ description: GitHub Token
37
+ type: string
38
+ required: false
39
+ status:
40
+ description: Status of check (queued, in_progress, completed)
41
+ type: string
42
+ required: true
43
+
44
+ outputs:
45
+ check-id:
46
+ description: ID of added check
47
+ value: ${{ steps.add-check.outputs.result }}
48
+ runs:
49
+ using: 'composite'
50
+ steps:
51
+ - name: Add check
52
+ id: add-check
53
+ uses: actions/github-script@v7
54
+ with:
55
+ script: |
56
+ const { data: { id: id } } = await github.rest.checks.create({
57
+ owner: `${{ inputs.owner }}`,
58
+ repo: `${{ inputs.repository }}`,
59
+ name: `${{ inputs.name }}`,
60
+ head_sha: await (async () => {
61
+ const { data: { head: { sha: sha } } } = await github.rest.pulls.get({
62
+ owner: `${{ inputs.owner }}`,
63
+ repo: `${{ inputs.repository }}`,
64
+ pull_number: `${{ inputs.pull-request-number }}`,
65
+ })
66
+ return sha
67
+ })(),
68
+ details_url: `${{ inputs.detail-url }}`,
69
+ status: `${{ inputs.status }}`,
70
+ conclusion: (() => {
71
+ if (`${{ inputs.status }}` !== 'completed') {
72
+ return undefined
73
+ }
74
+ return `${{ inputs.conclusion }}`
75
+ })(),
76
+ })
77
+ return id
78
+ github-token: ${{ inputs.token || env.GITHUB_TOKEN || github.token }}
@@ -0,0 +1,48 @@
1
+ name: 'Add GitHub comment'
2
+ description: Add GitHub comment
3
+
4
+ inputs:
5
+ issue-number:
6
+ description: Issue to comment
7
+ type: string
8
+ default: ${context.issue.number}
9
+ required: false
10
+ owner:
11
+ description: Owner of repository
12
+ type: string
13
+ default: ${context.repo.owner}
14
+ required: false
15
+ repository:
16
+ description: Repository of release
17
+ type: string
18
+ default: ${context.repo.repo}
19
+ required: false
20
+ token:
21
+ description: GitHub Token
22
+ type: string
23
+ required: false
24
+ comment:
25
+ description: Comment
26
+ type: string
27
+ required: true
28
+
29
+ outputs:
30
+ comment-id:
31
+ description: ID of added comment
32
+ value: ${{ steps.add-comment.outputs.result }}
33
+ runs:
34
+ using: 'composite'
35
+ steps:
36
+ - name: Add comment
37
+ id: add-comment
38
+ uses: actions/github-script@v7
39
+ with:
40
+ script: |
41
+ const { data: { id: id } } = await github.rest.issues.createComment({
42
+ issue_number: `${{ inputs.issue-number }}`,
43
+ owner: `${{ inputs.owner }}`,
44
+ repo: `${{ inputs.repository }}`,
45
+ body: `${{ inputs.comment }}`,
46
+ })
47
+ return id
48
+ github-token: ${{ inputs.token || env.GITHUB_TOKEN || github.token }}
@@ -0,0 +1,32 @@
1
+ name: 'Add Slack message'
2
+ description: Add Slack message
3
+
4
+ inputs:
5
+ incoming-webhook-url:
6
+ description: Slack incoming webhook url to add message
7
+ type: string
8
+ required: true
9
+ message:
10
+ description: Message
11
+ type: string
12
+ required: true
13
+
14
+ runs:
15
+ using: 'composite'
16
+ steps:
17
+ - name: Add Slack message
18
+ uses: slackapi/slack-github-action@v1.25.0
19
+ with:
20
+ payload: |
21
+ {
22
+ "blocks": [{
23
+ "type": "section",
24
+ "text": {
25
+ "type": "mrkdwn",
26
+ "text": "${{ inputs.message }}"
27
+ }
28
+ }]
29
+ }
30
+ env:
31
+ SLACK_WEBHOOK_URL: ${{ inputs.incoming-webhook-url }}
32
+ SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
@@ -0,0 +1,59 @@
1
+ name: 'Edit GitHub check'
2
+ description: Edit GitHub check
3
+
4
+ inputs:
5
+ owner:
6
+ description: Owner of repository
7
+ type: string
8
+ default: ${context.repo.owner}
9
+ required: false
10
+ repository:
11
+ description: Repository of release
12
+ type: string
13
+ default: ${context.repo.repo}
14
+ required: false
15
+ check-id:
16
+ description: Check id to edit
17
+ type: string
18
+ required: true
19
+ detail-url:
20
+ description: Detail URL of check
21
+ type: string
22
+ default: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
23
+ required: false
24
+ conclusion:
25
+ description: Conclusion of check if status is completed (success, failure)
26
+ type: string
27
+ default: 'success'
28
+ required: false
29
+ token:
30
+ description: GitHub Token
31
+ type: string
32
+ required: false
33
+ status:
34
+ description: Status of check (queued, in_progress, completed)
35
+ type: string
36
+ required: true
37
+
38
+ runs:
39
+ using: 'composite'
40
+ steps:
41
+ - name: Edit check
42
+ id: edit-check
43
+ uses: actions/github-script@v7
44
+ with:
45
+ script: |
46
+ await github.rest.checks.update({
47
+ owner: `${{ inputs.owner }}`,
48
+ repo: `${{ inputs.repository }}`,
49
+ check_run_id: `${{ inputs.check-id }}`,
50
+ details_url: `${{ inputs.detail-url }}`,
51
+ status: `${{ inputs.status }}`,
52
+ conclusion: (() => {
53
+ if (`${{ inputs.status }}` !== `completed`) {
54
+ return undefined
55
+ }
56
+ return `${{ inputs.conclusion }}`
57
+ })(),
58
+ })
59
+ github-token: ${{ inputs.token || env.GITHUB_TOKEN || github.token }}
@@ -0,0 +1,41 @@
1
+ name: 'Edit GitHub comment'
2
+ description: Edit GitHub comment
3
+
4
+ inputs:
5
+ owner:
6
+ description: Owner of repository
7
+ type: string
8
+ default: ${context.repo.owner}
9
+ required: false
10
+ repository:
11
+ description: Repository of release
12
+ type: string
13
+ default: ${context.repo.repo}
14
+ required: false
15
+ comment-id:
16
+ description: Comment id to edit
17
+ type: string
18
+ required: true
19
+ token:
20
+ description: GitHub Token
21
+ type: string
22
+ required: false
23
+ comment:
24
+ description: Comment
25
+ type: string
26
+ required: true
27
+
28
+ runs:
29
+ using: 'composite'
30
+ steps:
31
+ - name: Edit comment
32
+ uses: actions/github-script@v7
33
+ with:
34
+ script: |
35
+ await github.rest.issues.updateComment({
36
+ owner: `${{ inputs.owner }}`,
37
+ repo: `${{ inputs.repository }}`,
38
+ comment_id: `${{ inputs.comment-id }}`,
39
+ body: `${{ inputs.comment }}`,
40
+ })
41
+ github-token: ${{ inputs.token || env.GITHUB_TOKEN || github.token }}
@@ -0,0 +1,5 @@
1
+ ## Summary
2
+ -
3
+
4
+ ## Changes
5
+ -
@@ -0,0 +1,53 @@
1
+ # airbridge-react-native-sdk
2
+
3
+ ## Requirements
4
+
5
+ * Xcode
6
+ * Android Studio
7
+ * Cocoapods
8
+ * Node.js
9
+
10
+ ## Test
11
+
12
+ 1. cd qa
13
+ 2. `npm run ios` or `npm run android`
14
+
15
+ > Run application using Xcode or Android Studio can lead below error.
16
+
17
+ ```
18
+ No bundle URL present.
19
+
20
+ Make sure you're running a packager server or have included a .jsbundle file in your application bundle.
21
+ ```
22
+
23
+ ## Deployment
24
+
25
+ ### Release
26
+
27
+ ```
28
+ npm publish
29
+ ```
30
+
31
+ ## Monitoring
32
+
33
+ * Newrelic
34
+ * 접속: https://insights.newrelic.com/
35
+ * Kibana
36
+ * 접속: http://kibana.ab180.co
37
+ * Index pattern: `airbridge-fmt-*-event-results-*`
38
+ * Snowflake
39
+ * 접속: https://sj55259.ap-northeast-1.aws.snowflakecomputing.com/console
40
+
41
+ ## Logging
42
+
43
+ * Kibana
44
+ * 접속: http://kibana.ab180.co
45
+ * Index pattern: `airbridge-sdk-logs*`
46
+
47
+ ## Disability Response Manual
48
+
49
+ ### Revert
50
+
51
+ ```
52
+ npm unpublish airbridge-react-native-sdk@{version}
53
+ ```
@@ -0,0 +1,367 @@
1
+ name: build
2
+
3
+ on:
4
+ workflow_call:
5
+ 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
27
+ outputs:
28
+ expire:
29
+ description: Expire of build
30
+ value: ${{ jobs.build-ios.outputs.expire }}
31
+ version:
32
+ description: Version of build
33
+ value: ${{ jobs.prepare.outputs.version }}
34
+ commit:
35
+ description: Commit hash of build
36
+ value: ${{ jobs.prepare.outputs.commit }}
37
+ qa-ios-application-install-url:
38
+ description: QA iOS Application install URL of build
39
+ value: ${{ jobs.build-ios.outputs.install-url }}
40
+ qa-ios-application-download-url:
41
+ description: QA iOS Application download URL of build
42
+ value: ${{ jobs.build-ios.outputs.download-url }}
43
+ qa-android-application-download-url:
44
+ description: QA Android Application download URL of build
45
+ value: ${{ jobs.build-android.outputs.download-url }}
46
+ issue_comment:
47
+ types:
48
+ - created
49
+ pull_request:
50
+ types: labeled
51
+ workflow_dispatch:
52
+
53
+ env:
54
+ REPOSITORY: ab180/airbridge-react-native-sdk
55
+ TRIGGER: ${{
56
+ (inputs.reference != null) && 'workflow_call'
57
+ || (github.event_name == 'issue_comment') && 'issue_comment'
58
+ || (github.event_name == 'pull_request') && 'pull_request'
59
+ || (github.event_name == 'workflow_dispatch') && 'workflow_dispatch'
60
+ }}
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
66
+ }}
67
+ AWS_REGION: ap-northeast-1
68
+ AWS_ROLE_TO_ASSUME: ${{ secrets.AWS_ROLE_TO_ASSUME }}
69
+ APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
70
+ APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
71
+ APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY }}
72
+ CERTIFICATE_DEVELOPMENT_PRIVATE_KEY: ${{ secrets.CERTIFICATE_DEVELOPMENT_PRIVATE_KEY }}
73
+ CERTIFICATE_DEVELOPMENT_PRIVATE_KEY_PASSWORD: ${{ secrets.CERTIFICATE_DEVELOPMENT_PRIVATE_KEY_PASSWORD }}
74
+ CERTIFICATE_DISTRIBUTION_PRIVATE_KEY: ${{ secrets.CERTIFICATE_DISTRIBUTION_PRIVATE_KEY }}
75
+ CERTIFICATE_DISTRIBUTION_PRIVATE_KEY_PASSWORD: ${{ secrets.CERTIFICATE_DISTRIBUTION_PRIVATE_KEY_PASSWORD }}
76
+
77
+ permissions:
78
+ id-token: write
79
+ contents: read
80
+ pull-requests: write
81
+ checks: write
82
+
83
+ jobs:
84
+ prepare:
85
+ runs-on: ${{ vars.LINUX_INSTANCE }}
86
+ 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')
98
+ )
99
+
100
+ 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
+ version: ${{ steps.prepare-environment.outputs.version }}
105
+ commit: ${{ steps.prepare-environment.outputs.commit }}
106
+ steps:
107
+ - name: Checkout
108
+ uses: actions/checkout@v4
109
+ with:
110
+ repository: ${{ env.REPOSITORY }}
111
+ ref: ${{ env.REFERENCE }}
112
+
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
117
+ with:
118
+ status: in_progress
119
+
120
+ - name: Report start to GitHub comment
121
+ id: report-start-github-comment
122
+ if: env.TRIGGER == 'issue_comment' || env.TRIGGER == 'pull_request'
123
+ uses: ./.github/actions/add-github-comment
124
+ with:
125
+ comment: 'Build is started.'
126
+
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
+ build-ios:
136
+ runs-on: ${{ vars.MACOS_INSTANCE }}
137
+ needs: ['prepare']
138
+
139
+ outputs:
140
+ expire: ${{ steps.deploy-qa-ios-application.outputs.expire }}
141
+ install-url: ${{ steps.deploy-qa-ios-application.outputs.install-url }}
142
+ download-url: ${{ steps.deploy-qa-ios-application.outputs.download-url }}
143
+ steps:
144
+ - name: Checkout
145
+ uses: actions/checkout@v4
146
+ with:
147
+ repository: ${{ env.REPOSITORY }}
148
+ ref: ${{ env.REFERENCE }}
149
+
150
+ - name: Prepare certificate
151
+ uses: ab180/apple-action/prepare-certificate@v3
152
+ with:
153
+ app-store-connect-issuer-id: ${{ env.APP_STORE_CONNECT_ISSUER_ID }}
154
+ app-store-connect-key-id: ${{ env.APP_STORE_CONNECT_KEY_ID }}
155
+ app-store-connect-private-key: ${{ env.APP_STORE_CONNECT_PRIVATE_KEY }}
156
+ certificate-development-private-key: ${{ env.CERTIFICATE_DEVELOPMENT_PRIVATE_KEY }}
157
+ certificate-development-private-key-password: ${{ env.CERTIFICATE_DEVELOPMENT_PRIVATE_KEY_PASSWORD }}
158
+ certificate-distribution-private-key: ${{ env.CERTIFICATE_DISTRIBUTION_PRIVATE_KEY }}
159
+ certificate-distribution-private-key-password: ${{ env.CERTIFICATE_DISTRIBUTION_PRIVATE_KEY_PASSWORD }}
160
+
161
+ - name: Prepare xcode
162
+ uses: ab180/apple-action/prepare-xcodebuild@v3
163
+ with:
164
+ xcbeautify: true
165
+ automatic-signing: true
166
+ app-store-connect-issuer-id: ${{ env.APP_STORE_CONNECT_ISSUER_ID }}
167
+ app-store-connect-key-id: ${{ env.APP_STORE_CONNECT_KEY_ID }}
168
+ app-store-connect-private-key: ${{ env.APP_STORE_CONNECT_PRIVATE_KEY }}
169
+
170
+ - name: Prepare aws
171
+ uses: aws-actions/configure-aws-credentials@v4
172
+ with:
173
+ role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
174
+ aws-region: ${{ env.AWS_REGION }}
175
+
176
+ - name: Prepare Node
177
+ uses: actions/setup-node@v4
178
+ with:
179
+ node-version: 20
180
+ cache: 'npm'
181
+ cache-dependency-path: '**/package-lock.json'
182
+
183
+ - name: Cache CocoaPods
184
+ uses: actions/cache@v4
185
+ with:
186
+ path: |
187
+ qa/ios/Pods
188
+ key: |
189
+ ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
190
+ restore-keys: |
191
+ ${{ runner.os }}-pods-
192
+
193
+ - name: Build QA
194
+ run: ./scripts/build-qa.sh
195
+ env:
196
+ BUILD_QA: ios
197
+
198
+ - name: Deploy QA iOS Application
199
+ id: deploy-qa-ios-application
200
+ uses: ab180/apple-action/deploy-ios-application-to-aws@v3
201
+ with:
202
+ application: build/ios-application.ipa
203
+ application-version: ${{ needs.prepare.outputs.version }}
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 }}
209
+
210
+ build-android:
211
+ runs-on: ${{ vars.LINUX_INSTANCE }}
212
+ needs: ['prepare']
213
+
214
+ outputs:
215
+ download-url: ${{ steps.deploy-qa-android-application.outputs.download-url }}
216
+ steps:
217
+ - name: Checkout
218
+ uses: actions/checkout@v4
219
+ with:
220
+ repository: ${{ env.REPOSITORY }}
221
+ ref: ${{ env.REFERENCE }}
222
+
223
+ - name: Prepare aws
224
+ uses: aws-actions/configure-aws-credentials@v4
225
+ with:
226
+ role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
227
+ aws-region: ${{ env.AWS_REGION }}
228
+
229
+ - name: Prepare Node
230
+ uses: actions/setup-node@v4
231
+ with:
232
+ node-version: 20
233
+ cache: 'npm'
234
+ cache-dependency-path: '**/package-lock.json'
235
+
236
+ - name: Setup Java
237
+ uses: actions/setup-java@v4
238
+ with:
239
+ distribution: 'zulu'
240
+ java-version: '17'
241
+ cache: 'gradle'
242
+
243
+ - name: Build QA
244
+ run: ./scripts/build-qa.sh
245
+ env:
246
+ BUILD_QA: android
247
+ KEYSTORE: ${{ secrets.KEYSTORE }}
248
+ KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
249
+ KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
250
+ KEYSTORE_ALIAS_PASSWORD: ${{ secrets.KEYSTORE_ALIAS_PASSWORD }}
251
+
252
+ - name: Deploy QA Android Application
253
+ id: deploy-qa-android-application
254
+ run: |
255
+ aws s3 cp \
256
+ 'build/android-application.apk' \
257
+ 's3://${{ vars.INTERNAL_BUCKET }}/build/${{ needs.prepare.outputs.uuid }}/android-application.apk'
258
+ 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
262
+
263
+ finish-success:
264
+ runs-on: ${{ vars.LINUX_INSTANCE }}
265
+ needs: ['prepare', 'build-ios', 'build-android']
266
+
267
+ steps:
268
+ - name: Checkout
269
+ 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
+
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: "${{
288
+ format(
289
+ '{0}\\n{1}\\n{2}\\n\\n{3}',
290
+ 'Build is finished.',
291
+ format(
292
+ '- iOS Application: [Download]({0}), [Install]({1})',
293
+ needs.build-ios.outputs.download-url,
294
+ needs.build-ios.outputs.install-url
295
+ ),
296
+ format(
297
+ '- Android Application: [Download]({0})',
298
+ needs.build-android.outputs.download-url
299
+ ),
300
+ 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}',
314
+ format(
315
+ 'Airbridge React Native SDK Build - {0}',
316
+ env.REFERENCE
317
+ ),
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
+ format(
326
+ '- iOS Application: <{0}|Download>, <{1}|Install>',
327
+ needs.build-ios.outputs.download-url,
328
+ needs.build-ios.outputs.install-url
329
+ ),
330
+ format(
331
+ '- Android Application: <{0}|Download>',
332
+ needs.build-android.outputs.download-url
333
+ ),
334
+ format(
335
+ 'Expire: {0}',
336
+ needs.build-ios.outputs.expire
337
+ )
338
+ )
339
+ }}"
340
+ incoming-webhook-url: ${{ secrets.SLACK_SDK_BUILD_INCOMING_WEBHOOK_URL }}
341
+
342
+ finish-failure:
343
+ runs-on: ${{ vars.LINUX_INSTANCE }}
344
+ needs: ['prepare', 'build-ios', 'build-android']
345
+ if: failure()
346
+
347
+ steps:
348
+ - name: Checkout
349
+ uses: actions/checkout@v4
350
+ with:
351
+ repository: ${{ env.REPOSITORY }}
352
+ ref: ${{ env.REFERENCE }}
353
+
354
+ - name: Report fail to GitHub check
355
+ if: (env.TRIGGER == 'issue_comment')
356
+ uses: ./.github/actions/edit-github-check
357
+ with:
358
+ check-id: ${{ needs.prepare.outputs.check-id }}
359
+ status: completed
360
+ conclusion: failure
361
+
362
+ - name: Report fail to GitHub comment
363
+ if: (env.TRIGGER == 'issue_comment' || env.TRIGGER == 'pull_request')
364
+ uses: ./.github/actions/edit-github-comment
365
+ with:
366
+ comment-id: ${{ needs.prepare.outputs.comment-id }}
367
+ comment: 'Build is failed.'