From 7015fd053466186afb8718106c28aa6ecb099177 Mon Sep 17 00:00:00 2001 From: Fabrizio Ruggeri Date: Wed, 31 Jan 2024 13:33:27 +0100 Subject: [PATCH] Fix publish --- .github/workflows/publish_on_npm.yml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish_on_npm.yml b/.github/workflows/publish_on_npm.yml index 3f4648b..8e00d30 100644 --- a/.github/workflows/publish_on_npm.yml +++ b/.github/workflows/publish_on_npm.yml @@ -1,26 +1,22 @@ name: Publish to npm on: push: + branches: master tags: - '*' jobs: - deploy: + publish: runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v4 + - uses: actions/checkout@v4 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v4 with: - node-version: '20' - - - name: Install dependencies - run: npm install - - - name: Publish to npm - run: npm publish --access public + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm test + - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}