mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 18:25:00 +00:00
ci: Fix latest tag detection to exclude dev tags
This commit is contained in:
parent
0a840860f1
commit
60859ec2b9
1 changed files with 13 additions and 3 deletions
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: |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue