From 09b45819af4006c35acbdbe15aa7598895e6b144 Mon Sep 17 00:00:00 2001 From: aquariuslt Date: Thu, 5 Sep 2019 00:57:31 +0800 Subject: [PATCH 1/4] ci: add github workflow for ci & release --- .github/workflows/build.yml | 22 ++++++++++++++++++ .github/workflows/publish.yml | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8b9a7ff --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,22 @@ +name: build + +on: [push] +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x] + + steps: + - name: SCM + uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: NODE CI + run: | + npm install + npm test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..23312be --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,42 @@ +name: publish + +on: + release: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: SCM + uses: actions/checkout@v1 + - name: Setup Node Environment + uses: actions/setup-node@v1 + with: + node-version: 10 + - name: Node CI + run: | + npm install + npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - name: SCM + uses: actions/checkout@v1 + - name: Setup Node Environment + uses: actions/setup-node@v1 + with: + node-version: 10 + registry-url: https://registry.npmjs.org/ + - name: Yarn install & Build + run: | + npm install + npm build + - name: Publish to NPM Registry + run: npm publish + if: github.event.action == 'created' + env: + NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} From d72c7a8ce3a2eefe4820b43645805a284ef23288 Mon Sep 17 00:00:00 2001 From: aquariuslt Date: Thu, 5 Sep 2019 01:03:55 +0800 Subject: [PATCH 2/4] ci: add react/react-dom to devDependencies & update ci workflow - rename workflow `build` to `ci` - add badge icon in README --- .github/workflows/{build.yml => ci.yml} | 0 README.md | 2 +- package.json | 2 ++ yarn.lock | 19 +++++++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) rename .github/workflows/{build.yml => ci.yml} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows/ci.yml diff --git a/README.md b/README.md index 0e206f6..14aefe1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# React-WeUI [![Build Status](https://travis-ci.org/weui/react-weui.svg?branch=master)](https://travis-ci.org/weui/react-weui) [![npm version](https://img.shields.io/npm/v/react-weui.svg)](https://www.npmjs.org/package/react-weui) +# React-WeUI [![Build Status](https://travis-ci.org/weui/react-weui.svg?branch=master)](https://travis-ci.org/weui/react-weui) [![Github Workflow Status](https://github.com/weui/react-weui/workflows/ci/badge.svg)](https://github.com/weui/react-weui) [![npm version](https://img.shields.io/npm/v/react-weui.svg)](https://www.npmjs.org/package/react-weui) [WeUI](https://github.com/weui/weui) Components build with [React](http://facebook.github.io/react/). diff --git a/package.json b/package.json index 985e993..db74201 100644 --- a/package.json +++ b/package.json @@ -83,8 +83,10 @@ "open-browser-webpack-plugin": "0.0.1", "postcss-loader": "^2.0.6", "raw-loader": "^0.5.1", + "react": "^16.9.0", "react-codemirror": "^0.2.6", "react-docgen": "^3.0.0", + "react-dom": "^16.9.0", "react-fontawesome": "^1.3.1", "react-remarkable": "^1.1.1", "react-router": "^4.1.1", diff --git a/yarn.lock b/yarn.lock index 921cdf6..52f961d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6559,6 +6559,16 @@ react-docgen@^3.0.0: node-dir "^0.1.10" recast "^0.16.0" +react-dom@^16.9.0: + version "16.9.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.9.0.tgz#5e65527a5e26f22ae3701131bcccaee9fb0d3962" + integrity sha512-YFT2rxO9hM70ewk9jq0y6sQk8cL02xm4+IzYBz75CQGlClQQ1Bxq0nhHF6OtSbit+AIahujJgb/CPRibFkMNJQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + scheduler "^0.15.0" + react-fontawesome@^1.3.1: version "1.6.1" resolved "https://registry.npmjs.org/react-fontawesome/-/react-fontawesome-1.6.1.tgz#eddce17e7dc731aa09fd4a186688a61793a16c5c" @@ -6649,6 +6659,15 @@ react-transition-group@^2.0.2: prop-types "^15.6.2" react-lifecycles-compat "^3.0.4" +react@^16.9.0: + version "16.9.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.9.0.tgz#40ba2f9af13bc1a38d75dbf2f4359a5185c4f7aa" + integrity sha512-+7LQnFBwkiw+BobzOF6N//BdoNw0ouwmSJTEm9cglOOmsg/TMiFHZLe2sEoN5M7LgJTj9oHH0gxklfnQe66S1w== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" From 823f53645c2e84794b1e2544cc0b2b1b7c461309 Mon Sep 17 00:00:00 2001 From: aquariuslt Date: Thu, 5 Sep 2019 01:18:51 +0800 Subject: [PATCH 3/4] ci: use `npm run build` to build --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 23312be..e297b16 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,7 +34,7 @@ jobs: - name: Yarn install & Build run: | npm install - npm build + npm run build - name: Publish to NPM Registry run: npm publish if: github.event.action == 'created' From 56fecbd9229d79da4950044f2915d08c9c3e296b Mon Sep 17 00:00:00 2001 From: aquariuslt Date: Thu, 5 Sep 2019 01:21:54 +0800 Subject: [PATCH 4/4] ci: update .travis.yml since add `react` and `react-dom` as devDependencies --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 532caaa..8ca18f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js node_js: - - "8" - "10" + - "12" env: - REACT=16.x script: @@ -9,6 +9,5 @@ script: - npm run coverage before_install: - npm install - - npm install react react-dom after_script: npm install coveralls && nyc report --reporter=text-lcov | coveralls