Skip to content

Publish to NPM

Publish to NPM #134

name: Publish to NPM
on:
workflow_run:
workflows: ["Create Release"]
types: [completed]
jobs:
push-to-npm:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- name: Install packages
run: npm ci
- name: Build package
run: npm run build
- name: Package files
run: |
cp -r types lib
- name: Publish on npm
run: cd lib && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}