From 93309e5a6b1eeb485b5a8dad05632df70f8f1999 Mon Sep 17 00:00:00 2001 From: tyranron Date: Wed, 27 Jul 2022 14:05:13 +0300 Subject: [PATCH] Fix forming Docker image version tags Additionally: - restore more precise `org.opencontainers.image.version` Docker image annotation --- .github/workflows/ci.yml | 2 +- Dockerfile | 4 ++-- Makefile | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f21c380..e5b964d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -260,7 +260,7 @@ jobs: if ('${{ steps.semver.outputs.group3 }}' !== '0') { versions += ',${{ steps.semver.outputs.group3 }}'; } - versions += 'latest'; + versions += ',latest'; } return versions; if: ${{ steps.skip.outputs.no == 'true' diff --git a/Dockerfile b/Dockerfile index 7b0a225..ac34222 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,8 +39,8 @@ COPY lib/ /app/lib/ COPY src/ /app/src/ # Build project distribution binary. -# TODO: use --out-dir once stabilized -# TODO: https://github.com/rust-lang/cargo/issues/6790 +# TODO: Use `--out-dir` once stabilized: +# https://github.com/rust-lang/cargo/issues/6790 RUN cargo build -p baza ${rustc_opts} # Prepare project distribution binary and all dependent dynamic libraries. diff --git a/Makefile b/Makefile index aa34e3d..b8f52cc 100644 --- a/Makefile +++ b/Makefile @@ -210,11 +210,9 @@ docker.image: --label org.opencontainers.image.source=$(github_url)/$(github_repo) \ --label org.opencontainers.image.revision=$(strip \ $(shell git show --pretty=format:%H --no-patch)) \ - --label org.opencontainers.image.version=$(strip $(VERSION)) \ + --label org.opencontainers.image.version=$(subst v,,$(strip \ + $(shell git describe --tags --dirty --match='v*'))) \ -t $(OWNER)/$(NAME):$(or $(tag),dev) ./ -# TODO: Enable after first release. -# --label org.opencontainers.image.version=$(strip \ -# $(shell git describe --tags --dirty)) # Manually push project Docker images to container registries.