feat: Create initial Release workflow for automated Pypi publishing#28
feat: Create initial Release workflow for automated Pypi publishing#28Krishna-kg732 wants to merge 6 commits into
Conversation
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>
chore:Updated release workflow
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
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
Releaseworkflow 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.
| - 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 |
| 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"] |
| 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 |
|
Thanks @Krishna-kg732 for working on this! A few small items before /lgtm - happy to merge after these. |
|
|
||
| - name: Setup build environment | ||
| run: | | ||
| make verify |
There was a problem hiding this comment.
I think we can add uv sync --extra dev (or make install) before make verify .. bare checkout won't have deps, wdyt?
| with: | ||
| verbose: true | ||
|
|
||
| github-release: |
There was a problem hiding this comment.
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
| else: | ||
| target_ref = os.environ["GITHUB_REF"] | ||
|
|
||
| is_prerelease = bool(re.search(r"(?:dev|rc)", project_version, re.IGNORECASE)) |
There was a problem hiding this comment.
is_prerelease regex (?:dev|rc) misses a, b, alpha, beta .. what does SDK release workflow use? maybe can also use PEP 440 parsing ?
There was a problem hiding this comment.
yeah okayy , I will change that
| name: ${{ needs.prepare.outputs.artifact-name }} | ||
| path: dist/ | ||
|
|
||
| publish-test-pypi: |
There was a problem hiding this comment.
IIUC workflow_dispatch can publish any branch to Test PyPI with no tag match.. maybe consider requiring version in branch name or manual input
|
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>
Add automated PyPI release pipeline
Adds a documented release workflow for
kubeflow-mcpwith 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 PyPIrelease: published→ publishes stable tags to PyPIscripts/check_version.py— fails the build ifpyproject.tomlandkubeflow_mcp/__init__.pyversions don't matchRELEASE.md— maintainer checklist for both pre-prod and prod flowsKey behaviour
rc/dev) are blocked from production PyPI by default; maintainers can override viaforce_prodinputdry_runmode builds and verifies without uploadingOut of scope
Release branches, auto cherry-picks, and per-minor CHANGELOG automation (tracked separately).
Closes
#16
cc: @abhijeet-dhumal