From f0238ad7340c8e57647e955c959b339df3daccf1 Mon Sep 17 00:00:00 2001 From: DiheChen Date: Sat, 31 Oct 2026 01:22:14 +0800 Subject: [PATCH] feat: add release-aware image versioning --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3bf2be..9f3d2c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,7 +84,8 @@ jobs: images: ghcr.io/${{ github.repository }}/${{ matrix.image }} flavor: latest=false tags: | - type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=edge,enable={{is_default_branch}} + type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }} type=semver,pattern={{version}} type=sha,prefix= - uses: docker/build-push-action@v7 @@ -94,7 +95,7 @@ jobs: target: ${{ matrix.target }} platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - build-args: VERSION=${{ github.sha }} + build-args: VERSION=${{ github.ref_type == 'tag' && format('{0}+{1}', github.ref_name, github.sha) || github.sha }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha,scope=${{ matrix.image }}