55 advanced-checkout : vsco/advanced-checkout@1.1.0
66 node : circleci/node@5.1.0
77
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+
820commands :
921 install_node_modules :
1022 parameters :
@@ -48,6 +60,15 @@ commands:
4860 - run :
4961 name : Search and Replace in << parameters.file >>
5062 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 >>"
5172
5273jobs :
5374 danger :
@@ -287,6 +308,47 @@ jobs:
287308 working_directory : project
288309 command : Escape react-native publish
289310
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 github-ci+cp@instabug.com
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+
290352workflows :
291353 publish :
292354 jobs :
@@ -303,32 +365,20 @@ workflows:
303365 - test_ios
304366 - e2e_ios
305367 - e2e_android
306- - hold_publish :
368+ - hold_generate_snapshot :
369+ type : approval
370+ requires : *release_dependencies
371+ - generate_snapshot :
307372 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
317376 type : approval
318377 filters :
319378 branches :
320379 only : master
321380 - 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
332382 type : approval
333383 filters :
334384 branches :
0 commit comments