Skip to content

v0.7.2

v0.7.2 #20

Workflow file for this run

name: Publish to npm
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
with:
# Pinned: bun 1.3.14's bundler mis-emits re-export aliases (e.g.
# `export { RpcError2 as RpcError }` with RpcError2 never declared),
# producing a dist that fails to load. 1.3.5 builds a correct bundle.
bun-version: 1.3.5
- uses: actions/setup-node@v6
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Update npm
run: npm install -g npm@latest
- name: Install dependencies
run: bun install && bun run postinstall
- name: Build
run: bun run build
- name: Verify dist outputs exist
run: |
test -f dist/index.js
test -f dist/index.d.ts
- name: Verify dist actually loads
# Guards against bundler re-export bugs that emit a syntactically valid
# but unloadable module (dangling export aliases). Fails the publish
# instead of shipping a broken tarball.
run: bun -e "try { await import('./dist/index.js'); console.log('dist/index.js loaded OK'); } catch (e) { console.error('dist/index.js failed to load:', e); process.exit(1); }"
- name: Publish to npm
run: npm publish --access public --provenance