Skip to content

Commit de707d4

Browse files
committed
ci: generalize release custom package & use it for dream11
1 parent 9e35417 commit de707d4

File tree

1 file changed

+18
-67
lines changed

1 file changed

+18
-67
lines changed

.circleci/config.yml

Lines changed: 18 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -372,33 +372,16 @@ jobs:
372372

373373
release_custom_package:
374374
parameters:
375-
npm_package:
376-
type: string
377-
android_package:
378-
type: string
379-
api_endpoint:
380-
type: string
375+
prepare_steps:
376+
type: steps
377+
default: []
381378
working_directory: ~/project
382379
executor:
383380
name: node/default
384381
steps:
385382
- advanced-checkout/shallow-checkout
383+
- steps: << parameters.prepare_steps >>
386384
- install_node_modules
387-
- run:
388-
name: Remove README.md file
389-
command: rm README.md
390-
- find_and_replace:
391-
files: package.json android/sourcemaps.gradle ios/sourcemaps.sh
392-
search: instabug-reactnative
393-
replace: << parameters.npm_package >>
394-
- find_and_replace:
395-
files: cli/upload/uploadSourcemaps.ts cli/upload/uploadSoFiles.ts
396-
search: api.instabug.com
397-
replace: << parameters.api_endpoint >>
398-
- find_and_replace:
399-
files: android/native.gradle
400-
search: 'com.instabug.library:instabug:'
401-
replace: 'com.instabug.library-<< parameters.android_package >>:instabug:'
402385
- run:
403386
name: Build the SDK
404387
command: yarn build
@@ -409,45 +392,6 @@ jobs:
409392
name: Publish new enterprise version
410393
command: npm publish
411394

412-
# Automate the enterprise D11 sdk changes
413-
release_dream11:
414-
working_directory: ~/project
415-
executor:
416-
name: node/default
417-
steps:
418-
- advanced-checkout/shallow-checkout
419-
- install_node_modules
420-
- run:
421-
name: Remove README.md file
422-
command: rm README.md
423-
- find_and_replace:
424-
files: package.json ios/sourcemaps.sh android/sourcemaps.gradle
425-
search: instabug-reactnative
426-
replace: '@instabug/instabug-reactnative-dream11'
427-
- find_and_replace:
428-
files: cli/upload/uploadSourcemaps.ts cli/upload/uploadSoFiles.ts
429-
search: api.instabug.com
430-
replace: st001012dream11.instabug.com
431-
- find_and_replace:
432-
files: android/native.gradle
433-
search: com.instabug.library:instabug
434-
replace: 'com.instabug.library-dream11:instabug'
435-
- run:
436-
name: give exec permssion to d11 script
437-
command: chmod +x ./scripts/dream-11-delete-unused-features.sh
438-
- run:
439-
name: remove un-required features
440-
command: ./scripts/dream-11-delete-unused-features.sh
441-
- run:
442-
name: Build the SDK
443-
command: yarn build
444-
- run:
445-
name: Authorize with npm
446-
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
447-
- run:
448-
name: Publish new enterprise version
449-
command: npm publish
450-
451395
publish:
452396
macos:
453397
xcode: 13.4.1
@@ -596,9 +540,11 @@ workflows:
596540
filters:
597541
branches:
598542
only: master
599-
npm_package: '@instabug/react-native-nn'
600-
android_package: nn
601-
api_endpoint: st001009nn.instabug.com
543+
prepare_steps:
544+
- prepare_custom_package:
545+
npm_package: '@instabug/react-native-nn'
546+
android_package: nn
547+
api_endpoint: st001009nn.instabug.com
602548
- hold_release_injazat:
603549
requires: *release_dependencies
604550
type: approval
@@ -612,9 +558,11 @@ workflows:
612558
filters:
613559
branches:
614560
only: master
615-
npm_package: '@instabug/react-native-injazat'
616-
android_package: injazat
617-
api_endpoint: st001013mec1.instabug.com
561+
prepare_steps:
562+
- prepare_custom_package:
563+
npm_package: '@instabug/react-native-injazat'
564+
android_package: injazat
565+
api_endpoint: st001013mec1.instabug.com
618566

619567
# Dream11 tests
620568
- hold_test_dream11:
@@ -647,7 +595,10 @@ workflows:
647595
filters:
648596
branches:
649597
only: dream11
650-
- release_dream11:
598+
- release_custom_package:
599+
name: release_dream11
600+
prepare_steps:
601+
- prepare_dream11
651602
requires:
652603
- hold_release_dream11
653604
filters:

0 commit comments

Comments
 (0)