multimind-sdk to PyPI using
the .github/workflows/release.yml pipeline.
Overview
The release pipeline has three jobs, run in order:- build —
python -m buildproduces an sdist + wheel,twine checkvalidates the metadata, and both are uploaded as adistartifact. - test-wheel — installs the built wheel (not an editable checkout) into
a clean environment and runs a smoke subset (
tests/test_import.py,tests/test_basic.py) against it. This catches packaging bugs (missing package data, badpackages.findexcludes, etc.) that an editable install would never surface. - publish — publishes to PyPI using
OIDC trusted publishing via
pypa/gh-action-pypi-publish. No PyPI API token is stored as a repo secret; the job authenticates using a short-lived OIDC token instead. This job only runs for an actual published GitHub release — pushing av*tag alone (orworkflow_dispatch) exercisesbuild/test-wheelonly, so you can validate packaging without publishing.
Version bump location
The package version is defined in one place:pyproject.toml reads it dynamically (dynamic = ["version"],
[tool.setuptools.dynamic] version = {attr = "multimind.__version__"}), so
there is nothing else to bump — no version string in pyproject.toml,
setup.py, or docs needs manual updating.
Tag / release flow
- Bump
__version__inmultimind/__init__.pyondevelop(or a release branch), open a PR, get it merged. - Update
CHANGELOG.mdwith the new version’s notes. - Tag the merge commit and push the tag:
This alone triggers
build+test-wheel(notpublish) — a good opportunity to confirm the wheel installs and imports cleanly before committing to a public release. - Create a GitHub Release from that tag (via the GitHub UI, or
gh release create v1.0.0 --generate-notes). Publishing the release is what triggers thepublishjob and pushes to PyPI. - The
v*tag also runs theDocker imageworkflow (.github/workflows/docker.yml), which publishesghcr.io/multimindlab/multimind-sdk:1.0.0,:1.0, and:latestfor amd64 and arm64 after a smoke test. Merges todeveloppublish:develop; the workflow can also be run by hand from the Actions tab. The first push creates the package private: set it to public once under the repository’s Packages settings.
One-time trusted-publisher setup on pypi.org
Trusted publishing must be registered once per PyPI project before thepublish job can authenticate. As a maintainer with access to the
multimind-sdk project on PyPI:
- Log in to https://pypi.org and go to the project’s
Publishing settings (Account settings → Publishing, or directly at
https://pypi.org/manage/project/multimind-sdk/settings/publishing/). - Add a new GitHub trusted publisher with:
- Owner:
multimindlab - Repository name:
multimind-sdk - Workflow name:
release.yml - Environment name:
pypi(must match theenvironment:block inrelease.yml’spublishjob)
- Owner:
- Save. No API token needs to be generated or copied into GitHub secrets —
the OIDC exchange is handled entirely by
id-token: writepermission in the workflow plus this registration. - In the GitHub repo, create an environment named
pypi(Settings → Environments) if it doesn’t already exist. Optionally add required reviewers here for an extra manual gate before publish runs.
TestPyPI (optional)
For dry-running the whole pipeline against TestPyPI before it’s wired to the real index, repeat the same steps on https://test.pypi.org with:- Environment name:
testpypi
publish job in release.yml (pointed at
https://test.pypi.org/legacy/), gated behind its own testpypi
environment.
Manual release checklist
-
__version__inmultimind/__init__.pybumped and merged todevelop -
CHANGELOG.mdupdated - CI green on the commit being tagged (
.github/workflows/ci.yml) - Tag pushed (
git tag vX.Y.Z && git push origin vX.Y.Z) -
build+test-wheeljobs green for that tag - GitHub Release created from the tag (this triggers
publish) -
publishjob green — confirm the new version appears on https://pypi.org/project/multimind-sdk/ - Smoke-install from PyPI in a scratch venv:
pip install multimind-sdk==X.Y.Z && python -c "import multimind; print(multimind.__version__)"
