@@ -126,8 +126,9 @@ jobs:
126
126
127
127
aws cloudfront wait invalidation-completed --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --id "$invalidation_id"
128
128
129
- - name : Sync files to S3
129
+ - name : Copy SDK artifacts to S3
130
130
run : |
131
+ core_sdk_path_prefix="packages/analytics-js/dist/cdn"
131
132
integration_sdks_path_prefix="packages/analytics-js-integrations/dist/cdn"
132
133
plugins_path_prefix="packages/analytics-js-plugins/dist/cdn"
133
134
s3_relative_path_prefix="${{ inputs.s3_dir_path }}"
@@ -155,8 +156,10 @@ jobs:
155
156
mv "$tmp_file" "$plugins_path_prefix/modern/plugins/$plugins_zip_file"
156
157
157
158
# Upload all the files to S3
158
- aws s3 cp $integration_sdks_path_prefix/legacy/js-integrations/ $s3_path_prefix/legacy/js-integrations/ $copy_args
159
+ aws s3 cp $core_sdk_path_prefix/legacy/iife/ $s3_path_prefix/legacy/ $copy_args
160
+ aws s3 cp $core_sdk_path_prefix/modern/iife/ $s3_path_prefix/modern/ $copy_args
159
161
162
+ aws s3 cp $integration_sdks_path_prefix/legacy/js-integrations/ $s3_path_prefix/legacy/js-integrations/ $copy_args
160
163
aws s3 cp $plugins_path_prefix/modern/plugins/ $s3_path_prefix/modern/plugins/ $copy_args
161
164
aws s3 cp $integration_sdks_path_prefix/modern/js-integrations/ $s3_path_prefix/modern/js-integrations/ $copy_args
162
165
@@ -173,26 +176,16 @@ jobs:
173
176
aws s3 cp $integration_sdks_path_prefix/modern/js-integrations/$integration_sdks_html_file $s3_path_prefix/modern/js-integrations/$integration_sdks_html_file $copy_args
174
177
aws s3 cp $plugins_path_prefix/modern/plugins/$plugins_html_file $s3_path_prefix/modern/plugins/$plugins_html_file $copy_args
175
178
176
- - name : Copy core SDK artifacts to S3
177
- run : |
178
- core_sdk_path_prefix="packages/analytics-js/dist/cdn"
179
- s3_relative_path_prefix="${{ inputs.s3_dir_path }}"
180
- s3_path_prefix="s3://${{ secrets.AWS_S3_BUCKET_NAME }}/$s3_relative_path_prefix"
181
- copy_args="--recursive --cache-control ${{ env.CACHE_CONTROL_NO_STORE }}"
182
-
183
- # Upload all the files to S3
184
- aws s3 cp $core_sdk_path_prefix/legacy/iife/ $s3_path_prefix/legacy/ $copy_args
185
- aws s3 cp $core_sdk_path_prefix/modern/iife/ $s3_path_prefix/modern/ $copy_args
186
-
187
179
- name : Invalidate CloudFront cache for all the SDK artifacts
188
180
run : |
189
181
invalidation_id=$(AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/${{ inputs.s3_dir_path }}/*" --query "Invalidation.Id" --output text)
190
182
191
183
aws cloudfront wait invalidation-completed --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --id "$invalidation_id"
192
184
193
- - name : Copy SDK dependencies to S3 (versioned directory)
185
+ - name : Copy SDK artifacts to S3 (versioned directory)
194
186
if : ${{ inputs.environment == 'production' }}
195
187
run : |
188
+ core_sdk_path_prefix="packages/analytics-js/dist/cdn"
196
189
integration_sdks_path_prefix="packages/analytics-js-integrations/dist/cdn"
197
190
plugins_path_prefix="packages/analytics-js-plugins/dist/cdn"
198
191
s3_relative_path_prefix="${{ env.CURRENT_VERSION_VALUE }}"
@@ -206,8 +199,10 @@ jobs:
206
199
plugins_html_file="list.html"
207
200
208
201
# Copy all the files to S3
209
- aws s3 cp $integration_sdks_path_prefix/legacy/js-integrations/ $s3_path_prefix/legacy/js-integrations/ $copy_args
202
+ aws s3 cp $core_sdk_path_prefix/legacy/iife/ $s3_path_prefix/legacy/ $copy_args
203
+ aws s3 cp $core_sdk_path_prefix/modern/iife/ $s3_path_prefix/modern/ $copy_args
210
204
205
+ aws s3 cp $integration_sdks_path_prefix/legacy/js-integrations/ $s3_path_prefix/legacy/js-integrations/ $copy_args
211
206
aws s3 cp $plugins_path_prefix/modern/plugins/ $s3_path_prefix/modern/plugins/ $copy_args
212
207
aws s3 cp $integration_sdks_path_prefix/modern/js-integrations/ $s3_path_prefix/modern/js-integrations/ $copy_args
213
208
@@ -224,18 +219,6 @@ jobs:
224
219
aws s3 cp $integration_sdks_path_prefix/modern/js-integrations/$integration_sdks_html_file $s3_path_prefix/modern/js-integrations/$integration_sdks_html_file $copy_args
225
220
aws s3 cp $plugins_path_prefix/modern/plugins/$plugins_html_file $s3_path_prefix/modern/plugins/$plugins_html_file $copy_args
226
221
227
- - name : Copy core SDK artifacts to S3 (versioned directory)
228
- if : ${{ inputs.environment == 'production' }}
229
- run : |
230
- core_sdk_path_prefix="packages/analytics-js/dist/cdn"
231
- s3_relative_path_prefix="${{ env.CURRENT_VERSION_VALUE }}"
232
- s3_path_prefix="s3://${{ secrets.AWS_S3_BUCKET_NAME }}/$s3_relative_path_prefix"
233
- copy_args="--recursive --cache-control ${{ env.CACHE_CONTROL_MAX_AGE }}"
234
-
235
- # Copy all the files to S3
236
- aws s3 cp $core_sdk_path_prefix/legacy/iife/ $s3_path_prefix/legacy/ $copy_args
237
- aws s3 cp $core_sdk_path_prefix/modern/iife/ $s3_path_prefix/modern/ $copy_args
238
-
239
222
- name : Invalidate CloudFront cache for all the SDK artifacts (versioned directory)
240
223
if : ${{ inputs.environment == 'production' }}
241
224
run : |
@@ -287,47 +270,37 @@ jobs:
287
270
288
271
# Below steps are for v1.1 SDK (legacy)
289
272
290
- - name : Copy legacy SDK dependencies to S3
291
- run : |
292
- integration_sdks_path_prefix="packages/analytics-js-integrations/dist/cdn"
293
- s3_path_prefix="s3://${{ secrets.AWS_S3_BUCKET_NAME }}/${{ inputs.s3_dir_path_legacy }}"
294
- copy_args="--recursive --cache-control ${{ env.CACHE_CONTROL_NO_STORE }}"
295
-
296
- aws s3 cp $integration_sdks_path_prefix/legacy/js-integrations/ $s3_path_prefix/js-integrations/ $copy_args
297
- aws s3 cp $integration_sdks_path_prefix/modern/js-integrations/ $s3_path_prefix/modern/js-integrations/ $copy_args
298
-
299
- - name : Copy core legacy SDK artifacts to S3
273
+ - name : Copy legacy SDK artifacts to S3
300
274
run : |
301
275
core_sdk_path_prefix="packages/analytics-v1.1/dist/cdn"
276
+ integration_sdks_path_prefix="packages/analytics-js-integrations/dist/cdn"
302
277
s3_path_prefix="s3://${{ secrets.AWS_S3_BUCKET_NAME }}/${{ inputs.s3_dir_path_legacy }}"
303
278
copy_args="--recursive --cache-control ${{ env.CACHE_CONTROL_NO_STORE }}"
304
279
305
280
aws s3 cp $core_sdk_path_prefix/legacy/ $s3_path_prefix/ $copy_args
306
281
aws s3 cp $core_sdk_path_prefix/modern/ $s3_path_prefix/modern/ $copy_args
282
+
283
+ aws s3 cp $integration_sdks_path_prefix/legacy/js-integrations/ $s3_path_prefix/js-integrations/ $copy_args
284
+ aws s3 cp $integration_sdks_path_prefix/modern/js-integrations/ $s3_path_prefix/modern/js-integrations/ $copy_args
307
285
308
286
- name : Invalidate CloudFront cache for all the legacy SDK artifacts
309
287
run : |
310
288
invalidation_id=$(AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --paths "/${{ inputs.s3_dir_path_legacy }}/*" --query "Invalidation.Id" --output text)
311
289
312
290
aws cloudfront wait invalidation-completed --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }} --id "$invalidation_id"
313
291
314
- - name : Copy legacy SDK dependencies to S3 (versioned directory)
315
- run : |
316
- integration_sdks_path_prefix="packages/analytics-js-integrations/dist/cdn"
317
- s3_path_prefix="s3://${{ secrets.AWS_S3_BUCKET_NAME }}/${{ env.CURRENT_VERSION_V1_VALUE }}"
318
- copy_args="--recursive --cache-control ${{ env.CACHE_CONTROL_MAX_AGE }}"
319
-
320
- aws s3 cp $integration_sdks_path_prefix/legacy/js-integrations/ $s3_path_prefix/js-integrations/ $copy_args
321
- aws s3 cp $integration_sdks_path_prefix/modern/js-integrations/ $s3_path_prefix/modern/js-integrations/ $copy_args
322
-
323
- - name : Copy core legacy SDK artifacts to S3 (versioned directory)
292
+ - name : Copy legacy SDK artifacts to S3 (versioned directory)
324
293
run : |
325
294
core_sdk_path_prefix="packages/analytics-v1.1/dist/cdn"
295
+ integration_sdks_path_prefix="packages/analytics-js-integrations/dist/cdn"
326
296
s3_path_prefix="s3://${{ secrets.AWS_S3_BUCKET_NAME }}/${{ env.CURRENT_VERSION_V1_VALUE }}"
327
297
copy_args="--recursive --cache-control ${{ env.CACHE_CONTROL_MAX_AGE }}"
328
298
329
299
aws s3 cp $core_sdk_path_prefix/legacy/ $s3_path_prefix/ $copy_args
330
300
aws s3 cp $core_sdk_path_prefix/modern/ $s3_path_prefix/modern/ $copy_args
301
+
302
+ aws s3 cp $integration_sdks_path_prefix/legacy/js-integrations/ $s3_path_prefix/js-integrations/ $copy_args
303
+ aws s3 cp $integration_sdks_path_prefix/modern/js-integrations/ $s3_path_prefix/modern/js-integrations/ $copy_args
331
304
332
305
- name : Invalidate CloudFront cache for all the legacy SDK artifacts (versioned directory)
333
306
run : |
0 commit comments