fix: release job isn't respecting minor latest streams#3405
Open
xstefank wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the GitHub Actions release workflow so that v5 patch releases are built from the correct maintenance branch (e.g., 5.2.x) rather than incorrectly releasing from main, which caused the 5.2.4 artifact mismatch reported in #3402.
Changes:
- Derives the release
major.minorfrom the release tag and compares it tomain’spom.xmlversion to decide whether to release frommainor${major.minor}.x. - Updates the v5 branch-selection logic in the release workflow to support “latest minor stream” releases correctly.
Comment on lines
+38
to
+40
| # getting this version from POM would require pulling the whole repo | ||
| MAIN_POM_VERSION=$(curl -s "https://raw.githubusercontent.com/${{ github.repository }}/main/pom.xml" | grep -oPm1 '(?<=<version>)[^<]+') | ||
| MAIN_MAJOR_MINOR=$(echo "$MAIN_POM_VERSION" | cut -d. -f1-2) |
Comment on lines
+45
to
+49
| if [ "$RELEASE_MAJOR_MINOR" = "$MAIN_MAJOR_MINOR" ]; then | ||
| echo "tmp_version_branch=main" >> "$GITHUB_ENV" | ||
| else | ||
| echo "tmp_version_branch=${RELEASE_MAJOR_MINOR}.x" >> "$GITHUB_ENV" | ||
| fi |
Collaborator
There was a problem hiding this comment.
Logging which target branch is selected would indeed be useful.
metacosm
requested changes
Jun 9, 2026
Comment on lines
+45
to
+49
| if [ "$RELEASE_MAJOR_MINOR" = "$MAIN_MAJOR_MINOR" ]; then | ||
| echo "tmp_version_branch=main" >> "$GITHUB_ENV" | ||
| else | ||
| echo "tmp_version_branch=${RELEASE_MAJOR_MINOR}.x" >> "$GITHUB_ENV" | ||
| fi |
Collaborator
There was a problem hiding this comment.
Logging which target branch is selected would indeed be useful.
Signed-off-by: xstefank <xstefank122@gmail.com>
3def2b8 to
2eb3d7f
Compare
metacosm
reviewed
Jun 9, 2026
| RELEASE_MAJOR_MINOR=$(echo "$RELEASE_VERSION" | cut -d. -f1-2) | ||
|
|
||
| # getting this version from POM would require pulling the whole repo | ||
| MAIN_POM_VERSION=$(curl -fsSL "https://raw.githubusercontent.com/${{ github.repository }}/main/pom.xml" | python3 -c " |
Collaborator
There was a problem hiding this comment.
Using a python script for this is way overkill. The previous solution was better, imo. Or we could use something as simple as yq '.project.version' pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is why 5.2.4 was wrongfully released from
mainand not from5.2.x. I will release 5.2.5 after this PR is merged.Fixes #3402