Skip to content

feat: Create initial Release workflow for automated Pypi publishing#28

Open
Krishna-kg732 wants to merge 6 commits into
kubeflow:mainfrom
Krishna-kg732:chore/release-workflow
Open

feat: Create initial Release workflow for automated Pypi publishing#28
Krishna-kg732 wants to merge 6 commits into
kubeflow:mainfrom
Krishna-kg732:chore/release-workflow

Conversation

@Krishna-kg732

@Krishna-kg732 Krishna-kg732 commented May 28, 2026

Copy link
Copy Markdown

Add automated PyPI release pipeline

Adds a documented release workflow for kubeflow-mcp with pre-production and production publish paths.

What's included

  • release.yaml — GitHub Actions workflow with two triggers:
    • workflow_dispatch → builds and publishes RC/dev builds to Test PyPI
    • release: published → publishes stable tags to PyPI
  • scripts/check_version.py — fails the build if pyproject.toml and kubeflow_mcp/__init__.py versions don't match
  • RELEASE.md — maintainer checklist for both pre-prod and prod flows

Key behaviour

  • OIDC trusted publishing (no stored API tokens)
  • Pre-release versions (rc/dev) are blocked from production PyPI by default; maintainers can override via force_prod input
  • dry_run mode builds and verifies without uploading

Out of scope

Release branches, auto cherry-picks, and per-minor CHANGELOG automation (tracked separately).

Closes

#16

cc: @abhijeet-dhumal

Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
@google-oss-prow google-oss-prow Bot added the do-not-merge/work-in-progress Work in progress label May 28, 2026
@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kramaranya for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Krishna-kg732 Krishna-kg732 marked this pull request as ready for review June 5, 2026 14:00
Copilot AI review requested due to automatic review settings June 5, 2026 14:00
@google-oss-prow google-oss-prow Bot removed the do-not-merge/work-in-progress Work in progress label Jun 5, 2026
@google-oss-prow google-oss-prow Bot requested a review from kramaranya June 5, 2026 14:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a documented and automated release process to publish kubeflow-mcp to Test PyPI (manual) and PyPI (on GitHub Release), using PyPI trusted publishing (OIDC) instead of API tokens.

Changes:

  • Introduces a GitHub Actions Release workflow to build, test, and publish to Test PyPI / PyPI via OIDC.
  • Adds release documentation describing versioning rules, release paths, and trusted publisher setup.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
docs/release/RELEASE.md Documents the release process, prerequisites, and trusted publishing configuration.
.github/workflows/release.yaml Automates build/test/package validation and publishing to Test PyPI/PyPI and attaching release assets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yaml Outdated
Comment on lines +28 to +38
- name: Check version and release target
id: vars
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
python - <<'PY'
import ast
import os
from pathlib import Path
import re
import tomllib
Comment thread .github/workflows/release.yaml Outdated
Comment on lines +33 to +41
python - <<'PY'
import ast
import os
from pathlib import Path
import re
import tomllib

with open("pyproject.toml", "rb") as f:
project = tomllib.load(f)["project"]
Comment thread .github/workflows/release.yaml Outdated
Comment on lines +46 to +58
module = ast.parse(open("kubeflow_mcp/__init__.py", encoding="utf-8").read())
code_version = None
for node in module.body:
if (
isinstance(node, ast.Assign)
and len(node.targets) == 1
and isinstance(node.targets[0], ast.Name)
and node.targets[0].id == "__version__"
and isinstance(node.value, ast.Constant)
and isinstance(node.value.value, str)
):
code_version = node.value.value
break
@abhijeet-dhumal

Copy link
Copy Markdown
Member

Thanks @Krishna-kg732 for working on this! A few small items before /lgtm - happy to merge after these.
depends on #3

Comment thread .github/workflows/release.yaml Outdated

- name: Setup build environment
run: |
make verify

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can add uv sync --extra dev (or make install) before make verify .. bare checkout won't have deps, wdyt?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okayy ,sounds good

with:
verbose: true

github-release:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC github-release job runs on release: published then calls softprops/action-gh-release to create a release .. release already exists. what if we use upload_url from github.event.release to attach dist/* assets instead

Comment thread .github/workflows/release.yaml Outdated
else:
target_ref = os.environ["GITHUB_REF"]

is_prerelease = bool(re.search(r"(?:dev|rc)", project_version, re.IGNORECASE))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_prerelease regex (?:dev|rc) misses a, b, alpha, beta .. what does SDK release workflow use? maybe can also use PEP 440 parsing ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah okayy , I will change that

name: ${{ needs.prepare.outputs.artifact-name }}
path: dist/

publish-test-pypi:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC workflow_dispatch can publish any branch to Test PyPI with no tag match.. maybe consider requiring version in branch name or manual input

@abhijeet-dhumal

Copy link
Copy Markdown
Member

PR description mentions about scripts/check_version.py exists ?

…workflow

Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
@Krishna-kg732 Krishna-kg732 changed the title feat(ci) : Create initial Release workflow for automated Pypi publishing feat: Create initial Release workflow for automated Pypi publishing Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants