Skip to content

chore: automate release process with GitHub Actions#3261

Closed
Krishna-kg732 wants to merge 7 commits into
kubeflow:masterfrom
Krishna-kg732:release-automation
Closed

chore: automate release process with GitHub Actions#3261
Krishna-kg732 wants to merge 7 commits into
kubeflow:masterfrom
Krishna-kg732:release-automation

Conversation

@Krishna-kg732
Copy link
Copy Markdown
Contributor

@Krishna-kg732 Krishna-kg732 commented Feb 27, 2026

What this PR does / why we need it:

Automates the Kubeflow Trainer release process using GitHub Actions, including version validation, changelog generation, tag creation, and publishing releases.

Which issue(s) this PR fixes :
Fixes #2155

Checklist:

@google-oss-prow google-oss-prow Bot requested a review from jinchihe February 27, 2026 03:58
@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 terrytangyuan 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

@google-oss-prow google-oss-prow Bot requested a review from kuizhiqing February 27, 2026 03:58
@github-actions
Copy link
Copy Markdown

🎉 Welcome to the Kubeflow Trainer! 🎉

Thanks for opening your first PR! We're happy to have you as part of our community 🚀

Here's what happens next:

  • If you haven't already, please check out our Contributing Guide for repo-specific guidelines and the Kubeflow Contributor Guide for general community standards.
  • Our team will review your PR soon! cc @kubeflow/kubeflow-trainer-team

Join the community:

Feel free to ask questions in the comments if you need any help or clarification!
Thanks again for contributing to Kubeflow! 🙏

@jaiakash
Copy link
Copy Markdown
Member

@Krishna-kg732 can you run a sample workflow and share the release notes on your fork.

@jaiakash
Copy link
Copy Markdown
Member

jaiakash commented Mar 2, 2026

Hi @Krishna-kg732 Thanks for your PR. I have closed #3231 since its duplicate.

For this PR, please do the necessary changes and check why Go Unit test are failing.. Also share the sample release here on GitHub.

@Krishna-kg732
Copy link
Copy Markdown
Contributor Author

Krishna-kg732 commented Mar 3, 2026

Hey @jaiakash , the go unit tests were failing due to coveralls outage , if you could re run the tests it would go away

sample release with all previous version tags fetched(v99.0.0) :

test-release(v99.0.0)

-Thanks

Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>
Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>
Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>
Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>
Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>
Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>
Signed-off-by: krishna-kg732 <krishnagupta.kg2k6@gmail.com>
Copilot AI review requested due to automatic review settings March 18, 2026 16:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a release automation flow for Kubeflow Trainer, covering local release-commit preparation plus GitHub Actions workflows to validate, tag/branch, build artifacts, and publish a GitHub Release.

Changes:

  • Introduces make release and a new hack/release.sh to prepare a release commit (version bumps, manifests/chart updates, changelog, codegen).
  • Adds GitHub Actions workflows for release execution (release.yaml) and PR-time validation (check-release.yaml), plus supporting tweaks for workflow dispatch and image tagging.
  • Adds git-cliff configuration (cliff.toml) and a fork-based release testing guide.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
