npm-publish.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
  3. name: Node.js Package
  4. on:
  5. create:
  6. tags:
  7. - v*
  8. jobs:
  9. build:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - uses: actions/checkout@v2
  13. - uses: actions/setup-node@v1
  14. with:
  15. node-version: 12
  16. - run: npm ci
  17. - run: npm test
  18. publish-npm:
  19. needs: build
  20. runs-on: ubuntu-latest
  21. steps:
  22. - uses: actions/checkout@v2
  23. - uses: actions/setup-node@v1
  24. with:
  25. node-version: 12
  26. registry-url: https://registry.npmjs.org/
  27. - run: npm ci
  28. - run: npm run build
  29. - run: npm publish
  30. env:
  31. NODE_AUTH_TOKEN: ${{secrets.npm_token}}
  32. - name: Upload a Build Artifact
  33. uses: actions/upload-artifact@v2.2.2
  34. with:
  35. # Artifact name
  36. name: react-ace.min.js
  37. # A file, directory or wildcard pattern that describes what to upload
  38. path: dist/react-ace.min.js
  39. # The desired behavior if no files are found using the provided path.