Skip to content

Commit

Permalink
autorelease: Fix rolling-release version for a release (#40522)
Browse files Browse the repository at this point in the history
Because PHP's `version_compare()` is used for the comparison, something
like `6.0.0+rolling.12345.gbeef` < `6.0.0-alpha+rolling.12345.gbeef`. To
avoid this being a problem, if the version number isn't already -alpha
then bump it as for a point release, e.g. `6.0.0` → `6.0.1-alpha`.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12238610275

Upstream-Ref: Automattic/jetpack@d6205c2
  • Loading branch information
anomiex authored and matticbot committed Dec 9, 2024
1 parent ab3c234 commit 367651d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/files/autorelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ elif [[ "$GITHUB_REF" == "refs/heads/trunk" ]]; then
fi
ROLLING_MODE=true
CURRENT_VER=$( sed -nEe 's/^## \[?([^]]*)\]? - .*/\1/;T;p;q' CHANGELOG.md || true )
if [[ "$CURRENT_VER" != *-alpha ]]; then
# Bump a non-alpha release to the next alpha to avoid confusing version_compare.
CURRENT_VER=${CURRENT_VER%%-*}
CURRENT_VER=${CURRENT_VER%.*}.$(( ${CURRENT_VER##*.} + 1 ))-alpha
fi
GIT_SUFFIX=$( git log -1 --format="%ct.g%h" . )
TAG="$CURRENT_VER+rolling.$GIT_SUFFIX"
else
Expand Down

0 comments on commit 367651d

Please sign in to comment.