This document describes how to publish a new release of spoolman2slicer to PyPI.
Before publishing a release, ensure that:
- All tests pass on the main branch
- The code has been reviewed and approved
- You have configured PyPI trusted publishing (see below)
This project uses PyPI's Trusted Publishing feature for secure package publishing without using API tokens.
- Go to https://pypi.org/manage/account/publishing/
- Add a new pending publisher with the following details:
- PyPI Project Name:
spoolman2slicer - Owner:
bofh69 - Repository name:
spoolman2slicer - Workflow name:
publish-pypi.yml - Environment name:
pypi
- PyPI Project Name:
Note: For the first release, you may need to manually create the project on PyPI or use TestPyPI first.
To publish a new release:
-
Create a GitHub Release:
- Go to https://github.com/bofh69/spoolman2slicer/releases/new
- Create a new tag in the format
vX.Y.Z(e.g.,v0.1.0) - Add a release title and description with release notes
- Click "Publish release"
Note: Creating the release will automatically create the git tag, so you don't need to create and push the tag separately.
-
Automatic Publishing: The GitHub Actions workflow will automatically:
- Trigger when the release is published
- Update the version in Python files using
update_version.sh - Build the package (source distribution and wheel)
- Publish to PyPI using trusted publishing
-
Verify the release:
- Check the GitHub Actions workflow run at https://github.com/bofh69/spoolman2slicer/actions
- Verify the package appears on PyPI at https://pypi.org/project/spoolman2slicer/
This project follows semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR: Incompatible API changes
- MINOR: New functionality in a backward-compatible manner
- PATCH: Backward-compatible bug fixes
Tags should follow the format: vX.Y.Z (e.g., v0.1.0, v1.0.0)
- Ensure the PyPI trusted publisher is configured correctly
- Verify the workflow name and environment match the PyPI settings
- Ensure the git tag is pushed before creating the release
- The
update_version.shscript updates the VERSION variable in Python files from git tags
- Check that all dependencies are correctly specified in
pyproject.toml - Ensure
MANIFEST.inincludes all necessary non-Python files