mirror of
https://github.com/Aider-AI/aider
synced 2026-04-25 17:15:07 +02:00
ci: Fix latest tag detection to exclude dev tags
This commit is contained in:
16
.github/workflows/check_pypi_version.yml
vendored
16
.github/workflows/check_pypi_version.yml
vendored
@@ -55,13 +55,23 @@ jobs:
|
||||
- name: Get latest tag
|
||||
id: latest_tag
|
||||
run: |
|
||||
set -x # Enable debugging output
|
||||
# Fetch all tags from remote just in case
|
||||
git fetch --tags origin main
|
||||
# Get the latest tag that looks like vX.Y.Z (no 'dev')
|
||||
latest_tag=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -n 1)
|
||||
# Get the latest tag that strictly matches vX.Y.Z (no suffixes like .dev)
|
||||
# List all tags, sort by version descending, filter for exact pattern, take the first one
|
||||
latest_tag=$(git tag --sort=-v:refname | grep -P '^v\d+\.\d+\.\d+$' | head -n 1)
|
||||
|
||||
if [ -z "$latest_tag" ]; then
|
||||
echo "Error: Could not find any tags matching the pattern '^v\d+\.\d+\.\d+$'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Latest non-dev tag: $latest_tag"
|
||||
# Remove 'v' prefix for comparison
|
||||
echo "tag=${latest_tag#v}" >> $GITHUB_OUTPUT
|
||||
tag_num=${latest_tag#v}
|
||||
echo "Extracted tag number: $tag_num"
|
||||
echo "tag=$tag_num" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Compare versions
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user