Search This Blog

Tuesday, June 30, 2026

Cruxpy as an example of the python package release process

As mentioned beforeCruxPy helped me to automate the process of keeping the repository of my Crux ports rolling. It also gave me a chance to prepare a pipeline for a Python package with GitHub Action (GHA) workflows.

On every commit the GHA runs 2 jobs. First, pytest. When the tests pass, it checks the version stored in the pyproject.toml file, and compares it to the latest tag. If the version from the file is higher than the current tag, the new one is pushed. These jobs are stored in the commit.yaml file.

When there is a new tag pushed to the code, another workflow, from the release.yaml file, kicks off. It has only one job - to create a GitHub release.

The completion of the "New Release" job triggers the third workflow saved in the deploy.yaml file. It is responsible for publishing the python package to the pypi repository.

If you are just starting your adventure with GHA, you might want to check triggers to understand them better.  This pipeline uses three distinct types:

  • commit is defined as push to every branch (excluding tags)
  • release uses a push of a tag, that matches 3-number semantic version
  • deployment relays on the internal GitHub workflow dependencies.

This structure allows me to push changes directly to the main branch safely. Nothing becomes visible outside of repository until the version is bumped!

No comments: