|
5 | 5 | workflow_dispatch: |
6 | 6 | inputs: |
7 | 7 | tag: |
8 | | - description: 'Tag to build (e.g., v2.10.0, 2.10.0, v2.10, v2)' |
| 8 | + description: 'Tag to build (e.g., v2.10.0, v2.10, v2)' |
9 | 9 | required: true |
10 | 10 | type: string |
11 | 11 |
|
@@ -43,28 +43,27 @@ jobs: |
43 | 43 | TAG=${GITHUB_REF#refs/tags/} |
44 | 44 | fi |
45 | 45 | |
46 | | - # Remove 'v' prefix if present |
| 46 | + # Ensure tag starts with 'v' |
| 47 | + if [[ ! $TAG =~ ^v ]]; then |
| 48 | + TAG="v${TAG}" |
| 49 | + fi |
| 50 | + |
| 51 | + # Remove 'v' prefix for splitting |
47 | 52 | VERSION=${TAG#v} |
48 | 53 | |
49 | 54 | # Split version into parts |
50 | 55 | IFS='.' read -ra PARTS <<< "$VERSION" |
51 | 56 | |
52 | | - # Generate tags based on number of version parts |
| 57 | + # Generate tags based on number of version parts (keeping 'v' prefix) |
53 | 58 | if [ ${#PARTS[@]} -eq 1 ]; then |
54 | | - # Only major version (e.g., v2 or 2) |
55 | | - echo "tag_major=$(echo ${{ matrix.db-type }})-${PARTS[0]}" >> $GITHUB_ENV |
56 | | - echo "TAGS=${{ matrix.db-type }}-${PARTS[0]}" >> $GITHUB_ENV |
| 59 | + # Only major version (e.g., v2) |
| 60 | + echo "TAGS=${{ matrix.db-type }}-v${PARTS[0]}" >> $GITHUB_ENV |
57 | 61 | elif [ ${#PARTS[@]} -eq 2 ]; then |
58 | | - # Major.minor version (e.g., v2.10 or 2.10) |
59 | | - echo "tag_major=$(echo ${{ matrix.db-type }})-${PARTS[0]}" >> $GITHUB_ENV |
60 | | - echo "tag_minor=$(echo ${{ matrix.db-type }})-${PARTS[0]}.${PARTS[1]}" >> $GITHUB_ENV |
61 | | - echo "TAGS=${{ matrix.db-type }}-${PARTS[0]}, ${{ matrix.db-type }}-${PARTS[0]}.${PARTS[1]}" >> $GITHUB_ENV |
| 62 | + # Major.minor version (e.g., v2.10) |
| 63 | + echo "TAGS=${{ matrix.db-type }}-v${PARTS[0]}, ${{ matrix.db-type }}-v${PARTS[0]}.${PARTS[1]}" >> $GITHUB_ENV |
62 | 64 | else |
63 | | - # Full version (e.g., v2.10.0 or 2.10.0) |
64 | | - echo "tag_major=$(echo ${{ matrix.db-type }})-${PARTS[0]}" >> $GITHUB_ENV |
65 | | - echo "tag_minor=$(echo ${{ matrix.db-type }})-${PARTS[0]}.${PARTS[1]}" >> $GITHUB_ENV |
66 | | - echo "tag_patch=$(echo ${{ matrix.db-type }})-${VERSION}" >> $GITHUB_ENV |
67 | | - echo "TAGS=${{ matrix.db-type }}-${PARTS[0]}, ${{ matrix.db-type }}-${PARTS[0]}.${PARTS[1]}, ${{ matrix.db-type }}-${VERSION}" >> $GITHUB_ENV |
| 65 | + # Full version (e.g., v2.10.0) |
| 66 | + echo "TAGS=${{ matrix.db-type }}-v${PARTS[0]}, ${{ matrix.db-type }}-v${PARTS[0]}.${PARTS[1]}, ${{ matrix.db-type }}-v${VERSION}" >> $GITHUB_ENV |
68 | 67 | fi |
69 | 68 |
|
70 | 69 | - uses: mr-smithers-excellent/docker-build-push@v6 |
|
0 commit comments