Publish to npm #2
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
| name: Publish to npm | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| # No lockfile is committed (package-lock.json is gitignored), so npm ci will fail. | |
| # We also ignore scripts to avoid running "prepare" during install; build is explicit below. | |
| run: npm install --ignore-scripts --no-audit --no-fund | |
| - name: Lint | |
| run: npm run lint | |
| - name: Test | |
| run: npm test | |
| - name: Build | |
| run: npm run build | |
| - name: Publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.TANGO_NPM_TOKEN }} | |
| run: npm publish --access public --provenance | |