-
Notifications
You must be signed in to change notification settings - Fork 9
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
Make previous version optional in release_pull_request.bash #1013
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -14,28 +14,33 @@ | |||||
# limitations under the License. | ||||||
# | ||||||
|
||||||
# The script will open a pull request for a forward port. | ||||||
# The script will open a pull request for a release PR (actually opens the PR page in your web browser) | ||||||
# | ||||||
# Requires the 'gh' CLI to be installed. | ||||||
# | ||||||
# Usage: | ||||||
# $ ./merge_forward_pull_request.bash <from_branch> <to_branch> | ||||||
# $ ./release_pull_request.bash <from_branch> <to_branch> | ||||||
# | ||||||
# For example, to merge `ign-rendering6` forward to `main`: | ||||||
# For example, to release `gz-rendering7` 7.1.0 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I'm trying to match order and concepts defined in the help usage. |
||||||
# | ||||||
# ./merge_forward_pull_request.bash ign-rendering6 main | ||||||
# ./release_pull_request.bash 7.1.0 gz-rendering7 | ||||||
# | ||||||
# Make sure you've checked out the branch that has the changes for the release | ||||||
# and that the changes have been pushed. | ||||||
|
||||||
VERSION=${1} | ||||||
TO_BRANCH=${2} | ||||||
PREV_VER=${3} | ||||||
|
||||||
if [[ $# -ne 3 ]]; then | ||||||
echo "./release_pull_request.bash <version> <to_branch> <previous_version>" | ||||||
if [[ $# -ne 2 ]]; then | ||||||
echo "./release_pull_request.bash <version> <to_branch>" | ||||||
exit 1 | ||||||
fi | ||||||
|
||||||
set -e | ||||||
|
||||||
git fetch --tags | ||||||
PREV_VER=$(git describe --tags --abbrev=0 | sed 's/.*_//') | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm tempted to try to use the
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||||||
|
||||||
LOCAL_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||||||
REMOTE_BRANCH=$(git rev-parse --abbrev-ref HEAD@{upstream}) | ||||||
REMOTE=${REMOTE_BRANCH/\/$LOCAL_BRANCH/} | ||||||
|
@@ -44,7 +49,10 @@ CURRENT_BRANCH="${REMOTE}:${LOCAL_BRANCH}" | |||||
ORIGIN_URL=$(git remote get-url origin) | ||||||
ORIGIN_ORG_REPO=$(echo ${ORIGIN_URL} | sed -e 's@.*github\.com.@@' | sed -e 's/\.git//g') | ||||||
|
||||||
PREV_TAG=$(git tag | grep "_${PREV_VER}$") | ||||||
if [[ $PREV_VER == $VERSION ]] then | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Beware, this has a broken syntax |
||||||
echo "Previous version ($PREV_VER) and current ($VERSION) version should be different" | ||||||
exit 1 | ||||||
fi | ||||||
|
||||||
TITLE="Prepare for ${VERSION} Release" | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not fully convinced that the name
to_branch
is the best one to use here. Maybebase_branch
? Feel free to ignore.