Skip to content

Update GitHub Actions workflow to use npm for publishing instead of B… #3

Update GitHub Actions workflow to use npm for publishing instead of B…

Update GitHub Actions workflow to use npm for publishing instead of B… #3

Workflow file for this run

name: Publish to npm
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'
permissions:
contents: read
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install
run: bun install --no-progress
- name: Build
run: bun run build
- name: Setup Node for npm publish
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Publish (npm)
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public