Releasing
PyPI publishing is automated through the GitHub Actions workflow in
.github/workflows/publish.yml. The workflow runs when a GitHub Release is
published, and it can also be started manually from the GitHub Actions tab.
For small test releases, use a pre-release tag such as 0.1.0a1. For bug fixes
or backwards-compatible changes, use a patch release tag such as 0.1.1. For
new features or breaking changes, use a minor or major release tag such as
0.2.0 or 1.0.0.
Automated Release Workflow
The workflow:
- Installs the package test dependencies.
- Runs
python -m pytest. - Builds the source distribution and wheel with
python -m build. - Checks the built distributions with
python -m twine check dist/*. - Publishes the distributions to PyPI.
The publish job uses PyPI Trusted Publishing, so the repository does not need a
long-lived PyPI API token in GitHub Secrets. PyPI must be configured to trust
this GitHub Actions workflow before the first automated release. For the
existing mujoco-truss-gen PyPI project, add a GitHub Actions trusted publisher
with these settings:
- PyPI project name:
mujoco-truss-gen - GitHub repository owner:
isaa-sudweeks - GitHub repository name:
mujoco-truss-gen - Workflow filename:
publish.yml - GitHub environment name:
pypi
To publish a new version:
- Update
versioninpyproject.toml. - Commit and push the change.
- Create and publish a GitHub Release for that commit.
- Confirm the
Publish to PyPIworkflow passes.
PyPI versions are immutable. If a release workflow fails after uploading a
version, fix the issue, bump version again, and publish a new release.
Manual Release Checklist
- Update
versioninpyproject.toml. - Run
python -m pytest. - Run
python -m ruff check .. - Run
python -m ruff format --check .. - Build distributions with
python -m build. - Upload with
python -m twine upload dist/*. - Verify installation in a clean environment with
python -m pip install mujoco-truss-gen.
Users update to the newest published package with:
python -m pip install --upgrade mujoco-truss-gen