Skip to content
Latchkey

Publish Package workflow (firecrawl/firecrawl-mcp-server)

The Publish Package workflow from firecrawl/firecrawl-mcp-server, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get run de-duplication, 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: firecrawl/firecrawl-mcp-server.github/workflows/publish.ymlLicense MITView source

What it does

This is the Publish Package workflow from the firecrawl/firecrawl-mcp-server repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

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

The workflow

workflow (.yml)
name: Publish Package

on:
  push:
    branches:
      - main
    paths:
      - package.json
  workflow_dispatch:

jobs:
  publish:
    name: Publish
    runs-on: ubuntu-latest
    permissions:
      id-token: write  # Required for OIDC authentication with MCP registry
      contents: read

    steps:
      - uses: actions/checkout@v5

      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4
        with:
          version: 10

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "pnpm"

      - name: Authenticate
        run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

      - name: Publish to NPM
        run: |
          pnpm install
          pnpm run build
          pnpm publish --access public --no-git-checks

      - name: Install MCP Publisher
        run: |
          curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher

      - name: Login to MCP Registry
        run: ./mcp-publisher login github-oidc

      - name: Sync MCP Registry version
        run: |
          node -e "
            const fs = require('fs');
            const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
            const manifest = JSON.parse(fs.readFileSync('server.json', 'utf8'));
            manifest.version = packageJson.version;
            for (const pkg of manifest.packages ?? []) {
              if (pkg.registryType === 'npm' && pkg.identifier === 'firecrawl-mcp') {
                pkg.version = packageJson.version;
              }
            }
            fs.writeFileSync('server.json', JSON.stringify(manifest, null, 2) + '\n');
          "

      - name: Publish to MCP Registry
        run: ./mcp-publisher publish

The same workflow, on Latchkey

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

name: Publish Package
 
on:
  push:
    branches:
      - main
    paths:
      - package.json
  workflow_dispatch:
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  publish:
    timeout-minutes: 30
    name: Publish
    runs-on: latchkey-small
    permissions:
      id-token: write  # Required for OIDC authentication with MCP registry
      contents: read
 
    steps:
      - uses: actions/checkout@v5
 
      - name: Install pnpm
        uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4
        with:
          version: 10
 
      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "pnpm"
 
      - name: Authenticate
        run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
 
      - name: Publish to NPM
        run: |
          pnpm install
          pnpm run build
          pnpm publish --access public --no-git-checks
 
      - name: Install MCP Publisher
        run: |
          curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
 
      - name: Login to MCP Registry
        run: ./mcp-publisher login github-oidc
 
      - name: Sync MCP Registry version
        run: |
          node -e "
            const fs = require('fs');
            const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'));
            const manifest = JSON.parse(fs.readFileSync('server.json', 'utf8'));
            manifest.version = packageJson.version;
            for (const pkg of manifest.packages ?? []) {
              if (pkg.registryType === 'npm' && pkg.identifier === 'firecrawl-mcp') {
                pkg.version = packageJson.version;
              }
            }
            fs.writeFileSync('server.json', JSON.stringify(manifest, null, 2) + '\n');
          "
 
      - name: Publish to MCP Registry
        run: ./mcp-publisher publish
 

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 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow