name: Publish to NPM

on:
  push:
    branches: [master]
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        os: [ubuntu-latest]
        node-version: [21.x]

    steps:
      - uses: actions/checkout@v2
      - run: npm install
      - run: npm run pack
      - run: cp README.md ./dist/lib/README.md
      - uses: JS-DevTools/npm-publish@v1
        with:
          token: ${{ secrets.NPM_TOKEN }}
          package: './dist/lib/package.json'
