Skip to content
Latchkey

JSR Manual Publish workflow (google/zx)

The JSR Manual Publish workflow from google/zx, explained and optimized by Latchkey.

A

CI health: A - excellent

Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: google/zx.github/workflows/jsr-publish.ymlLicense Apache-2.0View source

What it does

This is the JSR Manual Publish workflow from the google/zx repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: JSR Manual Publish

on:
  workflow_dispatch:

permissions: {}

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          persist-credentials: false
      - uses: actions/setup-node@v6
        with:
          node-version: 24
          cache: 'npm'
      - run: npm ci
      - run: npm test
        env:
          FORCE_COLOR: 3
      - uses: actions/upload-artifact@v6
        with:
          name: build-${{ github.run_id }}
          path: |
            build
            jsr.json
          retention-days: 1

  jsr-publish:
    needs: build
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v6
        with:
          persist-credentials: false
      - uses: actions/setup-node@v6
        with:
          node-version: 24
          cache: 'npm'
      - uses: actions/download-artifact@v7
        with:
          name: build-${{ github.run_id }}

      - name: Get zx version info
        run: |
          echo SHA_SHORT=$(git rev-parse --short HEAD) >> $GITHUB_ENV
          echo ZX_VERSION=$(jq -r '.version' jsr.json) >> $GITHUB_ENV

      - name: pushing to jsr.io
        run: |
          cat <<< $(jq '.version="${ZX_VERSION}-dev.${SHA_SHORT}"' jsr.json) > jsr.json
          npx jsr publish --allow-dirty

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: JSR Manual Publish
 
on:
  workflow_dispatch:
 
permissions: {}
 
jobs:
  build:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v6
        with:
          persist-credentials: false
      - uses: actions/setup-node@v6
        with:
          node-version: 24
          cache: 'npm'
      - run: npm ci
      - run: npm test
        env:
          FORCE_COLOR: 3
      - uses: actions/upload-artifact@v6
        with:
          name: build-${{ github.run_id }}
          path: |
            build
            jsr.json
          retention-days: 1
 
  jsr-publish:
    timeout-minutes: 30
    needs: build
    runs-on: latchkey-small
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/checkout@v6
        with:
          persist-credentials: false
      - uses: actions/setup-node@v6
        with:
          node-version: 24
          cache: 'npm'
      - uses: actions/download-artifact@v7
        with:
          name: build-${{ github.run_id }}
 
      - name: Get zx version info
        run: |
          echo SHA_SHORT=$(git rev-parse --short HEAD) >> $GITHUB_ENV
          echo ZX_VERSION=$(jq -r '.version' jsr.json) >> $GITHUB_ENV
 
      - name: pushing to jsr.io
        run: |
          cat <<< $(jq '.version="${ZX_VERSION}-dev.${SHA_SHORT}"' jsr.json) > jsr.json
          npx jsr publish --allow-dirty
 

What changed

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

This workflow runs 2 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow