From d5e0dcc69d24ca8d829bcff8645a4ad1a2f0b701 Mon Sep 17 00:00:00 2001 From: divlo Date: Sun, 27 Dec 2020 18:42:48 +0100 Subject: [PATCH] ci: add npm-publish --- .github/workflows/npm-publish.yml | 30 ++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..d54d5eb --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,30 @@ +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: 'Node.js Package' + +on: + release: + types: [created] + +jobs: + publish-npm: + runs-on: 'ubuntu-latest' + steps: + - uses: 'actions/checkout@v2' + + - name: 'Cache dependencies' + uses: 'actions/cache@v2' + with: + path: '**/node_modules' + key: ${{ runner.os }}-${{ hashFiles('**/package.json') }} + + - uses: 'actions/setup-node@v2.1.2' + with: + node-version: 14 + registry-url: 'https://registry.npmjs.org/' + + - run: 'npm install' + - run: 'npm run build' + - run: 'npm publish' + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/package.json b/package.json index e74d515..0aaaf8c 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,8 @@ }, "scripts": { "test": "mocha", - "lint": "exit 0" + "lint": "exit 0", + "build": "exit 0" }, "dependencies": { "jsonwebtoken": "8.5.1",