Skip to content
Latchkey

Publish workflow (jowilf/starlette-admin)

The Publish workflow from jowilf/starlette-admin, explained and optimized by Latchkey.

A

CI health: A - excellent

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: jowilf/starlette-admin.github/workflows/publish.ymlLicense MITView source

What it does

This is the Publish workflow from the jowilf/starlette-admin 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
on:
  workflow_dispatch:
  release:
    types: [published]

permissions:
  contents: read

jobs:
  publish:
    name: "Publish release"
    runs-on: "ubuntu-latest"

    steps:
      - uses: "actions/checkout@v6"
      - uses: "actions/setup-python@v6"
        with:
          python-version: "3.10"
          cache: "pip"
      - name: Install Dependencies
        run: pip install hatch
      - name: Build
        run: hatch build
      - name: Publish
        env:
          HATCH_INDEX_USER: __token__
          HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
        run: hatch publish

The same workflow, on Latchkey

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

name: Publish
on:
  workflow_dispatch:
  release:
    types: [published]
 
permissions:
  contents: read
 
jobs:
  publish:
    timeout-minutes: 30
    name: "Publish release"
    runs-on: "ubuntu-latest"
 
    steps:
      - uses: "actions/checkout@v6"
      - uses: "actions/setup-python@v6"
        with:
          python-version: "3.10"
          cache: "pip"
      - name: Install Dependencies
        run: pip install hatch
      - name: Build
        run: hatch build
      - name: Publish
        env:
          HATCH_INDEX_USER: __token__
          HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
        run: hatch 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.