Skip to content

Commit

Permalink
ci: support no previous stable tags (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjorge-graphops authored Oct 8, 2024
1 parent d09d850 commit c725d1b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/trigger-push-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,21 @@ jobs:
chart_name=$(echo ${chart_dir} | cut -d '/' -f 2)
latest_version="$(git -c 'versionsort.suffix=-' tag --sort 'version:refname' --list "$chart_name-*" | grep -Ev '.*-[[:digit:]]+.[[:digit:]]+.[[:digit:]]+-.*' | tail -n1)"
next_patch=""
if [ -z "$latest_version" ]; then
latest_version="$(git -c 'versionsort.suffix=-' tag --sort 'version:refname' --list "$chart_name-*" | tail -n1 | sed 's/-canary\.[0-9]*//')"
next_patch="$(echo ${latest_version} | sed 's/.*-\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/')"
fi
if [ -z "$latest_version" ]; then
latest_version="0.0.0"
fi
if [ -z "$next_patch" ]; then
next_patch="$(echo "$latest_version" | sed -E 's/(.*-)?([[:digit:]]+).([[:digit:]]+).([[:digit:]]+)/echo \2.\3.$((\4 + 1))/e')"
fi
next_patch="$(echo "$latest_version" | sed -E 's/(.*-)?([[:digit:]]+).([[:digit:]]+).([[:digit:]]+)/echo \2.\3.$((\4 + 1))/e')"
last_pre_tag="$(git -c 'versionsort.suffix=-' tag --sort 'version:refname' --list "$chart_name-$next_patch-*" | tail -n1)"
if [ -z "$last_pre_tag" ]; then
index=1
Expand Down

0 comments on commit c725d1b

Please sign in to comment.