-
Notifications
You must be signed in to change notification settings - Fork 41
feat(ci): Add automated release CI job #65
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
Conversation
Pull Request Test Coverage Report for Build 17137367339Details
💛 - Coveralls |
1 similar comment
Pull Request Test Coverage Report for Build 17137367339Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 17781819255Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
@kramaranya You can convert it to draft till it's ready :) |
6c13496 to
b95afe5
Compare
0c219ee to
b966105
Compare
|
/milestone v0.1 |
|
@kubeflow/kubeflow-sdk-team CI for automated release process should be ready, I would appreciate your reviews! |
| shell: bash | ||
| run: | | ||
| if git ls-remote --tags origin "${{ steps.vars.outputs.version }}" | grep -q "refs/tags/${{ steps.vars.outputs.version }}"; then | ||
| echo "Tag ${{ steps.vars.outputs.version }} already exists. Skipping CI."; exit 0; fi |
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.
Is the intention here to continue to the cherry pick even if the tag exists?
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.
Yes initially, but now I think it makes sense to skip the cherry pick as well if the tag already exists
Let me update it!
| echo "Using existing branch: $BRANCH" | ||
| git fetch origin "$BRANCH":"$BRANCH" | ||
| git checkout "$BRANCH" | ||
| if ! git cherry-pick -x "$MAIN_SHA"; then |
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.
Small suggestion: Add a check for the SHA before cherry-pick:
something like:
if git merge-base --is-ancestor "$MAIN_SHA" "$BRANCH"; then
echo "Commit already present in $BRANCH"
else
git cherry-pick -x "$MAIN_SHA"
fi
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.
Good point, thank you!
Makefile
Outdated
| release: uv-venv | ||
| @if [ -z "$(VERSION)" ]; then echo "Usage: make release VERSION=v0.1.0"; exit 1; fi | ||
| @VERSION_NUM=$$(echo "$(VERSION)" | sed 's/^v//'); \ | ||
| sed -i '' "s/__version__ = \".*\"/__version__ = \"$$VERSION_NUM\"/" kubeflow/__init__.py; \ |
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.
Will this work on non Mac?
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.
Good catch! I created a small python script instead
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.
@kramaranya FYI, if we want to make sed command align between Mac and Linux, we can install gnu-sed, like in Kueue: https://github.com/kubernetes-sigs/kueue/blob/main/Makefile#L72-L81
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.
I see, thank you! I think sed -i.bak works as well, shall we just keep as it is right now and don't introduce any extra dependency?
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.
@kramaranya sed -i.bak will work for MacOS and Linux ?
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.
I think so, see https://en.wikipedia.org/wiki/Sed#In-place_editing and https://ss64.com/mac/sed.html
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.
Added a few minor comments but overall this looks great.
|
@briangallagher I've addressed your comments, thank you for review! /assign @briangallagher @andreyvelich @Electronic-Waste @astefanutti |
Signed-off-by: kramaranya <kramaranya15@gmail.com>
Signed-off-by: kramaranya <kramaranya15@gmail.com>
|
This is awesome, thanks @kramaranya! Example: https://github.com/kubeflow/trainer/releases/tag/v2.0.0 |
I've being trying to find the reason for that and wasn't sure since Trainer includes links in CHANGELOG.md. But sure, I'll update it, thank you! |
Yes, I think I've done this because usernames with @ are not clickable in the GitHub Markdown: https://github.com/kubeflow/trainer/blob/master/docs/release/changelog.py#L43 But I think this is fine, k8s changelog CLI also doesn't add links: https://github.com/kubernetes-sigs/kueue/blob/main/CHANGELOG/CHANGELOG-0.11.md |
Signed-off-by: kramaranya <kramaranya15@gmail.com>
I see! Did you need to manually remove the links for every release? |
Yes, we have this |
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.
Thanks @kramaranya!
I think, we can move forward with this.
/lgtm
/assign @szaher @astefanutti @Electronic-Waste
Signed-off-by: kramaranya <kramaranya15@gmail.com>
|
/approve |
|
Thank you! |
|
/lgtm |
|
@kramaranya: you cannot LGTM your own PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
@kramaranya Thanks for this great contribution!
/lgtm
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andreyvelich, Electronic-Waste The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* feat(ci): Add release CI job Signed-off-by: kramaranya <kramaranya15@gmail.com> * feat(ci): Add GitHub Release to CI Signed-off-by: kramaranya <kramaranya15@gmail.com> * Change kubeflow sdk PyPI package name Signed-off-by: kramaranya <kramaranya15@gmail.com> * Add kubeflow sdk version verification to CI Signed-off-by: kramaranya <kramaranya15@gmail.com> * Add proper changelog extraction Signed-off-by: kramaranya <kramaranya15@gmail.com> * Allow to reuse test-python workflow Signed-off-by: kramaranya <kramaranya15@gmail.com> * Add changelog generation script Signed-off-by: kramaranya <kramaranya15@gmail.com> * Update uv.lock Signed-off-by: kramaranya <kramaranya15@gmail.com> * Remove blank lines in changelog script Signed-off-by: kramaranya <kramaranya15@gmail.com> * Add make release in Makefile Signed-off-by: kramaranya <kramaranya15@gmail.com> * Refactor gen_changelog Signed-off-by: kramaranya <kramaranya15@gmail.com> * Delete CHANGELOG.md Signed-off-by: kramaranya <kramaranya15@gmail.com> * Add prepare-release CI Signed-off-by: kramaranya <kramaranya15@gmail.com> * Allow manual trigger of release CI Signed-off-by: kramaranya <kramaranya15@gmail.com> * Add release readme Signed-off-by: kramaranya <kramaranya15@gmail.com> * Update chnagelog parser in CI Signed-off-by: kramaranya <kramaranya15@gmail.com> * skip and check cherry pick for new release Signed-off-by: kramaranya <kramaranya15@gmail.com> * add script to update the version Signed-off-by: kramaranya <kramaranya15@gmail.com> * Update make release script Signed-off-by: kramaranya <kramaranya15@gmail.com> * Use make test-python in release CI Signed-off-by: kramaranya <kramaranya15@gmail.com> * Move prepare release CI to one a single workflow Signed-off-by: kramaranya <kramaranya15@gmail.com> * Remove uv.sync from RELEASE.md Signed-off-by: kramaranya <kramaranya15@gmail.com> * Upload artifacts to GitHub Release Signed-off-by: kramaranya <kramaranya15@gmail.com> * Run release CI against release-* branch Signed-off-by: kramaranya <kramaranya15@gmail.com> * Use X.Y.Z versioning in Kubeflow SDK Signed-off-by: kramaranya <kramaranya15@gmail.com> * Use single workflow for release Signed-off-by: kramaranya <kramaranya15@gmail.com> * Remove Release types from RELEASE.md Signed-off-by: kramaranya <kramaranya15@gmail.com> * Add a note about older minor series patch release Signed-off-by: kramaranya <kramaranya15@gmail.com> * Directly checkout release branch with ref input Signed-off-by: kramaranya <kramaranya15@gmail.com> * Checkout release branch with ref input Signed-off-by: kramaranya <kramaranya15@gmail.com> * Update extract changelog job Signed-off-by: kramaranya <kramaranya15@gmail.com> * Update the name of github release Signed-off-by: kramaranya <kramaranya15@gmail.com> * Remove full changelog line Signed-off-by: kramaranya <kramaranya15@gmail.com> * Fix ruff issue Signed-off-by: kramaranya <kramaranya15@gmail.com> * Don't use link for authors in changelog Signed-off-by: kramaranya <kramaranya15@gmail.com> * Remove chnagelog for RCs Signed-off-by: kramaranya <kramaranya15@gmail.com> --------- Signed-off-by: kramaranya <kramaranya15@gmail.com>
I added a CI job for release process automation:
The
Prepare ReleaseGitHub Action automatically:kubeflow/__init__.pyrelease-X.YbranchThe
ReleaseGitHub Action automatically:I also added the script to generate CHANGELOG and update the version.
And added Release README
I've tested this workflow on my branch - https://github.com/kramaranya/sdk/actions/runs/17457296258
PyPI project - https://pypi.org/project/kubeflow-test/
GitHub release - https://github.com/kramaranya/sdk/releases/tag/v0.8.1