Skip to content
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

rez bump command? #931

Closed
dbr opened this issue Aug 11, 2020 · 4 comments
Closed

rez bump command? #931

dbr opened this issue Aug 11, 2020 · 4 comments

Comments

@dbr
Copy link
Contributor

dbr commented Aug 11, 2020

I was going to write a small helper script to automate the process of releasing a new version, which for me involves:

  • Check git log to check what commits have been made since last release (mostly to verify I haven't already bumped the version number)
  • Edit the version string in package.py to, most often, just increase the minor version
  • Check there are no uncommitted changes
  • git add package.py && git commit -m "Bump version" && git push

..before running rez release. None of the steps are too hard on their own, but adds up to be a little tedious and accident prone (quite often I've forgotten to bump the version string as per #914)

Before I write this as a standalone script, is this something that could potentially be useful as part of rez itself? I'm unsure as seems like it could be useful, but also might be a little too workflow-specific to be in core rez?

@instinct-vfx
Copy link
Contributor

instinct-vfx commented Aug 11, 2020

I often use bumpversion to do this. So basically:

  • Code
  • Commit & Push
  • Run bumpversion with the desired level (patch, minor, major)
  • release

This also has the benefit of being able to update versions in multiple places if needed (e.g. in docs, or about boxes, resource files or the likes)

@rfletchr
Copy link

rfletchr commented Aug 12, 2020

you might consider a pre-commit hook.

master=$(git show master:package.py | grep version | cut -d'"' -f 2)
current=$(git show HEAD:package.py | grep version | cut -d'"' -f 2)

if [ "$master" = "$current" ]; then
	echo "version bump required"
	exit 1
fi

it simply compares the 2 versions and errors if master matches your current branch

@instinct-vfx
have you tried CMakes configure_file method for doing string substitution?

https://cmake.org/cmake/help/v3.2/command/configure_file.html

My Tool Version: @Version@

said file has the @Version@ token replaced with the value of Version

also for code you can get any packages version from the environment specifically REZ_(PKG)_VERSION

@nerdvegas
Copy link
Contributor

nerdvegas commented Aug 12, 2020 via email

@dbr
Copy link
Contributor Author

dbr commented Aug 17, 2020

Yep agreed - thanks for the suggestions!

@dbr dbr closed this as completed Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants