forked from pulp/pulp_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·27 lines (20 loc) · 768 Bytes
/
Copy pathrelease.sh
File metadata and controls
executable file
·27 lines (20 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
set -eu -o pipefail
BRANCH=$(git branch --show-current)
if ! [[ "${BRANCH}" =~ ^[0-9]+\.[0-9]+$ ]]
then
echo ERROR: This is not a release branch!
exit 1
fi
# The tail is a necessary workaround to remove the warning from the output.
NEW_VERSION="$(bump-my-version show new_version --increment release | tail -n -1)"
echo "Release ${NEW_VERSION}"
if ! [[ "${NEW_VERSION}" == "${BRANCH}"* ]]
then
echo ERROR: Version does not match release branch
exit 1
fi
towncrier build --yes --version "${NEW_VERSION}"
bump-my-version bump release --commit --message "Release {new_version}" --tag --tag-name "{new_version}" --tag-message "Release {new_version}" --allow-dirty
bump-my-version bump patch --commit
git push origin "${BRANCH}" "${NEW_VERSION}"