npm-publish.yml 697 B

12345678910111213141516171819202122232425
  1. # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
  2. # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
  3. name: NPM Package
  4. on:
  5. workflow_dispatch:
  6. release:
  7. types: [created]
  8. jobs:
  9. publish-npm:
  10. environment: "npm-publish"
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v3
  14. - uses: actions/setup-node@v3
  15. with:
  16. node-version: 16
  17. registry-url: https://registry.npmjs.org/
  18. - run: npm i
  19. - run: npm run build
  20. - run: npm publish
  21. env:
  22. NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}