From 208bcc41d29a207db7c4921ed26ea0d0cf668c2d Mon Sep 17 00:00:00 2001 From: typicode Date: Thu, 28 Apr 2022 06:25:41 +0200 Subject: [PATCH] chore: update workflow --- .github/workflows/node.js.yml | 2 -- .github/workflows/npm_publish.yml | 33 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/npm_publish.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 192328995..dae6456bc 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -6,9 +6,7 @@ on: [push] jobs: build: - runs-on: ${{ matrix.os }} - strategy: matrix: node-version: [14, 16, 18] diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml new file mode 100644 index 000000000..e62acc870 --- /dev/null +++ b/.github/workflows/npm_publish.yml @@ -0,0 +1,33 @@ +# 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: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm run build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}}