Skip to content

Commit faa3d54

Browse files
committed
feat: use git tags for versioning instead of file
1 parent 31527ee commit faa3d54

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

.github/workflows/containers-publish.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,14 @@ jobs:
2626
- name: Compute Docker container image addresses
2727
run: |
2828
DOCKER_REPOSITORY="ghcr.io/${GITHUB_REPOSITORY,,}"
29-
VERSION=$(cat VERSION)
3029
3130
if [[ "${{ github.event_name }}" == "release" ]]; then
32-
# Use the GitHub Release tag (removing 'v' prefix if present)
3331
TAG="${GITHUB_REF#refs/tags/}"
3432
DOCKER_TAG="${TAG#v}"
35-
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
36-
# Stable version for main branch
37-
DOCKER_TAG="${VERSION}"
3833
else
39-
# Pre-release version for develop and other branches
34+
git fetch --tags --force
35+
BASE_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
36+
VERSION="${BASE_TAG#v}"
4037
TIMESTAMP=$(date +%Y%m%d%H%M%S)
4138
DOCKER_TAG="${VERSION}-dev.${TIMESTAMP}"
4239
fi

0 commit comments

Comments
 (0)