Makefile Adds a release target to drive the release-commit preparation flow.
hack/release.sh New script to update versioned artifacts, generate changelog, run codegen, and create a release commit.
docs/release/RELEASE_TESTING.md New guide describing how to test the release pipeline on a fork.
cliff.toml Adds git-cliff configuration for changelog grouping and GitHub links.
.github/workflows/template-publish-image/action.yaml Ensures workflow-dispatched tag builds can still emit the correct tag name.
.github/workflows/release.yaml New workflow to create release branch/tag, dispatch builds, and publish GitHub Release.
.github/workflows/publish-helm-charts.yaml Enables manual dispatch for publishing charts.
.github/workflows/check-release.yaml New PR workflow to validate release PR contents (VERSION, tags, manifests, chart, python version, pinning).
.github/workflows/check-pr-title.yaml Allows skipping PR title checks via area/release label.
.github/workflows/build-and-push-images.yaml Enables manual dispatch and allows publishing on workflow_dispatch.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread hack/release.sh
Comment on lines +57 to +59
# Update image tags in manifests
find "$MANIFESTS_DIR" -type f -name '*.yaml' -exec sed -i "s/newTag: .*/newTag: $TAG/" {} +
echo "Updated image tags in manifests to $TAG"
Comment thread hack/release.sh
Comment on lines +116 to +118
docker run --rm -u "$(id -u):$(id -g)" -v "$ABSOLUTE_REPO_ROOT:/app" \
-e "GITHUB_TOKEN=${GITHUB_TOKEN:-}" -w /app \
"ghcr.io/orhun/git-cliff/git-cliff:latest" --unreleased --tag "$TAG" -o - > "$TEMP_FILE"
| `publish_pypi` fails with 403 | OIDC trusted publisher not configured for your fork | See Step 4, or ignore — prior jobs still validate |
| `trigger_builds` fails with 403 | `actions: write` permission missing | Ensure `GITHUB_TOKEN` has `workflow` scope in fork settings |
| `github_release` body is empty | git-cliff found no conventional commits | Ensure commits use `feat:`, `fix:`, `chore:` prefixes |
| `release.sh` crashes on `GITHUB_TOKEN` | Unset token with `set -o nounset` | Export: `export GITHUB_TOKEN=ghp_...` |
Comment thread hack/release.sh
Comment on lines +103 to +104
sed -i "s/__version__ = \".*\"/__version__ = \"$NEW_VERSION\"/" "$PYTHON_API_VERSION_FILE"
echo "Updated Python API version to $NEW_VERSION"
Comment thread Makefile
Comment on lines +253 to +259
@if [ -z "$(VERSION)" ] || ! echo "$(VERSION)" | grep -E -q '^[0-9]+\.[0-9]+\.[0-9]+$$'; then \
echo "ERROR: VERSION must be set in X.Y.Z format. Usage: make release VERSION=X.Y.Z"; \
exit 1; \
fi

@if [ -z "$(GITHUB_TOKEN)" ]; then \
echo "ERROR: GITHUB_TOKEN is required. Usage: make release VERSION=X.Y.Z GITHUB_TOKEN=<token>"; \
Comment thread hack/release.sh
PYTHON_API_VERSION_FILE="$REPO_ROOT/api/python_api/kubeflow_trainer_api/__init__.py"

# Verify tag doesn't already exist
git fetch --tags
- Sets `api/python_api/kubeflow_trainer_api/__init__.py` to `99.0.0`
- Generates CHANGELOG.md via git-cliff (requires Docker)
- Runs `make generate`
- Creates a signed commit: `Release v99.0.0`
Comment on lines +183 to +188
### build-and-push-images
- Triggered via `workflow_dispatch` with `ref: v99.0.0`
- Builds all 7 container images
- On forks (with the guard removed): pushes to `ghcr.io/<you>/trainer/*`
- Verify the `template-publish-image` action tags images with `v99.0.0`

- Triggered via `workflow_dispatch` with `ref: v99.0.0`
- Reads `Chart.yaml` version (should be `99.0.0` since ref is the tag)
- Packages `kubeflow-trainer-99.0.0.tgz`
- Pushes to `oci://ghcr.io/<you>/charts`
Comment on lines +97 to +101
if [ "$PY_VER" != "$VERSION" ]; then
echo "Python API version ($PY_VER) does not match VERSION ($VERSION)."
exit 1
fi
echo "Python API version matches VERSION ($VERSION)."
@Krishna-kg732
Copy link
Copy Markdown
Contributor Author

closing in favor of #3148

@Krishna-kg732 Krishna-kg732 deleted the release-automation branch May 12, 2026 11:21
@Krishna-kg732 Krishna-kg732 restored the release-automation branch May 14, 2026 19:59
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.

Improve Kubeflow Trainer release process

3 participants