-
Notifications
You must be signed in to change notification settings - Fork 1
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
Release Machine Stats main using tags #210
Conversation
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.
Looks good!
@@ -83,6 +83,12 @@ We use the following tools: | |||
1 debian10 running | |||
``` | |||
|
|||
### How to bump libvirt's version |
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.
Interesting, so virt stats is served from the pypi also?
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, checkout https://pypi.org/project/virt-stats/
It's been under the radar because it is released with the same version as machine stats (because it's the same workflow). So you'll see a lot of virtstat versions without any changes (and yet a new version) because those versions were only intended for machine stats.
@@ -5,7 +5,7 @@ | |||
|
|||
setup( | |||
name="virt_stats", | |||
version="2.5.4", | |||
version="develop", |
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.
Does it need to be develop here?
@@ -5,7 +5,7 @@ | |||
|
|||
setup( | |||
name="machine_stats", | |||
version="2.5.4", | |||
version="develop", |
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.
Im curious about this as well. can you please explain to us why the change to develop?
.github/workflows/pypi-upload.yml
Outdated
@@ -2,6 +2,7 @@ name: PyPI Upload | |||
|
|||
on: | |||
push: |
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 was under the impression that we were aiming to use releases :
. Is that change coming soon? or this is just a leftover?
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.
A change is coming and I wanted to keep it the same as what we have in alpha but first I'm checking in a private repo to make sure the tags don't get mixed up, meaning releasing a tag for alpha shouldn't release the main machine stats.
run: | | ||
# from refs/tags/v1.2.3 get 1.2.3 | ||
VERSION=${GITHUB_REF/refs\/tags\//} | ||
PLACEHOLDER='version="develop"' |
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 the develop line here. 🤔
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.
To also answer your other 2 questions about develop
, it can be any string (or even be empty).
The magic in this workflow is actually happening in line#36. After stripping off the variables, it'll look something like
sed -i "s/develop/1.2.3/g" script.py
So we are replacing the string develop
in that file with the tag(1.2.3) that we get from the GitHub context. This also means that we have no way to know what's the latest MS version from codebase without having to look at GitHub or PyPI.
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.
Cool, thanks for the explanation 👍
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 @pranavmalaviya 🚀
This PR removes the previous approach of using
bump2version
and replaces it with tags. With this, you won't need a dev setup to release a new machine stats version.To make a new release, simply create a tag on the
master
branch and thepypi-upload
GitHub Workflow will take care of the rest.