|
| 1 | +# Release Guide |
| 2 | + |
| 3 | +This document describes how to publish the `kfp-components` package and how to react if a release needs to be withdrawn. Follow every step to keep automation, downstream consumers, and PyPI in sync. |
| 4 | + |
| 5 | +## Versioning Strategy |
| 6 | + |
| 7 | +We use [Semantic Versioning](https://semver.org/) for `kfp-components`. |
| 8 | + |
| 9 | +- **Major** (`vX.0.0`): Breaking changes or alignment with a new Kubeflow Pipelines major release. Coordinate with the Pipelines Working Group before cutting a major. |
| 10 | +- **Minor** (`vX.Y.0`): New components, features, or dependency bumps that stay backward compatible. |
| 11 | +- **Patch** (`vX.Y.Z`): Bug fixes, metadata refreshes, or documentation-only updates. |
| 12 | + |
| 13 | +All git tags **must be prefixed with `v`** (for example: `v1.11.0`). The GitHub Actions workflows ignore tags without that prefix, so `1.11.0` will not build or publish artifacts. |
| 14 | + |
| 15 | +## Pre-release Checklist |
| 16 | + |
| 17 | +1. Confirm the main branch is healthy: CI is green and `uv build` succeeds locally. |
| 18 | +2. Ensure all required documentation updates (including changelog entries if applicable) are committed. |
| 19 | +3. Make sure `pyproject.toml` already contains the release metadata you intend to publish (name, classifiers, dependencies). |
| 20 | + |
| 21 | +## Release Procedure |
| 22 | + |
| 23 | +1. **Update the version** in `pyproject.toml` under the `[project]` section. |
| 24 | +2. **Commit** the change with a message such as `chore: bump version to v1.11.1`. |
| 25 | +3. **Tag the commit** using the `v` prefix: |
| 26 | + |
| 27 | + ```bash |
| 28 | + git tag v1.11.1 |
| 29 | + git push origin main |
| 30 | + git push origin v1.11.1 |
| 31 | + ``` |
| 32 | + |
| 33 | +4. Wait for GitHub Actions to finish (details below). Publish release notes on GitHub after the workflow succeeds. |
| 34 | + |
| 35 | +## GitHub Actions Automation |
| 36 | + |
| 37 | +Two workflows collaborate to ship a release. |
| 38 | + |
| 39 | +### Build Validation (`.github/workflows/build-packages.yml`) |
| 40 | + |
| 41 | +- **Trigger**: pushes to `main` and pull requests targeting `main`. |
| 42 | +- **Behavior**: |
| 43 | + - Uses a Python matrix (currently 3.11 and 3.13) to build, validate, and test the package. |
| 44 | + - Uploads the artifacts for inspection. No publish occurs. |
| 45 | +- **What it does**: |
| 46 | + - Builds wheel and source distributions with `uv build`. |
| 47 | + - Validates wheel contents and metadata. |
| 48 | + - Creates an isolated virtual environment and verifies that `kfp-components` installs and imports correctly. |
| 49 | + - Uploads the build artifacts as workflow artifacts for traceability. |
| 50 | + |
| 51 | +### Release Pipeline (`.github/workflows/release.yml`) |
| 52 | + |
| 53 | +- **Trigger**: pushes to tags that match `vX.Y.Z` (semantic versioning with a leading `v`). |
| 54 | +- **How it works**: |
| 55 | + - Calls the reusable `build-packages.yml` workflow with a single Python version (3.11) and `publish_packages=true`. |
| 56 | + - The reusable workflow switches into “release mode,” which: |
| 57 | + - Installs `build` and `twine`. |
| 58 | + - Builds an sdist (`python -m build --sdist`). |
| 59 | + - Unpacks the sdist into a temporary directory. |
| 60 | + - Rebuilds the wheel using the unpacked sdist contents. |
| 61 | + - Runs `twine check` on the sdist and wheel. |
| 62 | + - Performs the same validation and import smoke tests as the main workflow. |
| 63 | + - Uploads the artifacts for auditing. |
| 64 | + - Publishes the release to PyPI via Trusted Publishing (GitHub Actions OIDC), so no manual credential management or `twine upload` step is required. |
| 65 | + |
| 66 | +If the workflow fails, do not push a PyPI release. Fix the failure, retag (or tag a new patch version), and rerun the pipeline. |
| 67 | + |
| 68 | +## Rollback Procedure (Yanking a Release) |
| 69 | + |
| 70 | +PyPI does **not** support deleting releases. If a published version is broken: |
| 71 | + |
| 72 | +1. Sign in to [pypi.org](https://pypi.org/) with an account that has maintainer or owner rights on `kfp-components`. |
| 73 | +2. Navigate to the project → **Release history**, select the release that needs to be withdrawn, and choose **Yank release**. |
| 74 | +3. Provide a brief explanation for the yank (PyPI will display this note to installers) and confirm. |
| 75 | +4. Communicate the issue in GitHub (discussion or release notes) and plan a follow-up patch release (for example `v1.11.2`) with the fix. |
| 76 | +5. Tag and publish the new patch release following the standard procedure. |
| 77 | + |
| 78 | +Do **not** attempt to reuse a yanked version number. Always increment the patch version for the corrective release. |
0 commit comments