From a89a0208c6e0c3b27776f05f22ed50ba30a6f1f9 Mon Sep 17 00:00:00 2001 From: Andreas Maier Date: Wed, 9 Oct 2024 12:34:29 +0200 Subject: [PATCH] Fixed incorrect check for release branch in 'make release_publish' Signed-off-by: Andreas Maier --- Makefile | 4 ++-- docs/changes.rst | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d193fde..026bef4 100644 --- a/Makefile +++ b/Makefile @@ -404,7 +404,7 @@ release_publish: git fetch origin @bash -c 'if [ -n "$$(git tag -l $(VERSION))" ]; then echo ""; echo "Error: Release tag $(VERSION) already exists (the version has already been released)"; echo ""; false; fi' @bash -c 'if [[ -n "$${BRANCH}" ]]; then echo $${BRANCH} >branch.tmp; elif [[ "$${VERSION#*.*.}" == "0" ]]; then echo "master" >branch.tmp; else echo "stable_$${VERSION%.*}" >branch.tmp; fi' - @bash -c 'if [ "$$(git log --format=format:%s $$(cat branch.tmp)~..$$(cat branch.tmp))" != "Release $(VERSION)" ]; then echo ""; echo "Error: Release branch has not been created yet"; echo ""; false; fi' + @bash -c 'if [ "$$(git log --format=format:%s origin/$$(cat branch.tmp)~..origin/$$(cat branch.tmp))" != "Release $(VERSION)" ]; then echo ""; echo "Error: Release PR for $(VERSION) has not been merged yet"; echo ""; false; fi' @echo "==> This will publish $(package_name) version $(VERSION) to PyPI using target branch $$(cat branch.tmp)" @echo -n '==> Continue? [yN] ' @bash -c 'read answer; if [ "$$answer" != "y" ]; then echo "Aborted."; false; fi' @@ -447,12 +447,12 @@ start_tag: git fetch origin @bash -c 'if [ -n "$$(git tag -l $(VERSION)a0)" ]; then echo ""; echo "Error: Release start tag $(VERSION)a0 already exists (the new version has alreay been started)"; echo ""; false; fi' @bash -c 'if [[ -n "$${BRANCH}" ]]; then echo $${BRANCH} >branch.tmp; elif [[ "$${VERSION#*.*.}" == "0" ]]; then echo "master" >branch.tmp; else echo "stable_$${VERSION%.*}" >branch.tmp; fi' + @bash -c 'if [ "$$(git log --format=format:%s origin/$$(cat branch.tmp)~..origin/$$(cat branch.tmp))" != "Start $(VERSION)" ]; then echo ""; echo "Error: Start PR for $(VERSION) has not been merged yet"; echo ""; false; fi' @echo "==> This will complete the start of new version $(VERSION) using target branch $$(cat branch.tmp)" @echo -n '==> Continue? [yN] ' @bash -c 'read answer; if [ "$$answer" != "y" ]; then echo "Aborted."; false; fi' bash -c 'git checkout $$(cat branch.tmp)' git pull - @bash -c 'if [ "$$(git log --format=format:%s $$(cat branch.tmp)~..$$(cat branch.tmp))" != "Start $(VERSION)" ]; then echo ""; echo "Error: Start PR for $(VERSION) has not been merged yet"; echo ""; false; fi' git tag -f $(VERSION)a0 git push -f --tags git branch -D start_$(VERSION) diff --git a/docs/changes.rst b/docs/changes.rst index 34d9689..1bbaafe 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -81,6 +81,8 @@ Released: 2024-10-09 * Fixed incorrect check for start branch in 'make start_tag'. (`#638 `_) +* Fixed incorrect check for release branch in 'make release_publish'. + **Enhancements:** * Improved build of the Docker image: It now uses the package version as the