airbridge-react-native-sdk-restricted 4.7.1 → 4.9.0

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 (50) hide show
  1. package/.github/workflows/build_latest.yml +302 -0
  2. package/.github/workflows/pack.yml +345 -0
  3. package/.github/workflows/release.yml +20 -20
  4. package/airbridge_sdk.json +2 -2
  5. package/android/src/main/java/co/ab180/airbridge/reactnative/module/SwitchInteractor.kt +21 -0
  6. package/build/document/assets/navigation.js +1 -1
  7. package/build/document/assets/search.js +1 -1
  8. package/build/document/classes/Airbridge.html +13 -3
  9. package/build/document/enums/AirbridgeTrackingBlocklist.html +9 -0
  10. package/build/document/modules.html +2 -1
  11. package/build/source/Airbridge.d.ts +19 -0
  12. package/build/source/Airbridge.js +22 -0
  13. package/build/source/Airbridge.js.map +1 -1
  14. package/build/source/constant/AirbridgeTrackingBlocklist.d.ts +12 -0
  15. package/build/source/constant/AirbridgeTrackingBlocklist.js +22 -0
  16. package/build/source/constant/AirbridgeTrackingBlocklist.js.map +1 -0
  17. package/build/source/module/Switch.d.ts +5 -0
  18. package/build/source/module/Switch.js +8 -0
  19. package/build/source/module/Switch.js.map +1 -1
  20. package/build/source/module.d.ts +1 -0
  21. package/build/source/module.js +1 -0
  22. package/build/source/module.js.map +1 -1
  23. package/changelog.md +18 -0
  24. package/ios/AirbridgeReactNative/Extension/AirbridgeOptionBuilderApply.swift +7 -0
  25. package/ios/AirbridgeReactNative/Module/AirbridgeModuleExtern.m +4 -0
  26. package/ios/AirbridgeReactNative/Module/SwitchInteractor.swift +23 -0
  27. package/package.json +1 -1
  28. package/qa/airbridge.json +2 -1
  29. package/qa/android/app/src/main/AndroidManifest.xml +6 -43
  30. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/ConfigurationLoader.kt +41 -20
  31. package/qa/android/app/src/main/java/co/ab180/airbridge/qa/application/module/TestUiInteractor.kt +2 -2
  32. package/qa/ios/AirbridgeQA/AirbridgeJSONSwizzler.swift +43 -7
  33. package/qa/ios/AirbridgeQA/AirbridgeQA.entitlements +2 -5
  34. package/qa/ios/AirbridgeQA/AppDelegate.mm +3 -2
  35. package/qa/ios/AirbridgeQA/Bridging-Header.h +1 -0
  36. package/qa/ios/AirbridgeQA/Info.plist +8 -0
  37. package/qa/ios/AirbridgeQA/QANativeLog.m +19 -0
  38. package/qa/ios/AirbridgeQA/QANativeLog.swift +21 -0
  39. package/qa/ios/AirbridgeQA.xcodeproj/project.pbxproj +11 -1
  40. package/qa/ios/Podfile.lock +16 -16
  41. package/qa/package-lock.json +8629 -2076
  42. package/qa/source/common/QALog.js +4 -2
  43. package/qa/source/navigations/Stack.js +7 -0
  44. package/qa/source/pages/BlockingList.js +52 -0
  45. package/qa/source/pages/Home.js +6 -1
  46. package/source/Airbridge.ts +23 -0
  47. package/source/constant/AirbridgeTrackingBlocklist.ts +27 -0
  48. package/source/module/Switch.ts +14 -0
  49. package/source/module.ts +1 -0
  50. package/qa/ios/AirbridgeQA.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
