Skip to content

Commit 60e03a7

Browse files
committed
chore: setup circleci
1 parent 44541f7 commit 60e03a7

File tree

2 files changed

+70
-3
lines changed

2 files changed

+70
-3
lines changed

.circleci/config.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
defaults: &defaults
2+
docker:
3+
- image: circleci/node:latest
4+
working_directory: ~/repo
5+
6+
version: 2
7+
jobs:
8+
setup:
9+
<<: *defaults
10+
steps:
11+
- checkout
12+
- restore_cache:
13+
name: Restore node modules
14+
keys:
15+
- v1-dependencies-{{ checksum "package.json" }}
16+
# fallback to using the latest cache if no exact match is found
17+
- v1-dependencies-
18+
- run:
19+
name: Install dependencies
20+
command: yarn install
21+
- save_cache:
22+
name: Save node modules
23+
paths:
24+
- node_modules
25+
key: v1-dependencies-{{ checksum "package.json" }}
26+
- persist_to_workspace:
27+
root: .
28+
paths: .
29+
tests:
30+
<<: *defaults
31+
steps:
32+
- attach_workspace:
33+
at: .
34+
- run:
35+
name: Run tests
36+
command: yarn test
37+
publish:
38+
<<: *defaults
39+
steps:
40+
- attach_workspace:
41+
at: .
42+
- run:
43+
name: Run Build
44+
command: yarn build
45+
46+
- run:
47+
name: Publish to NPM
48+
command: yarn ci:publish
49+
50+
workflows:
51+
version: 2
52+
test_and_release:
53+
jobs:
54+
- setup:
55+
- tests:
56+
requires:
57+
- setup
58+
- publish:
59+
requires:
60+
- tests
61+
branches:
62+
only:
63+
- master

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@woonivers/react-native-document-scanner",
3-
"version": "1.6.1",
3+
"version": "0.0.0-development",
44
"description": "Scan documents, automatic border detection, automatic crop",
55
"main": "lib/module/index.js",
66
"types": "lib/typescript/index.d.ts",
@@ -14,12 +14,15 @@
1414
],
1515
"scripts": {
1616
"test": "jest",
17+
"ci:test": "jest",
1718
"typescript": "tsc --noEmit",
1819
"lint": "eslint --ext .js,.ts,.tsx .",
1920
"release": "release-it",
2021
"example": "yarn --cwd example",
2122
"bootstrap": "yarn example && yarn",
22-
"prepare": "bob build"
23+
"prepare": "bob build",
24+
"ci:publish": "semantic-release",
25+
"semantic-release": "semantic-release"
2326
},
2427
"publishConfig": {
2528
"registry": "https://registry.npmjs.org/"
@@ -73,7 +76,8 @@
7376
"react-dom": "16.8.3",
7477
"react-native": "~0.59.8",
7578
"release-it": "^12.3.0",
76-
"typescript": "^3.5.2"
79+
"typescript": "^3.5.2",
80+
"semantic-release": "^15.13.24"
7781
},
7882
"peerDependencies": {
7983
"react": "*",

0 commit comments

Comments
 (0)