chore: automate release process with GitHub Actions#3261
Conversation
|
[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 |
|
🎉 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:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
da5a7d5 to
cda99d1
Compare
|
@Krishna-kg732 can you run a sample workflow and share the release notes on your fork. |
|
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. |
|
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) : -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>
cda99d1 to
2ffca9d
Compare
There was a problem hiding this comment.
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 releaseand a newhack/release.shto 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.
| # 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" |
| 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_...` | |
| sed -i "s/__version__ = \".*\"/__version__ = \"$NEW_VERSION\"/" "$PYTHON_API_VERSION_FILE" | ||
| echo "Updated Python API version to $NEW_VERSION" |
| @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>"; \ |
| 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` |
| ### 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` |
| 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)." |
|
closing in favor of #3148 |
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: