---
myst:
  html_meta:
    "description": "About the repoplone release pipeline: why a release is an ordered list of steps, what a dry run can and cannot show, and how to restart a failed release."
    "property=og:description": "About the repoplone release pipeline: why a release is an ordered list of steps, what a dry run can and cannot show, and how to restart a failed release."
    "property=og:title": "The release pipeline"
    "keywords": "Plone, repoplone, release, pipeline, steps, dry run, local_step"
---

(release-pipeline)=

# The release pipeline

`repoplone release` runs a release as an ordered list of steps.
This page explains why it works that way, and what that means when a release fails.

(release-pipeline-why)=

## A release is a sequence

A release of a Plone project does the same things in the same order every time.

1. Collect the news fragments into a changelog entry, and read it.
1. Choose the next version.
1. Write the changelog, the version file, and the compose files.
1. Version, build, and publish each Python package.
1. Version, build, and publish each Node package.
1. Commit, tag, and push.
1. Create a release on GitHub.

The order matters.
The changelog entry needs the version.
The packages need the changelog.
The tag must point to a commit that holds all of it.

repoplone makes each of these a step with an id: `changelog`, `version`, `repository`, `release_python`, `release_node`, `git`, `gh_release`, and `bye`.
The list of steps is the release.

(release-pipeline-points)=

## The point of no return

The first steps can stop without leaving a trace.
`changelog` and `version` write nothing.
They ask for confirmation, and answering no ends the release with nothing changed.

The middle steps change the working tree.
`repository` and the package steps write versions and changelogs, and delete news fragments.
They also publish packages, and a published version cannot be published again.

`git` pushes the commit and the tag.
After it, the release is public.

repoplone checks what it can before the first step.
It confirms that you can publish to PyPI and npm when a package needs it, and warns when it cannot create the GitHub release.
A release that fails these checks never starts.

(release-pipeline-dry-run)=

## What a dry run shows

`--dry-run` runs every step without writing release files, committing, tagging, or publishing.
It shows the changelog entry, the version, and the files each step would change.
For Node packages, it runs release-it in its own dry-run mode.

A dry run does not compile the `.po` files of each Python package, so it leaves no `.mo` files behind.
For each Python package it would publish, it runs `uv build`.
This catches a broken build before the real release.
It does leave `dist/` folders behind.

(release-pipeline-restart)=

## Restarting a failed release

A release can fail halfway, for instance when PyPI rejects an upload.
By then, the version file and the changelogs already hold the new version, and the news fragments are gone.
Starting over from the first step would build an empty changelog.

`--start-step` restarts the release from a given step.
The steps before it are skipped.
After `version`, repoplone cannot ask for the version, because the version file already holds the new one.
You give it on the command line instead.

```shell
uvx repoplone release --start-step release_python 1.2.0
```

The package steps skip each package already published at that version.
A restart uploads only what is missing.

(release-pipeline-custom)=

## A pipeline you can change

Projects differ at the edges.
A site may publish nothing to PyPI.
An add-on may have no GitHub release.
A team may want a message in its chat after each release.

`[repository.release]` in `repository.toml` replaces the list of steps.
It can drop steps, reorder them, and add steps of your own.
A step of your own is a Python function in the repository, registered as a `local_step`.
It receives the settings and the state of the release, and returns whether it succeeded.

repoplone validates the list when it reads the file.
`repoplone settings sanity-check` also imports each function.
A broken hook then fails before a release starts.

```{seealso}
- {doc}`/how-to/release`, to run a release.
- {doc}`/how-to/customize-the-release`, to change the steps.
- {doc}`/reference/release-steps`, for what each step reads and writes.
```
