Seeing a Package Release Pipeline, Stage by Stage

A release pipeline is easier to reason about as a picture than as a YAML file. Below are six diagrams, described in words so you can redraw them on a whiteboard for your team. Together they show one pipeline for a hypothetical library, Package L, from merged pull request to announcement, and mark the point where each safety check lives.

Diagram 1: The overview

Caption: a left-to-right row of six rounded boxes joined by arrows: Merge, Version, Build, Verify, Publish, Announce. A dashed vertical line between Verify and Publish is labelled "point of no return".

Everything to the left of the dashed line can be redone freely. Everything to the right is visible to the world and, on most registries, permanent for that version number. The design goal is to push every check you can to the left.

Diagram 2: Merge and version

Caption: several small commit dots flowing into a main branch; a box labelled "release PR" collects them and outputs a version number and a changelog section.

  1. Pull requests carry a change type, either through Conventional Commits messages or a small changeset file.
  2. A release step reads those since the last tag and proposes the next version: patch, minor or major.
  3. A human reviews the proposed version and changelog in one pull request. Merging it is the decision to release.

Diagram 3: Build once

Caption: a single box labelled "build job" producing one artefact icon (a tarball or wheel). An arrow from the artefact goes to a storage shelf marked "CI artefacts".

The key idea: the artefact is built exactly once, from the tagged commit, in a clean environment. Every later stage uses that file. Rebuilding at publish time invites the classic bug where what you tested is not what you shipped.

Diagram 4: Verify

Caption: the artefact in the centre with four spokes leading to checks: "install and import", "tests against installed copy", "metadata lint", "size and contents".

CheckCatchesExample tool or command
Install and importMissing files, broken entry pointsInstall the artefact in a fresh project
Tests against installed copyCode that only works from the source treeRun the suite from outside the repo
Metadata lintBad exports maps, unrenderable READMEpublint, twine check
Size and contentsAccidentally shipped secrets or test fixturesnpm pack --dry-run, listing the wheel

Diagram 5: Publish

Caption: the artefact passing through a gate drawn as a padlock labelled "protected environment", then into a registry box. A small badge on the arrow reads "OIDC, no stored token".

  1. The publish job runs only for version tags and only after approval in a protected environment.
  2. It authenticates with a short-lived identity token rather than a stored secret, where the registry supports trusted publishing.
  3. It publishes the verified artefact and, where available, attaches a provenance statement.

Our trusted publishing workflow tutorial turns this diagram into a working file.

Diagram 6: Announce and watch

Caption: from the registry box, three thin arrows to "release notes", "docs site" and "issue tracker". A clock icon labelled "first 48 hours" sits above the issue tracker.

Create the repository release from the changelog section, update versioned docs, then watch incoming issues closely for the first couple of days. Have a written plan for a bad release: publish a fixed patch quickly, and use the registry's deprecation or yank features for the broken version rather than trying to delete it.

Redrawing it for your project

For the versioning decisions in Diagram 2, see the semver edge cases FAQ.