Skip to content

Workflow file for this run

name: Publish package to registries
on:
release:
types: [created]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 21.x
registry-url: "https://registry.npmjs.org"
cache: "npm"
- run: npm ci
- run: npm run build --if-present
- run: |
cp jsr.json jsr.json.old
jq ".version = \"${TAG_NAME}\"" jsr.json.old > jsr.json
rm jsr.json.old
env:
TAG_NAME: ${{ github.event.release.tag_name }}
- run: npx jsr publish --allow-dirty --allow-slow-types
- run: npm version ${TAG_NAME} --git-tag-version=false
env:
TAG_NAME: ${{ github.event.release.tag_name }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}