add latest tag for php-8 builds

[SKIP CI]
This commit is contained in:
Ruben Momoa
2024-08-29 10:19:39 +02:00
parent 3483285a2e
commit a6400ebb95
2 changed files with 13 additions and 5 deletions

View File

@@ -1,9 +1,9 @@
matrix:
PHP_VERSION:
- 8
- 8.3
- 8.2
- 8.1
- 8.2
- 8.3
- 8
when:
branch:

View File

@@ -12,14 +12,22 @@ fi
version=$1
# Suffix
[[ -n $2 ]] && suffix="-$2" || suffix=""
suffix=""
if [[ -n $2 ]]; then
suffix="-$2"
fi
touch tags.txt
if [[ "$2" = "php-8" ]]; then
echo "latest" >> tags.txt
fi
# Check if the first character is "V" or "v" and remove it
if [[ "${version:0:1}" == "V" || "${version:0:1}" == "v" ]]; then
version="${version#?}"
fi
echo "latest$suffix" > tags.txt
echo "latest$suffix" >> tags.txt
echo "$version" | cut -d'.' -f1 | xargs -I {} echo "{}$suffix" >> tags.txt
echo "$version" | cut -d'.' -f1,2 | xargs -I {} echo "{}$suffix" >> tags.txt
echo "$version" | cut -d'.' -f1,2,3 | xargs -I {} echo "{}$suffix" >> tags.txt