Browse Source

chore(ci and npm): Setup CircleCI and semantic-release

Setup CircleCI and semantic-release
Thibault Malbranche 5 years ago
parent
commit
525ebfa06e
No account linked to committer's email address
4 changed files with 6861 additions and 5 deletions
  1. 66
    0
      .circleci/config.yml
  2. 0
    1
      .gitignore
  3. 13
    4
      package.json
  4. 6782
    0
      yarn.lock

+ 66
- 0
.circleci/config.yml View File

@@ -0,0 +1,66 @@
1
+defaults: &defaults
2
+  working_directory: ~/code
3
+  docker:
4
+    - image: circleci/node:10.6.0-browsers
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
+            - node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
16
+
17
+      - run:
18
+          name: Install dependencies
19
+          command: yarn --pure-lockfile
20
+
21
+      - save_cache:
22
+          name: Save node modules
23
+          key: node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
24
+          paths:
25
+            - node_modules
26
+
27
+  tests:
28
+    <<: *defaults
29
+    steps:
30
+      - checkout
31
+      - restore_cache:
32
+          name: Restore node modules
33
+          keys:
34
+            - node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
35
+
36
+      - run:
37
+          name: Run Tests
38
+          command: yarn ci:test
39
+
40
+  publish:
41
+    <<: *defaults
42
+    steps:
43
+      - checkout
44
+      - restore_cache:
45
+          name: Restore node modules
46
+          keys:
47
+            - node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
48
+
49
+      - run:
50
+          name: Publish to NPM
51
+          command: yarn ci:publish
52
+
53
+workflows:
54
+  version: 2
55
+  ci:
56
+    jobs:
57
+      - setup
58
+      - tests:
59
+          requires:
60
+            - setup
61
+      - publish:
62
+          requires:
63
+            - tests
64
+          filters:
65
+            branches:
66
+              only: master

+ 0
- 1
.gitignore View File

@@ -37,7 +37,6 @@ node_modules/
37 37
 npm-debug.log
38 38
 yarn-error.log
39 39
 package-lock.json
40
-yarn.lock
41 40
 
42 41
 # Rubygem bundles
43 42
 #

+ 13
- 4
package.json View File

@@ -6,11 +6,15 @@
6 6
   "contributors": [
7 7
     "Thibault Malbranche <malbranche.thibault@gmail.com>"
8 8
   ],
9
-  "version": "2.0.0",
9
+  "version": "0.0.0-development",
10 10
   "homepage": "https://github.com/react-native-community/react-native-webview#readme",
11 11
   "scripts": {
12
-    "flow": "flow check",
13
-    "flow-android": "flow check --flowconfig-name .flowconfig.android"
12
+    "test:ios:flow": "flow check",
13
+    "test:android:flow": "flow check --flowconfig-name .flowconfig.android",
14
+    "ci:publish": "yarn semantic-release",
15
+    "ci:test": "yarn ci:test:flow",
16
+    "ci:test:flow": "yarn test:ios:flow && yarn test:android:flow",
17
+    "semantic-release": "semantic-release"
14 18
   },
15 19
   "peerDependencies": {
16 20
     "react": "^16.0",
@@ -22,6 +26,11 @@
22 26
   },
23 27
   "devDependencies": {
24 28
     "flow-bin": "^0.80.0",
25
-    "react-native": "^0.57"
29
+    "react-native": "^0.57",
30
+    "semantic-release": "^15.9.17"
31
+  },
32
+  "repository": {
33
+    "type": "git",
34
+    "url": "https://github.com/react-native-community/react-native-webview.git"
26 35
   }
27 36
 }

+ 6782
- 0
yarn.lock
File diff suppressed because it is too large
View File