@@ -59,10 +59,67 @@ commands:
5959        type : string 
6060      replace :
6161        type : string 
62+       working_directory :
63+         type : string 
64+         default : ~/project 
6265    steps :
6366      - run :
6467          name : Find and Replace in << parameters.files >> 
6568          command : node ~/project/scripts/replace.js << parameters.search >> << parameters.replace >> << parameters.files >> 
69+           working_directory : << parameters.working_directory >> 
70+ 
71+   prepare_custom_package :
72+     parameters :
73+       npm_package :
74+         type : string 
75+       android_package :
76+         type : string 
77+       api_endpoint :
78+         type : string 
79+       working_directory :
80+         type : string 
81+         default : ~/project 
82+     steps :
83+       - run :
84+           name : Remove README.md file 
85+           command : rm README.md 
86+           working_directory : << parameters.working_directory >> 
87+       - find_and_replace :
88+           files : package.json android/sourcemaps.gradle ios/sourcemaps.sh 
89+           search : instabug-reactnative 
90+           replace : << parameters.npm_package >> 
91+           working_directory : << parameters.working_directory >> 
92+       - find_and_replace :
93+           files : cli/upload/uploadSourcemaps.ts cli/upload/uploadSoFiles.ts 
94+           search : api.instabug.com 
95+           replace : << parameters.api_endpoint >> 
96+           working_directory : << parameters.working_directory >> 
97+       - find_and_replace :
98+           files : android/native.gradle 
99+           search : ' com.instabug.library:instabug:' 
100+           replace : ' com.instabug.library-<< parameters.android_package >>:instabug:' 
101+           working_directory : << parameters.working_directory >> 
102+ 
103+   prepare_dream11 :
104+     parameters :
105+       working_directory :
106+         type : string 
107+         default : ~/project 
108+     steps :
109+       - install_node_modules 
110+       - prepare_custom_package :
111+           npm_package : ' @instabug/instabug-reactnative-dream11' 
112+           android_package : dream11 
113+           api_endpoint : st001012dream11.instabug.com 
114+           working_directory : << parameters.working_directory >> 
115+       - run :
116+           name : Give execute permission to Dream11 script 
117+           command : chmod +x ./scripts/dream-11-delete-unused-features.sh 
118+           working_directory : << parameters.working_directory >> 
119+       - run :
120+           name : Remove unused features 
121+           command : ./scripts/dream-11-delete-unused-features.sh 
122+           working_directory : << parameters.working_directory >> 
66123
67124  notify_github :
68125    parameters :
@@ -264,33 +321,16 @@ jobs:
264321
265322  release_custom_package :
266323    parameters :
267-       npm_package :
268-         type : string 
269-       android_package :
270-         type : string 
271-       api_endpoint :
272-         type : string 
324+       prepare_steps :
325+         type : steps 
326+         default : [] 
273327    working_directory : ~/project 
274328    executor :
275329      name : node/default 
276330    steps :
277331      - advanced-checkout/shallow-checkout 
332+       - steps : << parameters.prepare_steps >> 
278333      - install_node_modules 
279-       - run :
280-           name : Remove README.md file 
281-           command : rm README.md 
282-       - find_and_replace :
283-           files : package.json android/sourcemaps.gradle ios/sourcemaps.sh 
284-           search : instabug-reactnative 
285-           replace : << parameters.npm_package >> 
286-       - find_and_replace :
287-           files : cli/UploadSourcemaps.ts cli/UploadSoFiles.ts 
288-           search : api.instabug.com 
289-           replace : << parameters.api_endpoint >> 
290-       - find_and_replace :
291-           files : android/native.gradle 
292-           search : ' com.instabug.library:instabug:' 
293-           replace : ' com.instabug.library-<< parameters.android_package >>:instabug:' 
294334      - run :
295335          name : Build the SDK 
296336          command : yarn build 
@@ -301,45 +341,6 @@ jobs:
301341          name : Publish new enterprise version 
302342          command : npm publish 
303343
304-   #  Automate the enterprise D11 sdk changes
305-   release_d11 :
306-     working_directory : ~/project 
307-     executor :
308-       name : node/default 
309-     steps :
310-       - advanced-checkout/shallow-checkout 
311-       - install_node_modules 
312-       - run :
313-           name : Remove README.md file 
314-           command : rm README.md 
315-       - find_and_replace :
316-           files : package.json ios/sourcemaps.sh android/sourcemaps.gradle 
317-           search : instabug-reactnative 
318-           replace : ' @instabug/instabug-reactnative-dream11' 
319-       - find_and_replace :
320-           files : cli/UploadSourcemaps.ts cli/UploadSoFiles.ts 
321-           search : api.instabug.com 
322-           replace : st001012dream11.instabug.com 
323-       - find_and_replace :
324-           files : android/native.gradle 
325-           search : com.instabug.library:instabug 
326-           replace : ' com.instabug.library-dream11:instabug' 
327-       - run :
328-           name : give exec permssion to d11 script 
329-           command : chmod +x ./scripts/dream-11-delete-unused-features.sh 
330-       - run :
331-           name : remove un-required features 
332-           command : ./scripts/dream-11-delete-unused-features.sh 
333-       - run :
334-           name : Build the SDK 
335-           command : yarn build 
336-       - run :
337-           name : Authorize with npm 
338-           command : echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc 
339-       - run :
340-           name : Publish new enterprise version 
341-           command : npm publish 
342- 
343344  publish :
344345    macos :
345346      xcode : 13.4.1 
@@ -463,12 +464,6 @@ workflows:
463464          filters :
464465            branches :
465466              only : master 
466-       - hold_release_d11 :
467-           requires : *release_dependencies 
468-           type : approval 
469-           filters :
470-             branches :
471-               only : dream11 
472467      - publish :
473468          requires :
474469            - hold_publish 
@@ -481,6 +476,7 @@ workflows:
481476          filters :
482477            branches :
483478              only : master 
479+ 
484480      - hold_release_nn :
485481          requires : *release_dependencies 
486482          type : approval 
@@ -494,9 +490,12 @@ workflows:
494490          filters :
495491            branches :
496492              only : master 
497-           npm_package : ' @instabug/react-native-nn' 
498-           android_package : nn 
499-           api_endpoint : st001009nn.instabug.com 
493+           prepare_steps :
494+             - prepare_custom_package :
495+                 npm_package : ' @instabug/react-native-nn' 
496+                 android_package : nn 
497+                 api_endpoint : st001009nn.instabug.com 
498+ 
500499      - hold_release_injazat :
501500          requires : *release_dependencies 
502501          type : approval 
@@ -510,12 +509,24 @@ workflows:
510509          filters :
511510            branches :
512511              only : master 
513-           npm_package : ' @instabug/react-native-injazat' 
514-           android_package : injazat 
515-           api_endpoint : st001013mec1.instabug.com 
516-       - release_d11 :
512+           prepare_steps :
513+             - prepare_custom_package :
514+                 npm_package : ' @instabug/react-native-injazat' 
515+                 android_package : injazat 
516+                 api_endpoint : st001013mec1.instabug.com 
517+ 
518+       - hold_release_dream11 :
519+           requires : *release_dependencies 
520+           type : approval 
521+           filters :
522+             branches :
523+               only : dream11 
524+       - release_custom_package :
525+           name : release_dream11 
517526          requires :
518-             - hold_release_d11 
527+             - hold_release_dream11 
519528          filters :
520529            branches :
521530              only : dream11 
531+           prepare_steps :
532+             - prepare_dream11 
0 commit comments