Skip to content

Update npm-publish.yml #7

Update npm-publish.yml

Update npm-publish.yml #7

Workflow file for this run

name: Publishing
on:
push:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test -- test/search.test.js
publish-npm:
needs: test
runs-on: ubuntu-latest
if: success()
steps:
- uses: actions/checkout@v3
- name: Setup Node.js for publishing
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com/'
- name: Install dependencies
run: npm ci
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}