Skip to content

pkg: fix package building in npm workflow #2

pkg: fix package building in npm workflow

pkg: fix package building in npm workflow #2

Workflow file for this run

name: Publish (NPM)
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun i
- name: Build package
run: bun run build
- name: Publish package
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
npm publish --access public
- name: Cleanup
run: |
rm -f .npmrc