name: Publish JSR on: workflow_dispatch: inputs: publish: description: Run the real JSR publish after the dry run passes required: true default: "false" type: choice options: - "false" - "true" jobs: publish: name: Publish JSR workspace runs-on: ubuntu-latest permissions: contents: read id-token: write steps: - name: Checkout uses: actions/checkout@v7 - name: Verify JSR/Deno toolchain is present run: | if [ ! -f deno.jsonc ] || [ ! -f deno.lock ]; then echo "::error::deno.jsonc/deno.lock not found on this ref ('${{ github.ref_name }}'). This workflow publishes the JSR (2.0) workspace and must be run against the branch that has the Deno/JSR tooling (e.g. 'next'), not '${{ github.ref_name }}'. Re-run with 'Use workflow from' set to the correct branch." >&2 exit 1 fi - uses: pnpm/action-setup@v6 - name: Setup Node.js environment uses: actions/setup-node@v6 with: node-version: 22 cache: pnpm - name: Set up Deno uses: denoland/setup-deno@v2 with: deno-version: v2.x - name: Install Dependencies run: pnpm i - name: Install Deno dependencies run: | if [ -f deno.lock ]; then deno ci else deno install fi - name: Sync deno.jsonc versions from package.json run: pnpm jsr:sync-versions - name: Build packages run: pnpm build - name: Publish dry run run: deno publish --dry-run --check --allow-slow-types - name: Publish to JSR if: ${{ inputs.publish == 'true' }} run: deno publish --check --allow-slow-types