Skip to content

Commit 12c08b2

Browse files
asamizHeshamMegid
authored andcommitted
ci: automate nn releases (#1015)
* feat(ci): automate enterprise nn sdk changes * feat(ci): add the building & releasing jobs * fix(ci): fix parameters names * test(ci): test the ci pipeline in a private repo * fix(ci): fix ci pipeline failure removing README.md file * fix(ci): fix ci pipeline commands * fix(ci): fix ci pipeline commands * fix(ci): fix branch name * fix(ci): fix mising single quotes * fix(ci): fix working directory issue * fix(ci): fix working directory issue * fix(ci): fix working directory issue * fix(ci): fix adding yarn command * fix(ci): fix installing node modules * fix(ci): remove the installing pod step * fix(ci): fix installing node modules * fix(ci): fix installing node modules * fix(ci): fix installing node modules * fix(ci): fix installing node modules directory * fix(ci): fix the auth issue with npm * fix(ci): fix github link to use ssh instead of https * fix(ci): remove creating branch step * fix(ci): update the version temporarily * fix(ci): update the pods temporarily * fix(ci): update the pods temporarily * fix(ci): update the pods temporarily * fix(ci): update the pods temporarily * fix(ci): revert last pod installation * fix(ci): fix podfile cocopods version * fix(ci): fix PR comments * fix(ci): fix PR comments * fix(ci): fix the cocopods version * fix(ci): comment the filters to test the release * fix(ci): edit the sed command * fix(ci): revert the changes and ready to be merged * fix(ci): uncomment the filters
1 parent 62be19a commit 12c08b2

File tree

1 file changed

+64
-2
lines changed

1 file changed

+64
-2
lines changed

.circleci/config.yml

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ commands:
3838
key: v1-pods-{{ checksum "<< parameters.working_directory >>/Podfile.lock" }}
3939
paths:
4040
- << parameters.working_directory >>/Pods
41+
search_and_replace:
42+
parameters:
43+
file:
44+
type: string
45+
replace-pattern:
46+
type: string
47+
steps:
48+
- run:
49+
name: Search and Replace in << parameters.file >>
50+
command: sed -i '<< parameters.replace-pattern >>' << parameters.file >>
51+
4152
jobs:
4253
danger:
4354
executor:
@@ -224,6 +235,36 @@ jobs:
224235
working_directory: examples/default
225236
command: detox test -c android.emu.release
226237

238+
# Automate the enterprise NN sdk changes
239+
release_nn:
240+
working_directory: ~/project
241+
executor:
242+
name: node/default
243+
steps:
244+
- advanced-checkout/shallow-checkout
245+
- install_node_modules
246+
- run:
247+
name: Remove README.md file
248+
command: rm README.md
249+
- search_and_replace:
250+
file: package.json
251+
replace-pattern: 's/instabug-reactnative/@instabug\/react-native-nn/g'
252+
- search_and_replace:
253+
file: cli/UploadSourcemaps.ts
254+
replace-pattern: 's/api.instabug.com\/api\/sdk/st001009nn.instabug.com\/api\/sdk/g'
255+
- search_and_replace:
256+
file: android/native.gradle
257+
replace-pattern: 's/com\.instabug\.library:instabug:/com.instabug.library-nn:instabug:/g'
258+
- run:
259+
working_directory: project
260+
command: yarn build
261+
- run:
262+
name: Authorize with npm
263+
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
264+
- run:
265+
name: Publish new enterprise version
266+
command: npm publish
267+
227268
publish:
228269
macos:
229270
xcode: 13.4.1
@@ -262,7 +303,22 @@ workflows:
262303
- test_ios
263304
- e2e_ios
264305
- e2e_android
265-
- hold:
306+
- hold_publish:
307+
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
317+
type: approval
318+
filters:
319+
branches:
320+
only: master
321+
- hold_release_nn:
266322
requires:
267323
- danger
268324
- lint
@@ -279,7 +335,13 @@ workflows:
279335
only: master
280336
- publish:
281337
requires:
282-
- hold
338+
- hold_publish
339+
filters:
340+
branches:
341+
only: master
342+
- release_nn:
343+
requires:
344+
- hold_release_nn
283345
filters:
284346
branches:
285347
only: master

0 commit comments

Comments
 (0)