Skip to content

Commit 1226361

Browse files
ahmedAlaaInstabugHeshamMegid
authored andcommitted
chore: add d11 release pipeline to ci (#1093)
* chore: create d11 customization script (#1090) * chore_add_removing_native_code_in_d11_customization_script * chore_add_dream-11-delete-unused-features Jira ID: MOB-13551 * chore_add_d11_release_pipeline_to_circle_ci * chore_add_d11_release_pipeline(test) * chore_add_d11_release_pipeline(test) * chore_remove_all_locales_except_english_locale * fix_change_d11_sdk_name * chore_remove_d11_test_workflow_in_ci * chore_add_d11_release_pipeline_to_circle_ci * chore_add_d11_release_pipeline(test) * chore_remove_all_locales_except_english_locale * fix_change_d11_sdk_name * chore_remove_d11_test_workflow_in_ci
1 parent 8420314 commit 1226361

File tree

3 files changed

+86
-36
lines changed

3 files changed

+86
-36
lines changed

.circleci/config.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,38 @@ jobs:
285285
- run:
286286
name: Publish new enterprise version
287287
command: npm publish
288+
# Automate the enterprise D11 sdk changes
289+
release_d11:
290+
working_directory: ~/project
291+
executor:
292+
name: node/default
293+
steps:
294+
- advanced-checkout/shallow-checkout
295+
- install_node_modules
296+
- run:
297+
name: Remove README.md file
298+
command: rm README.md
299+
- search_and_replace:
300+
file: package.json
301+
replace-pattern: 's/instabug-reactnative/@instabug\/react-native-dream11/g'
302+
- search_and_replace:
303+
file: android/native.gradle
304+
replace-pattern: 's/com\.instabug\.library:instabug:/com.instabug.library-dream11:instabug:/g'
305+
- run:
306+
name: give exec permssion to d11 script
307+
command: chmod +x ./scripts/dream-11-delete-unused-features.sh
308+
- run:
309+
name: remove un-required features
310+
command: ./scripts/dream-11-delete-unused-features.sh
311+
- run:
312+
name: Build the SDK
313+
command: yarn build
314+
- run:
315+
name: Authorize with npm
316+
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
317+
- run:
318+
name: Publish new enterprise version
319+
command: npm publish
288320

289321
publish:
290322
macos:
@@ -383,6 +415,12 @@ workflows:
383415
filters:
384416
branches:
385417
only: master
418+
- hold_release_d11:
419+
requires: *release_dependencies
420+
type: approval
421+
filters:
422+
branches:
423+
only: master
386424
- publish:
387425
requires:
388426
- hold_publish
@@ -395,3 +433,9 @@ workflows:
395433
filters:
396434
branches:
397435
only: master
436+
- release_d11:
437+
requires:
438+
- hold_release_d11
439+
filters:
440+
branches:
441+
only: master

scripts/dream-11-delete-unused-features

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
# remove survey and featureRequest features in JavaScript files
4+
deletedFeaturesFilesInJavaScript=("Surveys" "FeatureRequests" "Survey")
5+
for feature in "${deletedFeaturesFilesInJavaScript[@]}";
6+
do
7+
echo "$feature"
8+
rm -f src/modules/"$feature".ts
9+
rm -f test/mocks/mock"$feature".ts
10+
sed -i "s/import..*$feature';//g" src/index.ts
11+
sed -i "s/$feature,//g" src/index.ts
12+
13+
done
14+
npx eslint src/index.ts --fix
15+
16+
# remove survey and featureRequest features in Android files
17+
deletedFeaturesFilesInAndroidApp=("RNInstabugSurveysModule" "RNInstabugFeatureRequestsModule")
18+
for feature in "${deletedFeaturesFilesInAndroidApp[@]}";
19+
do
20+
echo "$feature"
21+
22+
rm -f android/src/main/java/com/instabug/reactlibrary/"$feature".java
23+
rm -f android/src/test/java/com/instabug/reactlibrary/"$feature"Test.java
24+
sed -i "s/modules.add(new $feature(reactContext));//g" android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativePackage.java
25+
26+
done
27+
28+
# remove survey and featureRequest features in IOS files
29+
deletedFeaturesFilesInIosApp=("InstabugSurveysBridge" "InstabugFeatureRequestsBridge")
30+
for feature in "${deletedFeaturesFilesInIosApp[@]}";
31+
do
32+
echo "$feature"
33+
rm -f ios/RNInstabug/"$feature".h
34+
rm -f ios/RNInstabug/"$feature".m
35+
done
36+
sed -i "s/\#import <Instabug\/IBGSurveys.h>//g" ios/RNInstabug/InstabugReactBridge.m
37+
sed -i "s/\#import <Instabug\/IBGSurveys.h>//g" ios/RNInstabug/InstabugReactBridge.h
38+
39+
40+
# remove all locales except English locale
41+
sed -i -E '/english/!s/.*constants.locale.*//g' src/utils/Enums.ts
42+
npx eslint src/index.ts --fix src/utils/Enums.ts

0 commit comments

Comments
 (0)