Publishing
Release Checklist
Update
glpi_python_client.__version__.Update the project version in
pyproject.toml.Update
CHANGELOG.md.Run the full check suite.
python -m pytest
python -m ruff check .
python -m mypy glpi_python_client
python -m sphinx -b html docs docs/_build/html
python -m build
Build Artifacts
python -m pip install build twine
python -m build
python -m twine check dist/*
Publish
Published GitHub releases now upload the package to PyPI automatically through
.github/workflows/release.yml.
This repository now uses PyPI Trusted Publishing rather than a long-lived PyPI API token stored in GitHub secrets.
GitHub Actions side:
Workflow:
.github/workflows/release.ymlJob:
publish-pypiEnvironment:
pypiRequired permission:
id-token: write
PyPI side:
- If the
glpi-python-clientproject already exists on PyPI, add a trusted publisher for:
owner:
baralinerepository:
glpi_python_clientworkflow:
release.ymlenvironment:
pypi
- If the
- If the project does not exist yet on PyPI, create a pending trusted
publisher with the same GitHub configuration and the PyPI project name
glpi-python-client.
Release flow:
Push the release commit and tag.
Publish the GitHub release.
Let the release workflow run the test, quality, build, metadata, and PyPI publication steps.
The release workflow validates that the GitHub release tag,
pyproject.toml version, and glpi_python_client.__version__ all match
before it builds and publishes the package.
No PYPI_API_TOKEN GitHub secret is required for this flow.
Manual fallback:
Publish to TestPyPI first if you need to validate the artifacts manually:
python -m twine upload --repository testpypi dist/*
Then publish to PyPI manually if the workflow is unavailable:
python -m twine upload dist/*
The GitHub release should only be published after the version and changelog are ready, because publishing the release now triggers the PyPI upload.
GitHub Actions and Read the Docs
The repository ships with two GitHub Actions workflows:
.github/workflows/ci.ymlruns on pull requests and pushes tomain.It executes
pyteston Python 3.10 through 3.13, then runsruff,mypy, and the Sphinx build on Python 3.12.
.github/workflows/release.ymlruns on published GitHub releases. Itrepeats the quality checks, builds the source and wheel distributions, validates them with
twine check, and publishes them to PyPI through a GitHub Actions trusted publisher configuration on PyPI.
Read the Docs publication is triggered from those workflows when the following GitHub repository secrets are configured:
READTHEDOCS_TOKENREADTHEDOCS_PROJECT
Optional GitHub repository variables can override the defaults used by the workflows:
READTHEDOCS_BASE_URL(defaults tohttps://app.readthedocs.org)READTHEDOCS_MAIN_VERSION(defaults tolatest)READTHEDOCS_RELEASE_VERSION(defaults tostable)
The CI workflow triggers the configured main-branch documentation build after a
successful push to main. The release workflow first calls the Read the Docs
sync-versions endpoint, then triggers the configured release version build.