From 764d5119c4699a01540f671f8f6a1b5587b6cc9d Mon Sep 17 00:00:00 2001 From: Indra Gunanda Date: Tue, 4 Aug 2026 17:08:54 +0700 Subject: [PATCH] fix(ci): use v-stripped image tag in release notes; correct tag docs docker/metadata-action strips the leading "v" from semver tags, so git tag v0.0.1 publishes images as 0.0.1. Release notes printed `docker pull ...:v0.0.1`, which does not exist. Add a meta.image_tag output and use it in the release body. Also correct the README tagging table: 0.x.y tags DO get a major-only `0` tag (verified against the published v0.0.1 packages: latest, 0, 0.0, 0.0.1). --- .github/workflows/release.yml | 12 +++++++++--- README.md | 12 ++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c41f96c..36a86bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,6 +51,7 @@ jobs: needs: verify outputs: version: ${{ steps.v.outputs.version }} + image_tag: ${{ steps.v.outputs.image_tag }} is_release: ${{ steps.v.outputs.is_release }} commit: ${{ steps.v.outputs.commit }} build_date: ${{ steps.v.outputs.build_date }} @@ -60,10 +61,15 @@ jobs: - id: v run: | if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then - echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" + tag="${GITHUB_REF#refs/tags/}" + echo "version=${tag}" >> "$GITHUB_OUTPUT" + # docker/metadata-action strips the leading "v" from semver tags, + # so image tags are 1.2.3 while the git tag is v1.2.3. + echo "image_tag=${tag#v}" >> "$GITHUB_OUTPUT" echo "is_release=true" >> "$GITHUB_OUTPUT" else echo "version=dev" >> "$GITHUB_OUTPUT" + echo "image_tag=dev" >> "$GITHUB_OUTPUT" echo "is_release=false" >> "$GITHUB_OUTPUT" fi echo "commit=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" @@ -251,8 +257,8 @@ jobs: ## Container images ```bash - docker pull ${{ env.SERVER_IMAGE }}:${{ needs.meta.outputs.version }} - docker pull ${{ env.CLI_IMAGE }}:${{ needs.meta.outputs.version }} + docker pull ${{ env.SERVER_IMAGE }}:${{ needs.meta.outputs.image_tag }} + docker pull ${{ env.CLI_IMAGE }}:${{ needs.meta.outputs.image_tag }} ``` Platforms: `linux/amd64`, `linux/arm64`. diff --git a/README.md b/README.md index d3928a8..3e9320b 100644 --- a/README.md +++ b/README.md @@ -368,11 +368,15 @@ One `Dockerfile`, two final stages, both distroless + static (`CGO_ENABLED=0`), ```bash # Run the gRPC server docker run --rm -p 50051:50051 --env-file .env \ - ghcr.io/igun997/deploy-everything:dev + ghcr.io/igun997/deploy-everything:0.0.1 # Run a CLI command docker run --rm --env-file .env \ - ghcr.io/igun997/deploy-everything-cli:dev projects list + ghcr.io/igun997/deploy-everything-cli:0.0.1 projects list + +# Bleeding edge (current master) +docker run --rm --env-file .env \ + ghcr.io/igun997/deploy-everything-cli:dev version ``` --- @@ -389,13 +393,13 @@ docker run --rm --env-file .env \ | Git event | Image tags | |-----------|-----------| | push/merge to `master` | `dev`, `dev-` | -| tag `v0.0.1` (any `0.x.y`) | `0.0.1`, `0.0`, `latest` | +| tag `v0.0.1` | `0.0.1`, `0.0`, `0`, `latest` | | tag `v1.2.3` | `1.2.3`, `1.2`, `1`, `latest` | | pre-release tag `v1.2.3-rc1` | `1.2.3-rc1` only (no `latest`, no `1.2`/`1`) | So `:dev` always points at the current `master`, `:latest` always points at the newest stable release. -`0.x.y` tags intentionally get no major-only tag — `docker/metadata-action` skips `{{major}}` for `0.x` because semver treats it as initial development with no compatibility guarantee. +The leading `v` is stripped from image tags: git tag `v0.0.1` produces image tag `0.0.1`. The binaries still report the full `v0.0.1` from `version`. ### Cutting a release