5
5
advanced-checkout :
vsco/[email protected]
6
6
7
7
8
+ references :
9
+ release_dependencies : &release_dependencies
10
+ - danger
11
+ - lint
12
+ - test_module
13
+ - test_android
14
+ - validate_shell_files
15
+ - sync_generated_files
16
+ - test_ios
17
+ - e2e_ios
18
+ - e2e_android
19
+
8
20
commands :
9
21
install_node_modules :
10
22
parameters :
@@ -48,6 +60,15 @@ commands:
48
60
- run :
49
61
name : Search and Replace in << parameters.file >>
50
62
command : sed -i '<< parameters.replace-pattern >>' << parameters.file >>
63
+ notify_github :
64
+ parameters :
65
+ data :
66
+ type : string
67
+ description : The data to be passed to the GitHub API for creating the comment.
68
+ steps :
69
+ - run :
70
+ name : Post comment on GitHub
71
+ command : ./scripts/notify-github.sh "<< parameters.data >>"
51
72
52
73
jobs :
53
74
danger :
@@ -287,6 +308,47 @@ jobs:
287
308
working_directory : project
288
309
command : Escape react-native publish
289
310
311
+ generate_snapshot :
312
+ executor :
313
+ name : node/default
314
+ steps :
315
+ - advanced-checkout/shallow-checkout
316
+ - install_node_modules
317
+ - run : yarn build
318
+ - run : yarn remove @instabug/danger-plugin-coverage
319
+ - run :
320
+ name : Remove build files from .gitignore
321
+ command : sed -i '/dist/d' .gitignore && sed -i '/bin/d' .gitignore
322
+ - run :
323
+ name : Get snapshot branch name
324
+ command : |
325
+ source scripts/snapshot-branch.sh
326
+ echo "export SNAPSHOT_BRANCH=$SNAPSHOT_BRANCH" >> "$BASH_ENV"
327
+ - run :
328
+ name : Setup Git
329
+ command : |
330
+ git config --global user.name "Instabug-CP-CI"
331
+ git config --global user.email [email protected]
332
+ - run :
333
+ name : Create snapshot branch
334
+ command : git checkout -b $SNAPSHOT_BRANCH
335
+ - run :
336
+ name : Commit changes
337
+ command : |
338
+ git add .
339
+ git commit -m "chore: add generate files"
340
+ - run :
341
+ name : Push snapshot
342
+ command : git push --force origin $SNAPSHOT_BRANCH
343
+ - run :
344
+ name : Install jq
345
+ command : sudo apt-get update && sudo apt-get install -y jq
346
+ - run :
347
+ name : Replace snapshot branch in comment template
348
+ command : sed -i "s|{BRANCH}|$SNAPSHOT_BRANCH|g" scripts/snapshot-comment.md
349
+ - notify_github :
350
+ data : " $(jq -Rcs '{ body: . }' scripts/snapshot-comment.md)"
351
+
290
352
workflows :
291
353
publish :
292
354
jobs :
@@ -303,32 +365,20 @@ workflows:
303
365
- test_ios
304
366
- e2e_ios
305
367
- e2e_android
306
- - hold_publish :
368
+ - hold_generate_snapshot :
369
+ type : approval
370
+ requires : *release_dependencies
371
+ - generate_snapshot :
307
372
requires :
308
- - danger
309
- - lint
310
- - test_module
311
- - test_android
312
- - validate_shell_files
313
- - sync_generated_files
314
- - test_ios
315
- - e2e_ios
316
- - e2e_android
373
+ - hold_generate_snapshot
374
+ - hold_publish :
375
+ requires : *release_dependencies
317
376
type : approval
318
377
filters :
319
378
branches :
320
379
only : master
321
380
- hold_release_nn :
322
- requires :
323
- - danger
324
- - lint
325
- - test_module
326
- - test_android
327
- - validate_shell_files
328
- - sync_generated_files
329
- - test_ios
330
- - e2e_ios
331
- - e2e_android
381
+ requires : *release_dependencies
332
382
type : approval
333
383
filters :
334
384
branches :
0 commit comments