product:release

Release a product. Bump version, create Git tag, publish GitHub Release, publish to PyPI, and push a Docker image to Docker Hub.


Table of contents

  1. Usage
  2. Examples
  3. Pipeline
    1. Feature pinning guard
  4. Requirements
  5. See also

Usage

splent product:release [<version>] [--product <name>] [--skip-checks]
                      [--no-github] [--no-pypi] [--allow-unfinished]
Argument / Option Description
<version> Optional. Version to release (e.g. v1.2.1). If omitted, the semver wizard runs.
--product Override SPLENT_APP.
--skip-checks Bypass the pre-release gate (lint + tests), for emergencies only. It does not bypass the channel gate.
--no-github Publish to PyPI only. The commit and the tag stay on this machine.
--no-pypi Publish to GitHub only. The product will not exist on PyPI for this version.
--allow-unfinished Release even though the previous version never finished publishing.

A product publishes to three channels, and the Docker image is the last one, after GitHub and PyPI are already irreversible. That makes it the channel most able to diverge, so the channel gate verifies Docker Hub with the others, before anything moves.


Examples

Interactive (recommended).

splent product:release
  Fetching current version from GitHub...
  Current version: v1.0.3

  Bump type:
    [1] patch  v1.0.4   bug fixes, no new features
    [2] minor  v1.1.0   new features, backward compatible
    [3] major  v2.0.0   breaking changes
    [4] cancel

  Choice: 1

  Will release as v1.0.4
  Proceed? [y/N]: y

  Releasing my_first_app v1.0.4

  Release gate (channels)
  github   ready, my-org/my_first_app accepts push, tag and release as drorganvidez
  pypi     ready, credentials accepted, my_first_app exists so this is a new version
  docker   ready, credentials accepted for my-org/my_first_app

  version  1.0.4 written to pyproject.toml
  commit   changes committed
  pypi     building package...
  pypi     upload complete
  tag      v1.0.4 created
  tag      v1.0.4 pushed to origin
  github   release created: https://github.com/...
  docker   logging into Docker Hub...
  docker   building image...
  docker   pushing images...
  docker   push complete

  my_first_app v1.0.4 released.

Explicit version.

splent product:release v1.0.4

Override the product.

splent product:release v1.0.4 --product other_app

Pipeline

  1. Validates environment credentials (GitHub, PyPI and Docker Hub).
  2. Guards. All features must be pinned (no editable features allowed).
  3. Channel gate, pass one, across all three channels.
  4. Pre-release gate. ruff lint + product:test. Aborts with no changes if either fails. Skip with --skip-checks.
  5. Channel gate, pass two. The binding one.
  6. Bumps the version in <product>/pyproject.toml, stages and commits.
  7. Cleans build artifacts, builds, and uploads the package to PyPI.
  8. Pushes main, creates and pushes the Git tag (v<version>), creates the GitHub Release.
  9. Builds and pushes Docker images to Docker Hub.
    • <user>/<product>:<version>
    • <user>/<product>:latest

PyPI goes before anything is pushed, because a PyPI version can never be replaced or removed. If a later step fails, the run says the channels have diverged and prints the release:resume command, which finishes what is missing (Docker image included) without bumping the version.

Feature pinning guard

A product release must be reproducible. If any feature is editable (no version pinned), the command refuses to proceed and lists the offending features.

  Cannot release: the following features are editable (no version pinned):

    - splent-io/splent_feature_notes

  A product release must be reproducible. Pin all features first:
    splent feature:release <feature>
    splent feature:attach <feature> <version>

Requirements

Variable Required Description
TWINE_USERNAME / PYPI_USERNAME Yes PyPI authentication
TWINE_PASSWORD / PYPI_PASSWORD Yes PyPI API token
DOCKERHUB_USERNAME Yes Docker Hub authentication
DOCKERHUB_PASSWORD Yes Docker Hub password
GITHUB_TOKEN Yes The channel gate refuses to start without it. Also what keeps the semver wizard off the anonymous rate limit

Verify credentials before releasing.

splent check:github
splent check:pypi

See also


Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es