mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Fixed version tags.
This commit is contained in:
parent
ba707451df
commit
401822582d
1 changed files with 14 additions and 15 deletions
29
.github/workflows/cd.yml
vendored
29
.github/workflows/cd.yml
vendored
|
|
@ -5,7 +5,7 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: 'Tag to build (e.g., v2.10.0, 2.10.0, v2.10, v2)'
|
description: 'Tag to build (e.g., v2.10.0, v2.10, v2)'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
|
@ -43,28 +43,27 @@ jobs:
|
||||||
TAG=${GITHUB_REF#refs/tags/}
|
TAG=${GITHUB_REF#refs/tags/}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove 'v' prefix if present
|
# Ensure tag starts with 'v'
|
||||||
|
if [[ ! $TAG =~ ^v ]]; then
|
||||||
|
TAG="v${TAG}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove 'v' prefix for splitting
|
||||||
VERSION=${TAG#v}
|
VERSION=${TAG#v}
|
||||||
|
|
||||||
# Split version into parts
|
# Split version into parts
|
||||||
IFS='.' read -ra PARTS <<< "$VERSION"
|
IFS='.' read -ra PARTS <<< "$VERSION"
|
||||||
|
|
||||||
# Generate tags based on number of version parts
|
# Generate tags based on number of version parts (keeping 'v' prefix)
|
||||||
if [ ${#PARTS[@]} -eq 1 ]; then
|
if [ ${#PARTS[@]} -eq 1 ]; then
|
||||||
# Only major version (e.g., v2 or 2)
|
# Only major version (e.g., v2)
|
||||||
echo "tag_major=$(echo ${{ matrix.db-type }})-${PARTS[0]}" >> $GITHUB_ENV
|
echo "TAGS=${{ matrix.db-type }}-v${PARTS[0]}" >> $GITHUB_ENV
|
||||||
echo "TAGS=${{ matrix.db-type }}-${PARTS[0]}" >> $GITHUB_ENV
|
|
||||||
elif [ ${#PARTS[@]} -eq 2 ]; then
|
elif [ ${#PARTS[@]} -eq 2 ]; then
|
||||||
# Major.minor version (e.g., v2.10 or 2.10)
|
# Major.minor version (e.g., v2.10)
|
||||||
echo "tag_major=$(echo ${{ matrix.db-type }})-${PARTS[0]}" >> $GITHUB_ENV
|
echo "TAGS=${{ matrix.db-type }}-v${PARTS[0]}, ${{ matrix.db-type }}-v${PARTS[0]}.${PARTS[1]}" >> $GITHUB_ENV
|
||||||
echo "tag_minor=$(echo ${{ matrix.db-type }})-${PARTS[0]}.${PARTS[1]}" >> $GITHUB_ENV
|
|
||||||
echo "TAGS=${{ matrix.db-type }}-${PARTS[0]}, ${{ matrix.db-type }}-${PARTS[0]}.${PARTS[1]}" >> $GITHUB_ENV
|
|
||||||
else
|
else
|
||||||
# Full version (e.g., v2.10.0 or 2.10.0)
|
# Full version (e.g., v2.10.0)
|
||||||
echo "tag_major=$(echo ${{ matrix.db-type }})-${PARTS[0]}" >> $GITHUB_ENV
|
echo "TAGS=${{ matrix.db-type }}-v${PARTS[0]}, ${{ matrix.db-type }}-v${PARTS[0]}.${PARTS[1]}, ${{ matrix.db-type }}-v${VERSION}" >> $GITHUB_ENV
|
||||||
echo "tag_minor=$(echo ${{ matrix.db-type }})-${PARTS[0]}.${PARTS[1]}" >> $GITHUB_ENV
|
|
||||||
echo "tag_patch=$(echo ${{ matrix.db-type }})-${VERSION}" >> $GITHUB_ENV
|
|
||||||
echo "TAGS=${{ matrix.db-type }}-${PARTS[0]}, ${{ matrix.db-type }}-${PARTS[0]}.${PARTS[1]}, ${{ matrix.db-type }}-${VERSION}" >> $GITHUB_ENV
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- uses: mr-smithers-excellent/docker-build-push@v6
|
- uses: mr-smithers-excellent/docker-build-push@v6
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue