From 82046a76cf7f1ecd4f1af50341fcb1ea36ac2bae Mon Sep 17 00:00:00 2001 From: Ademola Adegbuyi Date: Sat, 23 Jan 2021 14:18:28 +0100 Subject: [PATCH] Add NPM workflow --- .github/workflows/build-test-code.yml | 2 +- .github/workflows/publish-on-npm.yml | 19 +++++++++++++++++++ README.md | 3 ++- package.json | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish-on-npm.yml diff --git a/.github/workflows/build-test-code.yml b/.github/workflows/build-test-code.yml index 211a9fd..505b2c8 100644 --- a/.github/workflows/build-test-code.yml +++ b/.github/workflows/build-test-code.yml @@ -1,4 +1,4 @@ -name: PR Action +name: CI Tests on: pull_request: diff --git a/.github/workflows/publish-on-npm.yml b/.github/workflows/publish-on-npm.yml new file mode 100644 index 0000000..4040ee6 --- /dev/null +++ b/.github/workflows/publish-on-npm.yml @@ -0,0 +1,19 @@ +name: Publish on NPM + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: 'https://registry.npmjs.org' + - run: yarn install --frozen-lockfile + - run: yarn publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index f6d2920..7706287 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@

~700B React Click Away Listener

npm - Coverage Status + Coverage Status + CI Tests downloads/month pullrequest firsttimersonly diff --git a/package.json b/package.json index 82ecfe8..4198dbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-click-away-listener", - "version": "1.5.0", + "version": "1.5.1", "description": "A simple click away listener built with React Hooks", "main": "dist/react-click-away-listener.js", "module": "dist/react-click-away-listener.es.js",