Publish packages to JSR

Configure exports, verify TypeScript packages, and publish provenance from GitHub Actions OIDC

JSR targets modern ESM packages, encourages publishing TypeScript source, and generates API documentation. JSR packages can be consumed from Deno, Node.js, and other tools.

Minimal package configuration

{
  "name": "@scope/greet",
  "version": "1.0.0",
  "exports": {
    ".": "./mod.ts",
    "./testing": "./testing.ts"
  },
  "publish": {
    "exclude": ["coverage", "*.snap"]
  }
}

JSR publishes ESM only. File names must work on Windows and Unix, and cross-file imports must resolve at publication. Avoid slow types in public APIs to improve checking, generated docs, and Node compatibility.

Pre-publication verification

deno fmt --check
deno lint
deno check mod.ts
deno test
deno publish --dry-run

--dry-run lists actual upload files and runs registry validation. Published versions are immutable and cannot be deleted; yank a critically broken version or archive an abandoned package.

GitHub Actions OIDC

Link the GitHub repository in JSR package settings, then grant the workflow an OIDC token:

name: publish
on:
  push:
    tags: ["v*"]
jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v7
      - uses: denoland/setup-deno@v2
        with:
          deno-version: v2.x
      - run: deno publish

OIDC avoids a long-lived publication token and produces a provenance attestation. Other CI providers can use --token, but official docs state that token publication does not generate provenance.

Official sources: Publishing packages, Package configuration, and Packages and versions.

Type to search all documentation.