Skip to content

Commit 06ea36e

Browse files
Stefan Hattrelldigorgonzola
authored andcommitted
bumpversion: optimise script
- no longer require parsing the new version from bumpversion output. We can just push the tags using `git push --tags` and this will push just the new one that's been created - we do not need to specify `--no-commit` since this is the default behaviour - remove the 'v' prefix from git tag by using the `--tag-name` parameter
1 parent 550b2fd commit 06ea36e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

bumpversion.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ set -euxo pipefail
44

55
main() {
66
git fetch --prune origin "+refs/tags/*:refs/tags/*"
7-
NEW_VERSION=$(bump2version --current-version $(git describe) --list --no-commit --tag \
8-
--tag-message 'Bump version to {new_version}' patch | grep -oP '^new_version=\K.*$')
9-
git push origin tag v$NEW_VERSION
7+
bump2version --current-version $(git describe) \
8+
--tag --tag-name {new_version} --tag-message 'Bump version to {new_version}' patch
9+
git push --tags
1010

1111
exit 0
1212
}

0 commit comments

Comments
 (0)