Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions versions/print_versions.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ get_tags_without_rc() {
}

get_next_minor_and_patch() {
DAY_OF_WEEK=$(date --utc +%u) # 1=Monday, 7=Sunday
DAY_NEXT_MONDAY=$(date --utc --date="+$((8 - ${DAY_OF_WEEK})) days" +%d)

version=${1}
local max_tag=$(get_tags_without_rc | grep -E "^${version}" | tail -n 1)
if [[ -z $max_tag ]]; then
max_tag=$(get_tags | grep -E "^${version}" | tail -n 1)
fi
IFS='.' read -r -a parts <<<"${max_tag}"
if [ "$DAY_NEXT_MONDAY" -lt 7 ]; then

local next_release_branch="${parts[0]#v}.${parts[1]}.$((${parts[2]} + 1)).x"
if gh api "repos/shopware/shopware/branches/${next_release_branch}" --silent 2>/dev/null; then
echo "NEXT_MINOR=${parts[0]}.${parts[1]}.$((${parts[2]} + 2)).0"
else
echo "NEXT_MINOR=${parts[0]}.${parts[1]}.$((${parts[2]} + 1)).0"
Expand Down