npm publish #16
This file contains hidden or 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
| # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | |
| # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | |
| name: npm publish | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: "19" | |
| registry-url: "https://registry.npmjs.org/" | |
| - name: Authenticate to npm | |
| run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMTOKEN }}" > ~/.npmrc | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build package | |
| run: npm run build | |
| - name: Publish package | |
| run: npm publish --access public |