Publish Package to npmjs & GitHub Packages #8
Workflow file for this run
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 Package to npmjs & GitHub Packages | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write # npm provenance | |
| packages: write # GitHub Packages | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| - run: yarn install | |
| - run: yarn build | |
| - name: Configure npm for npmjs | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Publish to npmjs | |
| run: npm publish --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Configure npm for GitHub Packages | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@weroad' | |
| - name: Publish to GitHub Packages | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |