Publish to NPM #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |