Skip to content

Commit d83e1d0

Browse files
author
Tomoya Usami
committed
Embed the correct version information in the release artifacts
Signed-off-by: Tomoya Usami <[email protected]>
1 parent 71f2414 commit d83e1d0

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.github/workflows/release_build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
path: .build
171171
key: ${{ runner.os }}-tools-${{ hashFiles('.go-version','Makefile') }}
172172
- name: Build images
173-
run: make images-no-load
173+
run: TAG=${GITHUB_REF##refs/tags/v} make images-no-load
174174
- name: Export images
175175
run: tar -czvf images.tar.gz *-image.tar
176176
- name: Archive images

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ COPY . .
1717
FROM --platform=$BUILDPLATFORM tonistiigi/xx@sha256:9dde7edeb9e4a957ce78be9f8c0fbabe0129bf5126933cd3574888f443731cda AS xx
1818

1919
FROM --platform=${BUILDPLATFORM} base as builder
20+
ARG TAG
2021
ARG TARGETPLATFORM
2122
ARG TARGETARCH
2223
COPY --link --from=xx / /
@@ -59,7 +60,7 @@ ENV CGO_ENABLED=1
5960
RUN --mount=type=cache,target=/root/.cache/go-build \
6061
--mount=type=cache,target=/go/pkg/mod \
6162
if [ "$TARGETARCH" = "arm64" ]; then CC=aarch64-alpine-linux-musl; elif [ "$TARGETARCH" = "s390x" ]; then CC=s390x-alpine-linux-musl; fi && \
62-
make build-static && \
63+
make build-static git_tag=$TAG git_dirty="" && \
6364
for f in $(find bin -executable -type f); do xx-verify $f; done
6465

6566
FROM --platform=${BUILDPLATFORM} scratch AS spire-base

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ bin/static/%: cmd/% FORCE | go-check
284284
$(E)$(go_build_static) $@$(exe) ./$<
285285

286286
bin/static/%: support/% FORCE | go-check
287-
@echo Building $@
288287
$(E)$(go_build_static) $@$(exe) ./$<
289288

290289
#############################################################################
@@ -337,6 +336,7 @@ $1: $3 container-builder
337336
$(E)docker buildx build \
338337
--platform $(PLATFORMS) \
339338
--build-arg goversion=$(go_version) \
339+
--build-arg TAG=$(TAG) \
340340
--target $2 \
341341
-o type=oci,dest=$2-image.tar \
342342
-f $3 \

0 commit comments

Comments
 (0)