Skip to content

Commit

Permalink
Improve lib-injection tagging script (#5598)
Browse files Browse the repository at this point in the history
* Be more restrictive with the version tags

* TESTING

* Revert "TESTING"

This reverts commit d5dc44d.
  • Loading branch information
andrewlock authored May 22, 2024
1 parent 205b53f commit e81cd24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .gitlab/build-lib-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ git fetch --tags
# So we fetch all tags and sort them to find both the latest, and the latest in this major.
# 'sort' technically gets prerelease versions in the wrong order here, but we explicitly
# exclude them anyway, as they're ignored for the purposes of determining the 'latest' tags.
LATEST_TAG="$(git tag | grep -v '-' | sort -V -r | head -n 1)"
LATEST_MAJOR_TAG="$(git tag -l "$MAJOR_VERSION.*" | grep -v '-' | sort -V -r | head -n 1)"
LATEST_TAG="$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V -r | head -n 1)"
LATEST_MAJOR_TAG="$(git tag -l "$MAJOR_VERSION.*" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V -r | head -n 1)"

echo "This tag: $CI_COMMIT_TAG"
echo "Latest repository tag: $LATEST_TAG"
echo "Latest repository tag for this major: $LATEST_MAJOR_TAG"
Expand Down

0 comments on commit e81cd24

Please sign in to comment.