From 8361427b2c0c6b08b901d17760b8f5cdf04c0134 Mon Sep 17 00:00:00 2001 From: Morgan Laco Date: Mon, 26 Nov 2018 15:04:41 -0500 Subject: [PATCH 1/5] Configure for Circle CI Remove comma Change ci:test script to `yarn test` Remove comma Try adding a ci:lint script Remove ci:lint script Add Ignite in Cicle CI setup Try not-global yarn add Install react-native-cli on Circle CI Globally add dependencies Install all deps at once Blah Try installing peer dependencies with npm instead Try not global SUDO Make npm i global again Install stuff in test phase! --- .circleci/config.yml | 60 ++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..94f91c5 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,60 @@ +# Javascript Node CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-javascript/ for more details +# + +defaults: &defaults + docker: + # Choose the version of Node you want here + - image: circleci/node:10.11 + working_directory: ~/repo + +version: 2 +jobs: + setup: + <<: *defaults + steps: + - checkout + - restore_cache: + name: Restore node modules + keys: + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + - run: + name: Install dependencies + command: | + yarn install + - save_cache: + name: Save node modules + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + + + tests: + <<: *defaults + steps: + - checkout + - restore_cache: + name: Restore node modules + keys: + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + - run: + name: Install React Native CLI and Ignite CLI + command: | + sudo npm i -g ignite-cli react-native-cli + - run: + name: Run tests + command: yarn ci:test # this command will be added to/found in your package.json scripts + +workflows: + version: 2 + test_and_release: + jobs: + - setup + - tests: + requires: + - setup \ No newline at end of file diff --git a/package.json b/package.json index c7a140e..89dd98a 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "test": "jest", "watch": "jest --runInBand --watch", "coverage": "jest --runInBand --coverage", - "shipit": "np" + "shipit": "np", + "ci:test": "yarn test" }, "standard": { "parser": "babel-eslint", From 659fdee2d7114c5cc34a9e9b376f2d153bfadcfd Mon Sep 17 00:00:00 2001 From: Morgan Laco Date: Tue, 27 Nov 2018 20:36:24 -0500 Subject: [PATCH 2/5] Configure for semantic release --- .circleci/config.yml | 24 +++++++++++++++++++++++- package.json | 21 ++++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 94f91c5..7af71a1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,6 +50,22 @@ jobs: name: Run tests command: yarn ci:test # this command will be added to/found in your package.json scripts +publish: + <<: *defaults + steps: + - checkout + - run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + - restore_cache: + name: Restore node modules + keys: + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + # Run semantic-release after all the above is set. + - run: + name: Publish to NPM + command: yarn ci:publish # this will be added to your package.json scripts + workflows: version: 2 test_and_release: @@ -57,4 +73,10 @@ workflows: - setup - tests: requires: - - setup \ No newline at end of file + - setup + - publish: + requires: + - tests + filters: + branches: + only: master \ No newline at end of file diff --git a/package.json b/package.json index 89dd98a..5a8e5ab 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,9 @@ "watch": "jest --runInBand --watch", "coverage": "jest --runInBand --coverage", "shipit": "np", - "ci:test": "yarn test" + "ci:test": "yarn test", + "ci:publish": "yarn semantic-release", + "semantic-release": "semantic-release" }, "standard": { "parser": "babel-eslint", @@ -42,11 +44,28 @@ "describe" ] }, + "release": { + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/npm", + "@semantic-release/github", + [ + "@semantic-release/git", + { + "assets": "package.json", + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ] + ] + }, "devDependencies": { + "@semantic-release/git": "^7.0.5", "babel-eslint": "^7.1.1", "fs-jetpack": "^1.0.0", "jest": "^20.0.4", "np": "^2.15.0", + "semantic-release": "^15.12.2", "sinon": "^2.3.1", "standard": "^10.0.2", "tempy": "^0.1.0" From 24888a4ada9d7ac41467d27e47a33445bef743c3 Mon Sep 17 00:00:00 2001 From: Morgan Laco Date: Tue, 27 Nov 2018 20:36:57 -0500 Subject: [PATCH 3/5] Remove shipit script --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 5a8e5ab..2c76ab9 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "test": "jest", "watch": "jest --runInBand --watch", "coverage": "jest --runInBand --coverage", - "shipit": "np", "ci:test": "yarn test", "ci:publish": "yarn semantic-release", "semantic-release": "semantic-release" From 6d78e71a33256dfe9f976a5b17f401fd30d1f30e Mon Sep 17 00:00:00 2001 From: Morgan Laco Date: Tue, 27 Nov 2018 20:55:00 -0500 Subject: [PATCH 4/5] Upgrade socks --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c76ab9..f2de320 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,8 @@ "semantic-release": "^15.12.2", "sinon": "^2.3.1", "standard": "^10.0.2", - "tempy": "^0.1.0" + "tempy": "^0.1.0", + "socks": "^2.1.6" }, "dependencies": { "ramda": "^0.23.0" From f996503a31962b29c9c85c1d3b3e0c8b29b850dd Mon Sep 17 00:00:00 2001 From: Morgan Laco Date: Tue, 27 Nov 2018 20:58:21 -0500 Subject: [PATCH 5/5] Remove duplicate semantic-release dep --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index f2de320..fbe448b 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,6 @@ "fs-jetpack": "^1.0.0", "jest": "^20.0.4", "np": "^2.15.0", - "semantic-release": "^15.12.2", "sinon": "^2.3.1", "standard": "^10.0.2", "tempy": "^0.1.0",