-
Notifications
You must be signed in to change notification settings - Fork 32
Add release automation and documentation #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sduvvuri1603
wants to merge
1
commit into
kubeflow:main
Choose a base branch
from
sduvvuri1603:feature/Release-Auto-Initial-PyPI-Publich
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| name: Release Python Package | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| jobs: | ||
| release: | ||
| # Reuse build-packages.yml in publish mode for semver tags. | ||
| if: ${{ github.ref matches '^refs/tags/v[0-9]+\\.[0-9]+\\.[0-9]+$' }} | ||
| uses: ./.github/workflows/build-packages.yml | ||
| secrets: inherit | ||
| with: | ||
| python_versions: '["3.11"]' | ||
| publish_packages: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # Release Guide | ||
|
|
||
| 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. | ||
|
|
||
| ## Versioning Strategy | ||
|
|
||
| We use [Semantic Versioning](https://semver.org/) for `kfp-components`. | ||
|
|
||
| - **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. | ||
| - **Minor** (`vX.Y.0`): New components, features, or dependency bumps that stay backward compatible. | ||
| - **Patch** (`vX.Y.Z`): Bug fixes, metadata refreshes, or documentation-only updates. | ||
|
|
||
| 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. | ||
|
|
||
| ## Pre-release Checklist | ||
|
|
||
| 1. Confirm the main branch is healthy: CI is green and `uv build` succeeds locally. | ||
| 2. Ensure all required documentation updates (including changelog entries if applicable) are committed. | ||
| 3. Make sure `pyproject.toml` already contains the release metadata you intend to publish (name, classifiers, dependencies). | ||
|
|
||
| ## Release Procedure | ||
|
|
||
| 1. **Update the version** in `pyproject.toml` under the `[project]` section. | ||
| 2. **Commit** the change with a message such as `chore: bump version to v1.11.1`. | ||
| 3. **Tag the commit** using the `v` prefix: | ||
|
|
||
| ```bash | ||
| git tag v1.11.1 | ||
| git push origin main | ||
| git push origin v1.11.1 | ||
| ``` | ||
|
|
||
| 4. Wait for GitHub Actions to finish (details below). Publish release notes on GitHub after the workflow succeeds. | ||
|
|
||
| ## GitHub Actions Automation | ||
|
|
||
| Two workflows collaborate to ship a release. | ||
|
|
||
| ### Build Validation (`.github/workflows/build-packages.yml`) | ||
|
|
||
| - **Trigger**: pushes to `main` and pull requests targeting `main`. | ||
| - **Behavior**: | ||
| - Uses a Python matrix (currently 3.11 and 3.13) to build, validate, and test the package. | ||
| - Uploads the artifacts for inspection. No publish occurs. | ||
| - **What it does**: | ||
| - Builds wheel and source distributions with `uv build`. | ||
| - Validates wheel contents and metadata. | ||
| - Creates an isolated virtual environment and verifies that `kfp-components` installs and imports correctly. | ||
| - Uploads the build artifacts as workflow artifacts for traceability. | ||
|
|
||
| ### Release Pipeline (`.github/workflows/release.yml`) | ||
|
|
||
| - **Trigger**: pushes to tags that match `vX.Y.Z` (semantic versioning with a leading `v`). | ||
| - **How it works**: | ||
| - Calls the reusable `build-packages.yml` workflow with a single Python version (3.11) and `publish_packages=true`. | ||
| - The reusable workflow switches into “release mode,” which: | ||
| - Installs `build` and `twine`. | ||
| - Builds an sdist (`python -m build --sdist`). | ||
| - Unpacks the sdist into a temporary directory. | ||
| - Rebuilds the wheel using the unpacked sdist contents. | ||
| - Runs `twine check` on the sdist and wheel. | ||
| - Performs the same validation and import smoke tests as the main workflow. | ||
| - Uploads the artifacts for auditing. | ||
| - Publishes the release to PyPI via Trusted Publishing (GitHub Actions OIDC), so no manual credential management or `twine upload` step is required. | ||
|
|
||
| If the workflow fails, do not push a PyPI release. Fix the failure, retag (or tag a new patch version), and rerun the pipeline. | ||
|
|
||
| ## Rollback Procedure (Yanking a Release) | ||
|
|
||
| PyPI does **not** support deleting releases. If a published version is broken: | ||
|
|
||
| 1. Sign in to [pypi.org](https://pypi.org/) with an account that has maintainer or owner rights on `kfp-components`. | ||
| 2. Navigate to the project → **Release history**, select the release that needs to be withdrawn, and choose **Yank release**. | ||
| 3. Provide a brief explanation for the yank (PyPI will display this note to installers) and confirm. | ||
| 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. | ||
| 5. Tag and publish the new patch release following the standard procedure. | ||
|
|
||
| Do **not** attempt to reuse a yanked version number. Always increment the patch version for the corrective release. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a step to upload the packages as release artifacts.