Skip to content

Commit

Permalink
Release: add static binaries
Browse files Browse the repository at this point in the history
Fix issue 7296

Signed-off-by: Akihiro Suda <[email protected]>
  • Loading branch information
AkihiroSuda committed Nov 11, 2022
1 parent 02484f5 commit 9d44a5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
export CC=$(xx-info)-gcc && xx-go --wrap && \
make release cri-release cri-cni-release && \
make release static-release cri-release cri-cni-release && \
for f in $(find bin -executable -type f); do xx-verify $f; done

# check git working tree after build
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ WHALE = "🇩"
ONI = "👹"

RELEASE=containerd-$(VERSION:v%=%)-${GOOS}-${GOARCH}
STATICRELEASE=containerd-static-$(VERSION:v%=%)-${GOOS}-${GOARCH}
CRIRELEASE=cri-containerd-$(VERSION:v%=%)-${GOOS}-${GOARCH}
CRICNIRELEASE=cri-containerd-cni-$(VERSION:v%=%)-${GOOS}-${GOARCH}

Expand Down Expand Up @@ -148,7 +149,7 @@ GOTEST ?= $(GO) test
OUTPUTDIR = $(join $(ROOTDIR), _output)
CRIDIR=$(OUTPUTDIR)/cri

.PHONY: clean all AUTHORS build binaries test integration generate protos check-protos coverage ci check help install uninstall vendor release mandir install-man genman install-cri-deps cri-release cri-cni-release cri-integration install-deps bin/cri-integration.test
.PHONY: clean all AUTHORS build binaries test integration generate protos check-protos coverage ci check help install uninstall vendor release static-release mandir install-man genman install-cri-deps cri-release cri-cni-release cri-integration install-deps bin/cri-integration.test
.DEFAULT: default

# Forcibly set the default goal to all, in case an include above brought in a rule definition.
Expand Down Expand Up @@ -311,6 +312,14 @@ release: releases/$(RELEASE).tar.gz
@echo "$(WHALE) $@"
@cd releases && sha256sum $(RELEASE).tar.gz >$(RELEASE).tar.gz.sha256sum

releases/$(STATICRELEASE).tar.gz:
@make STATIC=1 releases/$(RELEASE).tar.gz
@mv releases/$(RELEASE).tar.gz releases/$(STATICRELEASE).tar.gz

static-release: releases/$(STATICRELEASE).tar.gz
@echo "$(WHALE) $@"
@cd releases && sha256sum $(STATICRELEASE).tar.gz >$(STATICRELEASE).tar.gz.sha256sum

# install of cri deps into release output directory
ifeq ($(GOOS),windows)
install-cri-deps: $(BINARIES)
Expand Down

0 comments on commit 9d44a5a

Please sign in to comment.