@@ -0,0 +1,302 @@
1
+ name: build_latest
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ env:
7
+ AWS_REGION: ${{ vars.AWS_REGION }}
8
+ AWS_BUCKET: ${{ vars.INTERNAL_BUCKET }}
9
+ AWS_DOMAIN: ${{ vars.INTERNAL_BUCKET_DOMAIN }}
10
+ DISTRIBUTION_ID: ${{ vars.INTERNAL_DISTRIBUTION }}
11
+
12
+ permissions:
13
+ id-token: write
14
+ contents: read
15
+ pull-requests: write
16
+ checks: write
17
+
18
+ jobs:
19
+ prepare:
20
+ runs-on: ${{ vars.LINUX_INSTANCE }}
21
+
22
+ outputs:
23
+ version: ${{ steps.prepare-environment.outputs.version }}
24
+ commit: ${{ steps.prepare-environment.outputs.commit }}
25
+ branch: ${{ steps.prepare-environment.outputs.branch }}
26
+ path: ${{ steps.prepare-environment.outputs.path }}
27
+
28
+ steps:
29
+ - name: Checkout
30
+ uses: actions/checkout@v4
31
+
32
+ - name: Prepare environment
33
+ id: prepare-environment
34
+ run: |
35
+ echo "version=$(grep -E '"version": *"[^"]+"' package.json | awk -F '"' '{print $4}')" >> $GITHUB_OUTPUT
36
+ echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
37
+ echo "branch=$(git branch --show-current)" >> $GITHUB_OUTPUT
38
+ echo "path=build/latest" >> $GITHUB_OUTPUT
39
+
40
+ build-ios:
41
+ runs-on: ${{ vars.MACOS_INSTANCE }}
42
+ needs: ['prepare']
43
+
44
+ env:
45
+ OUTPUT: reactV4.ipa
46
+
47
+ steps:
48
+ - name: Checkout
49
+ uses: actions/checkout@v4
50
+
51
+ - name: Prepare certificate
52
+ uses: ab180/apple-action/prepare-certificate@v3
53
+ with:
54
+ app-store-connect-issuer-id: ${{ env.APP_STORE_CONNECT_ISSUER_ID }}
55
+ app-store-connect-key-id: ${{ env.APP_STORE_CONNECT_KEY_ID }}
56
+ app-store-connect-private-key: ${{ env.APP_STORE_CONNECT_PRIVATE_KEY }}
57
+ certificate-development-private-key: ${{ env.CERTIFICATE_DEVELOPMENT_PRIVATE_KEY }}
58
+ certificate-development-private-key-password: ${{ env.CERTIFICATE_DEVELOPMENT_PRIVATE_KEY_PASSWORD }}
59
+ certificate-distribution-private-key: ${{ env.CERTIFICATE_DISTRIBUTION_PRIVATE_KEY }}
60
+ certificate-distribution-private-key-password: ${{ env.CERTIFICATE_DISTRIBUTION_PRIVATE_KEY_PASSWORD }}
61
+
62
+ - name: Prepare xcode
63
+ uses: ab180/apple-action/prepare-xcodebuild@v3
64
+ with:
65
+ xcbeautify: true
66
+ automatic-signing: true
67
+ app-store-connect-issuer-id: ${{ env.APP_STORE_CONNECT_ISSUER_ID }}
68
+ app-store-connect-key-id: ${{ env.APP_STORE_CONNECT_KEY_ID }}
69
+ app-store-connect-private-key: ${{ env.APP_STORE_CONNECT_PRIVATE_KEY }}
70
+
71
+ - name: Prepare aws
72
+ uses: aws-actions/configure-aws-credentials@v4
73
+ with:
74
+ role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
75
+ aws-region: ${{ env.AWS_REGION }}
76
+
77
+ - name: Prepare Node
78
+ uses: actions/setup-node@v4
79
+ with:
80
+ node-version: 20
81
+ cache: 'npm'
82
+ cache-dependency-path: '**/package-lock.json'
83
+
84
+ - name: Cache CocoaPods
85
+ uses: actions/cache@v4
86
+ with:
87
+ path: |
88
+ qa/ios/Pods
89
+ key: |
90
+ ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
91
+ restore-keys: |
92
+ ${{ runner.os }}-pods-
93
+
94
+ - name: Build QA
95
+ run: |
96
+ ./script/BuildQA.sh
97
+ env:
98
+ BUILD_QA: ios
99
+ BUILD_OUTPUT: ${{ env.OUTPUT }}
100
+
101
+ - name: Deploy QA iOS Application
102
+ id: deploy-qa-ios-application
103
+ uses: ab180/apple-action/deploy-ios-application-to-aws@v3
104
+ with:
105
+ application: build/qa/${{ env.OUTPUT }}
106
+ application-version: ${{ needs.prepare.outputs.version }}
107
+ application-identifier: co.ab180.airbridge.qa.application
108
+ bucket: ${{ env.AWS_BUCKET }}
109
+ distribution: ${{ env.DISTRIBUTION_ID }}
110
+ domain: ${{ env.AWS_DOMAIN }}
111
+ directory: ${{ needs.prepare.outputs.path }}
112
+
113
+ build-ios-restricted:
114
+ runs-on: ${{ vars.MACOS_INSTANCE }}
115
+ needs: ['prepare']
116
+
117
+ env:
118
+ OUTPUT: reactV4-restricted.ipa
119
+
120
+ steps:
121
+ - name: Checkout
122
+ uses: actions/checkout@v4
123
+
124
+ - name: Prepare certificate
125
+ uses: ab180/apple-action/prepare-certificate@v3
126
+ with:
127
+ app-store-connect-issuer-id: ${{ env.APP_STORE_CONNECT_ISSUER_ID }}
128
+ app-store-connect-key-id: ${{ env.APP_STORE_CONNECT_KEY_ID }}
129
+ app-store-connect-private-key: ${{ env.APP_STORE_CONNECT_PRIVATE_KEY }}
130
+ certificate-development-private-key: ${{ env.CERTIFICATE_DEVELOPMENT_PRIVATE_KEY }}
131
+ certificate-development-private-key-password: ${{ env.CERTIFICATE_DEVELOPMENT_PRIVATE_KEY_PASSWORD }}
132
+ certificate-distribution-private-key: ${{ env.CERTIFICATE_DISTRIBUTION_PRIVATE_KEY }}
133
+ certificate-distribution-private-key-password: ${{ env.CERTIFICATE_DISTRIBUTION_PRIVATE_KEY_PASSWORD }}
134
+
135
+ - name: Prepare xcode
136
+ uses: ab180/apple-action/prepare-xcodebuild@v3
137
+ with:
138
+ xcbeautify: true
139
+ automatic-signing: true
140
+ app-store-connect-issuer-id: ${{ env.APP_STORE_CONNECT_ISSUER_ID }}
141
+ app-store-connect-key-id: ${{ env.APP_STORE_CONNECT_KEY_ID }}
142
+ app-store-connect-private-key: ${{ env.APP_STORE_CONNECT_PRIVATE_KEY }}
143
+
144
+ - name: Prepare aws
145
+ uses: aws-actions/configure-aws-credentials@v4
146
+ with:
147
+ role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
148
+ aws-region: ${{ env.AWS_REGION }}
149
+
150
+ - name: Prepare Node
151
+ uses: actions/setup-node@v4
152
+ with:
153
+ node-version: 20
154
+ cache: 'npm'
155
+ cache-dependency-path: '**/package-lock.json'
156
+
157
+ - name: Cache CocoaPods
158
+ uses: actions/cache@v4
159
+ with:
160
+ path: |
161
+ qa/ios/Pods
162
+ key: |
163
+ ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
164
+ restore-keys: |
165
+ ${{ runner.os }}-pods-
166
+
167
+ - name: prepare ChangeRestricted
168
+ run: |
169
+ rm ./qa/package-lock.json
170
+ ./script/ChangeRestricted.sh
171
+ cd qa
172
+ npm install
173
+
174
+ - name: Build QA
175
+ run: |
176
+ ./script/BuildQA.sh
177
+ env:
178
+ BUILD_QA: ios
179
+ BUILD_OUTPUT: ${{ env.OUTPUT }}
180
+
181
+ - name: Deploy QA iOS Application
182
+ id: deploy-qa-ios-application
183
+ uses: ab180/apple-action/deploy-ios-application-to-aws@v3
184
+ with:
185
+ application: build/qa/${{ env.OUTPUT }}
186
+ application-version: ${{ needs.prepare.outputs.version }}
187
+ application-identifier: co.ab180.airbridge.qa.application
188
+ bucket: ${{ env.AWS_BUCKET }}
189
+ distribution: ${{ env.DISTRIBUTION_ID }}
190
+ domain: ${{ env.AWS_DOMAIN }}
191
+ directory: ${{ needs.prepare.outputs.path }}
192
+
193
+ build-android:
194
+ runs-on: ${{ vars.LINUX_INSTANCE }}
195
+ needs: ['prepare']
196
+
197
+ env:
198
+ OUTPUT: reactV4.apk
199
+
200
+ steps:
201
+ - name: Checkout
202
+ uses: actions/checkout@v4
203
+
204
+ - name: Prepare aws
205
+ uses: aws-actions/configure-aws-credentials@v4
206
+ with:
207
+ role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
208
+ aws-region: ${{ env.AWS_REGION }}
209
+
210
+ - name: Prepare Node
211
+ uses: actions/setup-node@v4
212
+ with:
213
+ node-version: 20
214
+ cache: 'npm'
215
+ cache-dependency-path: '**/package-lock.json'
216
+
217
+ - name: Setup Java
218
+ uses: actions/setup-java@v4
219
+ with:
220
+ distribution: 'zulu'
221
+ java-version: '17'
222
+ cache: 'gradle'
223
+
224
+ - name: Build QA
225
+ run: |
226
+ ./script/BuildQA.sh
227
+ env:
228
+ BUILD_QA: android
229
+ BUILD_OUTPUT: ${{ env.OUTPUT }}
230
+ KEYSTORE: ${{ secrets.KEYSTORE }}
231
+ KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
232
+ KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
233
+ KEYSTORE_ALIAS_PASSWORD: ${{ secrets.KEYSTORE_ALIAS_PASSWORD }}
234
+
235
+ - name: Deploy QA Android Application
236
+ id: deploy-qa-android-application
237
+ run: |
238
+ aws s3 cp \
239
+ 'build/qa/${{ env.OUTPUT }}' \
240
+ 's3://${{ env.AWS_BUCKET }}/${{ needs.prepare.outputs.path }}/${{ env.OUTPUT }}'
241
+ aws cloudfront create-invalidation \
242
+ --distribution-id ${{ env.DISTRIBUTION_ID }} \
243
+ --paths "/${{ needs.prepare.outputs.path }}/${{ env.OUTPUT }}"
244
+
245
+ build-android-restricted:
246
+ runs-on: ${{ vars.LINUX_INSTANCE }}
247
+ needs: ['prepare']
248
+
249
+ env:
250
+ OUTPUT: reactV4-restricted.apk
251
+
252
+ steps:
253
+ - name: Checkout
254
+ uses: actions/checkout@v4
255
+
256
+ - name: Prepare aws
257
+ uses: aws-actions/configure-aws-credentials@v4
258
+ with:
259
+ role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
260
+ aws-region: ${{ env.AWS_REGION }}
261
+
262
+ - name: Prepare Node
263
+ uses: actions/setup-node@v4
264
+ with:
265
+ node-version: 20
266
+ cache: 'npm'
267
+ cache-dependency-path: '**/package-lock.json'
268
+
269
+ - name: Setup Java
270
+ uses: actions/setup-java@v4
271
+ with:
272
+ distribution: 'zulu'
273
+ java-version: '17'
274
+ cache: 'gradle'
275
+
276
+ - name: prepare ChangeRestricted
277
+ run: |
278
+ rm ./qa/package-lock.json
279
+ ./script/ChangeRestricted.sh
280
+ cd qa
281
+ npm install
282
+
283
+ - name: Build QA
284
+ run: |
285
+ ./script/BuildQA.sh
286
+ env:
287
+ BUILD_QA: android
288
+ BUILD_OUTPUT: ${{ env.OUTPUT }}
289
+ KEYSTORE: ${{ secrets.KEYSTORE }}
290
+ KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
291
+ KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
292
+ KEYSTORE_ALIAS_PASSWORD: ${{ secrets.KEYSTORE_ALIAS_PASSWORD }}
293
+
294
+ - name: Deploy QA Android Application
295
+ id: deploy-qa-android-application
296
+ run: |
297
+ aws s3 cp \
298
+ 'build/qa/${{ env.OUTPUT }}' \
299
+ 's3://${{ env.AWS_BUCKET }}/${{ needs.prepare.outputs.path }}/${{ env.OUTPUT }}'
300
+ aws cloudfront create-invalidation \
301
+ --distribution-id ${{ env.DISTRIBUTION_ID }} \
302
+ --paths "/${{ needs.prepare.outputs.path }}/${{ env.OUTPUT }}"
@@ -0,0 +1,345 @@
1
+ name: build
2
+
3
+ on:
4
+ pull_request:
5
+ types: [labeled]
6
+
7
+ workflow_dispatch:
8
+
9
+ env:
10
+ TRIGGER: ${{
11
+ (github.event_name == 'pull_request') && 'pull_request'
12
+ || (github.event_name == 'workflow_dispatch') && 'workflow_dispatch'
13
+ }}
14
+ BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
15
+ TYPE: ${{
16
+ (
17
+ startsWith(github.event.pull_request.head.ref || github.ref_name, 'release/')
18
+ || startsWith(github.event.pull_request.head.ref || github.ref_name, 'hotfix/')
19
+ )
20
+ && 'Release'
21
+ || 'Feature'
22
+ }}
23
+ TAG: ${{
24
+ format(
25
+ '@{0} {1}',
26
+ github.event.pull_request.user.login || github.actor,
27
+ github.event_name == 'pull_request' && join(github.event.pull_request.requested_reviewers.*.login, '') != ''
28
+ && format('@{0}', join(github.event.pull_request.requested_reviewers.*.login, ' @'))
29
+ || ''
30
+ )
31
+ }}
32
+
33
+ AWS_REGION: ${{ vars.AWS_REGION }}
34
+ AWS_BUCKET: ${{ vars.INTERNAL_BUCKET }}
35
+ AWS_DOMAIN: ${{ vars.INTERNAL_BUCKET_DOMAIN }}
36
+ DISTRIBUTION_ID: ${{ vars.INTERNAL_DISTRIBUTION }}
37
+
38
+ permissions:
39
+ id-token: write
40
+ contents: read
41
+ pull-requests: write
42
+ checks: write
43
+
44
+ jobs:
45
+ prepare:
46
+ runs-on: ${{ vars.LINUX_INSTANCE }}
47
+ if: (
48
+ github.event_name == 'pull_request'
49
+ && github.event.label.name == '!Pack'
50
+ )
51
+ || (github.event_name == 'workflow_dispatch')
52
+
53
+ outputs:
54
+ version: ${{ steps.prepare-environment.outputs.version }}
55
+ commit: ${{ steps.prepare-environment.outputs.commit }}
56
+ branch: ${{ steps.prepare-environment.outputs.branch }}
57
+
58
+ build-number: ${{ steps.prepare-build-number.outputs.build-number }}
59
+
60
+ build-version: ${{ steps.prepare-build.outputs.build-version }}
61
+ identifier: ${{ steps.prepare-build.outputs.identifier }}
62
+ path: ${{ steps.prepare-build.outputs.path }}
63
+
64
+ comment-id: ${{ steps.report-start-github-comment.outputs.comment-id }}
65
+
66
+ steps:
67
+ - name: Checkout
68
+ uses: actions/checkout@v4
69
+
70
+ - name: Prepare environment
71
+ id: prepare-environment
72
+ run: |
73
+ echo "version=$(grep -E '"version": *"[^"]+"' package.json | awk -F '"' '{print $4}')" >> $GITHUB_OUTPUT
74
+ echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
75
+ echo "branch=$(git branch --show-current)" >> $GITHUB_OUTPUT
76
+
77
+ - name: Prepare build number
78
+ id: prepare-build-number
79
+ uses: ab180/airbridge-sdk-tool/action/prepare-github-build-number@v1
80
+ with:
81
+ github-app-id: ${{ secrets.SDK_TEAM_APP_ID }}
82
+ github-app-private-key: ${{ secrets.SDK_TEAM_APP_PRIVATE_KEY }}
83
+ github-app-owner: ab180
84
+
85
+ - name: prepare build
86
+ id: prepare-build
87
+ run: |
88
+ echo "build-version=${{ steps.prepare-build-number.outputs.build-number }},Android,${{ steps.prepare-environment.outputs.version }},${{ steps.prepare-environment.outputs.branch }}" >> $GITHUB_OUTPUT
89
+ IDENTIFIER='${{ steps.prepare-environment.outputs.version }}-build-${{ steps.prepare-build-number.outputs.build-number }}'
90
+ echo "identifier=$IDENTIFIER" >> $GITHUB_OUTPUT
91
+ echo "path=build/${{ github.event.repository.name }}/$IDENTIFIER" >> $GITHUB_OUTPUT
92
+
93
+ - name: Report start to GitHub comment
94
+ id: report-start-github-comment
95
+ if: env.TRIGGER == 'pull_request'
96
+ uses: ab180/airbridge-sdk-tool/action/add-github-comment@v1
97
+ with:
98
+ comment: 'Pack is started.'
99
+
100
+ pack:
101
+ runs-on: ubuntu-latest
102
+ needs: ['prepare']
103
+
104
+ env:
105
+ PACK_NAME: airbridge-react-native-sdk
106
+
107
+ steps:
108
+ - name: Checkout
109
+ uses: actions/checkout@v3
110
+
111
+ - name: Prepare node
112
+ uses: actions/setup-node@v3
113
+ with:
114
+ node-version: 18
115
+ registry-url: 'https://registry.npmjs.org'
116
+
117
+ - name: Install dependencies
118
+ run: npm ci
119
+
120
+ - name: Pack
121
+ run: npm pack
122
+
123
+ - name: Deploy Pack
124
+ id: deploy-pack
125
+ run: |
126
+ aws s3 cp \
127
+ '${{ env.PACK_NAME }}-${{ needs.prepare.outputs.build-version }}.tgz' \
128
+ 's3://${{ env.AWS_BUCKET }}/${{ needs.prepare.outputs.path }}/${{ env.PACK_NAME }}.tgz'
129
+ aws cloudfront create-invalidation \
130
+ --distribution-id ${{ env.DISTRIBUTION_ID }} \
131
+ --paths "/${{ needs.prepare.outputs.path }}/${{ env.PACK_NAME }}.tgz"
132
+
133
+ - name: result
134
+ id: result
135
+ run: |
136
+ echo "download-url=https://${{ env.AWS_DOMAIN }}/${{ needs.prepare.outputs.path }}/${{ env.PACK_NAME }}.tgz" >> $GITHUB_OUTPUT
137
+
138
+ pack-restricted:
139
+ runs-on: ubuntu-latest
140
+ needs: ['prepare']
141
+
142
+ env:
143
+ PACK_NAME: airbridge-react-native-sdk-restricted
144
+
145
+ steps:
146
+ - name: Checkout
147
+ uses: actions/checkout@v3
148
+
149
+ - name: Prepare node
150
+ uses: actions/setup-node@v3
151
+ with:
152
+ node-version: 18
153
+ registry-url: 'https://registry.npmjs.org'
154
+
155
+ - name: Install dependencies
156
+ run: npm ci
157
+
158
+ - name: change restricted
159
+ run: sh script/ChangeRestricted.sh
160
+
161
+ - name: Pack
162
+ run: npm pack
163
+
164
+ - name: Deploy Pack
165
+ id: deploy-pack
166
+ run: |
167
+ aws s3 cp \
168
+ '${{ env.PACK_NAME }}-${{ needs.prepare.outputs.build-version }}.tgz' \
169
+ 's3://${{ env.AWS_BUCKET }}/${{ needs.prepare.outputs.path }}/${{ env.PACK_NAME }}.tgz'
170
+ aws cloudfront create-invalidation \
171
+ --distribution-id ${{ env.DISTRIBUTION_ID }} \
172
+ --paths "/${{ needs.prepare.outputs.path }}/${{ env.PACK_NAME }}.tgz"
173
+
174
+ - name: result
175
+ id: result
176
+ run: |
177
+ echo "download-url=https://${{ env.AWS_DOMAIN }}/${{ needs.prepare.outputs.path }}/${{ env.PACK_NAME }}.tgz" >> $GITHUB_OUTPUT
178
+
179
+ report-success:
180
+ runs-on: ${{ vars.LINUX_INSTANCE }}
181
+ needs:
182
+ - prepare
183
+ - pack
184
+ - pack-restricted
185
+ if: ${{ always() && needs.prepare.result != 'skipped' && !contains(needs.*.result, 'failure') }}
186
+
187
+ steps:
188
+ - name: Checkout
189
+ uses: actions/checkout@v4
190
+
191
+ - name: Generate github message
192
+ id: generate-github-message
193
+ run: |
194
+ echo 'message<<EOF' >> $GITHUB_OUTPUT
195
+ echo "$MESSAGE" >> $GITHUB_OUTPUT
196
+ echo 'EOF' >> $GITHUB_OUTPUT
197
+ env:
198
+ MESSAGE: "${{
199
+ format(
200
+ '{0}\\n{1}{2}{3}{4}{5}{6}',
201
+ format(
202
+ '*Airbridge React Native SDK Pack Build {0}*\\n',
203
+ needs.prepare.outputs.build-number
204
+ ),
205
+ env.TRIGGER == 'pull_request' && format(
206
+ '*Pull Request*: [{1}]({0})\\n',
207
+ github.event.pull_request.html_url,
208
+ github.event.pull_request.title
209
+ ) || '',
210
+ format(
211
+ '*Type*: {0}\\n',
212
+ env.TYPE
213
+ ),
214
+ format(
215
+ '*Identifier*: {0}\\n',
216
+ needs.prepare.outputs.identifier
217
+ ),
218
+ format(
219
+ '*Version*: {0}\\n',
220
+ needs.prepare.outputs.build-version
221
+ ),
222
+ format(
223
+ '*Commit*: {0}\\n',
224
+ needs.prepare.outputs.commit
225
+ ),
226
+ format(
227
+ '*Tag*: {0}\\n',
228
+ env.TAG
229
+ )
230
+ )
231
+ }}"
232
+
233
+ - name: Generate slack message
234
+ id: generate-slack-message
235
+ uses: ab180/airbridge-sdk-tool/action/replace-markdown@v1
236
+ with:
237
+ message: ${{ steps.generate-github-message.outputs.message }}
238
+ source: github
239
+ destination: slack
240
+
241
+ - name: Report complete to GitHub comment
242
+ if: ${{ env.TRIGGER == 'pull_request' }}
243
+ uses: ab180/airbridge-sdk-tool/action/edit-github-comment@v1
244
+ with:
245
+ comment-id: ${{ needs.prepare.outputs.comment-id }}
246
+ comment: ${{ steps.generate-github-message.outputs.message }}
247
+
248
+ - name: Report complete to Slack
249
+ uses: ab180/airbridge-sdk-tool/action/add-slack-message@v1
250
+ with:
251
+ message: ${{ steps.generate-slack-message.outputs.message }}
252
+ incoming-webhook-url: ${{ secrets.SLACK_SDK_BUILD_INCOMING_WEBHOOK_URL }}
253
+
254
+ report-failure:
255
+ runs-on: ubuntu-latest
256
+ needs:
257
+ - prepare
258
+ - pack
259
+ - pack-restricted
260
+ if: ${{ always() && needs.prepare.result != 'skipped' && contains(needs.*.result, 'failure') }}
261
+
262
+ steps:
263
+ - name: Checkout
264
+ uses: actions/checkout@v4
265
+
266
+ - name: Generate github message
267
+ id: generate-github-message
268
+ run: |
269
+ echo 'message<<EOF' >> $GITHUB_OUTPUT
270
+ echo "$MESSAGE" >> $GITHUB_OUTPUT
271
+ echo 'EOF' >> $GITHUB_OUTPUT
272
+ env:
273
+ MESSAGE: "${{
274
+ format(
275
+ '{0}\\n{1}{2}{3}{4}{5}{6}',
276
+ format(
277
+ '*Airbridge React Native SDK Build fail {0}*\\n',
278
+ needs.prepare.outputs.build-number
279
+ ),
280
+ env.TRIGGER == 'pull_request' && format(
281
+ '*Pull Request*: [{1}]({0})\\n',
282
+ github.event.pull_request.html_url,
283
+ github.event.pull_request.title
284
+ ) || '',
285
+ format(
286
+ '*Type*: {0}\\n',
287
+ env.TYPE
288
+ ),
289
+ format(
290
+ '*Identifier*: {0}\\n',
291
+ needs.prepare.outputs.identifier
292
+ ),
293
+ format(
294
+ '*Version*: {0}\\n',
295
+ needs.prepare.outputs.build-version
296
+ ),
297
+ format(
298
+ '*Commit*: {0}\\n',
299
+ needs.prepare.outputs.commit
300
+ ),
301
+ format(
302
+ '*Tag*: {0}\\n',
303
+ env.TAG
304
+ )
305
+ )
306
+ }}"
307
+
308
+ - name: Generate slack message
309
+ id: generate-slack-message
310
+ uses: ab180/airbridge-sdk-tool/action/replace-markdown@v1
311
+ with:
312
+ message: ${{ steps.generate-github-message.outputs.message }}
313
+ source: github
314
+ destination: slack
315
+
316
+ - name: Report to Slack
317
+ uses: ab180/airbridge-sdk-tool/action/add-slack-message@v1
318
+ with:
319
+ message: ${{ steps.generate-slack-message.outputs.message }}
320
+ incoming-webhook-url: ${{ secrets.SLACK_SDK_BUILD_INCOMING_WEBHOOK_URL }}
321
+
322
+ - name: Report fail to GitHub comment
323
+ if: ${{ env.TRIGGER == 'pull_request' }}
324
+ uses: ab180/airbridge-sdk-tool/action/edit-github-comment@v1
325
+ with:
326
+ comment-id: ${{ needs.prepare.outputs.comment-id }}
327
+ comment: 'Pack is failed.'
328
+
329
+ finish:
330
+ runs-on: ubuntu-latest
331
+ needs:
332
+ - prepare
333
+ - report-success
334
+ - report-failure
335
+ if: ${{ always() && needs.prepare.result != 'skipped' }}
336
+
337
+ steps:
338
+ - name: Checkout
339
+ uses: actions/checkout@v4
340
+
341
+ - name: Remove GitHub label
342
+ if: ${{ env.TRIGGER == 'pull_request' }}
343
+ uses: ab180/airbridge-sdk-tool/action/remove-github-label@v1
344
+ with:
345
+ label: '!Pack'