Skip to content

fix: release workflow to tag images correctly #1700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
26 changes: 24 additions & 2 deletions .github/workflows/docker_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,30 @@ jobs:
- name: Get the latest tag
id: get_latest_tag
run: |
git fetch --tags
latest_tag=$(git tag -l | sort -V | tail -n 1)
git fetch --tags

# Get the most recent tag (including RC candidates) to determine the latest version
most_recent_tag=$(git tag -l | sort -V | tail -n 1)
echo "most recent tag: $most_recent_tag"

# Extract the base version (remove rc/alpha/beta suffixes)
base_version=$(echo "$most_recent_tag" | sed -E 's/-?(rc|alpha|beta)[0-9]*$//')
echo "base version: $base_version"

# Look for a stable release of this base version
echo "Looking for exact match of: '$base_version'"
stable_tag=$(git tag -l | grep "^$base_version$" | head -n 1)
echo "stable tag found: '$stable_tag'"

# If we found a stable version, use it; otherwise use the most recent tag
if [ -n "$stable_tag" ]; then
latest_tag="$stable_tag"
echo "found stable version: $stable_tag"
else
latest_tag="$most_recent_tag"
echo "using most recent tag: $most_recent_tag"
fi

echo "latest tag: $latest_tag"
echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV

Expand Down