release: refactor the checkVersionIncrementing function