Skip to content

Publish to npm

Publish to npm #24

Workflow file for this run

name: Publish to npm
on:
release:
types: [published]
workflow_dispatch:
inputs:
dry-run:
description: "Run in dry-run mode (no actual publish)"
required: false
default: "false"
type: boolean
package:
description: "Package to publish (charts, colours, components, or all)"
required: false
default: "all"
type: choice
options:
- all
- charts
- colours
- components
permissions:
id-token: write
contents: read
env:
DRY_RUN: ${{ github.event.inputs.dry-run == 'true' && '--dry-run' || '' }}
jobs:
publish-charts:
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'charts' || github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bunx npm publish --access public --provenance ${{ env.DRY_RUN }}
working-directory: packages/charts
publish-colours:
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'colours' || github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun run build
working-directory: packages/colours
- run: bunx npm publish --access public --provenance ${{ env.DRY_RUN }}
working-directory: packages/colours
publish-components:
if: github.event.inputs.package == 'all' || github.event.inputs.package == 'components' || github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bunx npm publish --access public --provenance ${{ env.DRY_RUN }}
working-directory: packages/components