Skip to content

Commit bf31799

Browse files
piotr pietruszewskipi0trpietruszewski
authored andcommitted
ci(release): added release to npm script
1 parent 7cb0937 commit bf31799

File tree

2 files changed

+68
-7
lines changed

2 files changed

+68
-7
lines changed

.circleci/config.yml

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ executors:
2121
orbs:
2222
android: circleci/[email protected]
2323

24+
run_on_master: &run_on_master
25+
filters:
26+
branches:
27+
only: main
28+
2429
commands:
2530
attach_project:
2631
steps:
@@ -159,14 +164,58 @@ jobs:
159164
- ~/project/example/ios/Pods
160165

161166
- run:
162-
working_directory: example/e2e
163-
name: Build
164-
command: npm run build:ios
167+
working_directory: example/e2e
168+
name: Build
169+
command: npm run build:ios
170+
171+
- run:
172+
working_directory: example/e2e
173+
name: Run UI Tests
174+
command: npm run test:ios
175+
176+
177+
release-to-npm:
178+
executor: default
179+
steps:
180+
- checkout
181+
- run:
182+
name: Set user credentials
183+
command: |
184+
git config user.email $GIT_USER_EMAIL
185+
git config user.name $GIT_USER_NAME
186+
187+
# Tokens are stored in bas64
188+
- run:
189+
name: Instal SSH KEY
190+
command: |
191+
ssh-add -D
192+
echo $GIT_WRITE_SSH_KEY | base64 --decode > ~/.ssh/id_ed25519
193+
echo $GIT_WRITE_SSH_KEY_PUB | base64 --decode > ~/.ssh/id_ed25519.pub
194+
195+
- run:
196+
name: Change key permission
197+
command: chmod 600 ~/.ssh/id_ed25519
198+
199+
- run:
200+
name: Add ssh key
201+
command: ssh-add ~/.ssh/id_ed25519
202+
203+
- run:
204+
name: Add npm registry auth key
205+
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
206+
207+
- restore_cache:
208+
keys:
209+
- dependencies-{{ checksum "package.json" }}
210+
211+
- run:
212+
name: Install dependencies
213+
command: |
214+
yarn install --frozen-lockfile
165215
166216
- run:
167-
working_directory: example/e2e
168-
name: Run UI Tests
169-
command: npm run test:ios
217+
name: Release package
218+
command: npm run release --ci
170219

171220

172221
workflows:
@@ -191,3 +240,15 @@ workflows:
191240
- ios-e2e-test:
192241
requires:
193242
- install-dependencies
243+
- release-to-npm:
244+
<<: *run_on_master
245+
context:
246+
- react-native-env
247+
requires:
248+
- install-dependencies
249+
- lint
250+
- typescript
251+
- unit-tests
252+
- build-package
253+
- ios-e2e-test
254+
- android-e2e-test

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
},
9595
"release-it": {
9696
"git": {
97-
"commitMessage": "chore: release ${version}",
97+
"commitMessage": "chore: release ${version} [skip ci]",
9898
"tagName": "v${version}"
9999
},
100100
"npm": {

0 commit comments

Comments
 (0)