Closed dbr closed 4 years ago
I often use bumpversion to do this. So basically:
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)
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
IMO this is outside the scope of rez. Both previous suggestions (separate bumpversion tool, pre-commit hook) sound like reasonable solutions.
Thx A
On Wed, Aug 12, 2020 at 11:52 PM Rob Fletcher notifications@github.com wrote:
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 1fi
it simply compares the 2 versions and errors if master matches your current branch
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nerdvegas/rez/issues/931#issuecomment-672883824, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMOUSUFP2VKWUA7N3MMTYDSAKNBPANCNFSM4P25IQOA .
Yep agreed - thanks for the suggestions!
I was going to write a small helper script to automate the process of releasing a new version, which for me involves:
git log
to check what commits have been made since last release (mostly to verify I haven't already bumped the version number)package.py
to, most often, just increase the minor versiongit 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?