ci: only tag latest for stable releases, skip pre-releases
• Add pre-release detection step • Check for 'rc' and 'dev' in tags • Conditionally apply latest tag • Skip latest for pre-releases • Preserve stable release tagging
This commit is contained in:
parent
f43eb00e6c
commit
4772148901
1 changed files with 13 additions and 1 deletions
14
.github/workflows/docker-publish.yml
vendored
14
.github/workflows/docker-publish.yml
vendored
|
|
@ -35,6 +35,18 @@ jobs:
|
||||||
echo "Found tag: $TAG"
|
echo "Found tag: $TAG"
|
||||||
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Check if pre-release
|
||||||
|
id: check_prerelease
|
||||||
|
run: |
|
||||||
|
TAG="${{ steps.get_tag.outputs.tag }}"
|
||||||
|
if [[ "$TAG" == *"rc"* ]] || [[ "$TAG" == *"dev"* ]]; then
|
||||||
|
echo "is_prerelease=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "This is a pre-release version: $TAG"
|
||||||
|
else
|
||||||
|
echo "is_prerelease=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "This is a stable release: $TAG"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Update version in __init__.py
|
- name: Update version in __init__.py
|
||||||
run: |
|
run: |
|
||||||
sed -i "s/__version__ = \".*\"/__version__ = \"${{ steps.get_tag.outputs.tag }}\"/" lightrag/__init__.py
|
sed -i "s/__version__ = \".*\"/__version__ = \"${{ steps.get_tag.outputs.tag }}\"/" lightrag/__init__.py
|
||||||
|
|
@ -48,7 +60,7 @@ jobs:
|
||||||
images: ghcr.io/${{ github.repository }}
|
images: ghcr.io/${{ github.repository }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=${{ steps.get_tag.outputs.tag }}
|
type=raw,value=${{ steps.get_tag.outputs.tag }}
|
||||||
type=raw,value=latest
|
type=raw,value=latest,enable=${{ steps.check_prerelease.outputs.is_prerelease == 'false' }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue