ci: use proper git ref for versioning

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-02-08 12:53:38 +01:00
parent 65bcba49a0
commit fabf9cd4e9
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
2 changed files with 21 additions and 3 deletions

View file

@ -12,6 +12,10 @@ WORKDIR /src
FROM base AS build
ENV GO111MODULE=auto
ENV CGO_ENABLED=0
# GIT_REF is used by goreleaser-xx to handle the proper git ref when available.
# It will fallback to the working tree info if empty and use "git tag --points-at"
# or "git describe" to define the version info.
ARG GIT_REF
ARG TARGETPLATFORM
ARG PKG="github.com/distribution/distribution/v3"
ARG BUILDTAGS="include_oss include_gcs"
@ -28,7 +32,7 @@ RUN --mount=type=bind,target=/src,rw \
--files="LICENSE" \
--files="README.md"
FROM scratch AS artifacts
FROM scratch AS artifact
COPY --from=build /out/*.tar.gz /
COPY --from=build /out/*.zip /
COPY --from=build /out/*.sha256 /