diff --git a/.github/workflows/release/Dockerfile b/.github/workflows/release/Dockerfile index f3e4d1e00d28..908123a83b4d 100644 --- a/.github/workflows/release/Dockerfile +++ b/.github/workflows/release/Dockerfile @@ -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 diff --git a/Makefile b/Makefile index 121b68201ac3..3d1b622459d7 100644 --- a/Makefile +++ b/Makefile @@ -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} @@ -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. @@ -299,18 +300,40 @@ install-man: man $(foreach manpage,$(addprefix man/,$(MANPAGES)), $(call installmanpage,$(manpage),$(subst .,,$(suffix $(manpage))),$(notdir $(manpage)))) +define pack_release + @rm -rf releases/$(1) releases/$(1).tar.gz + @$(INSTALL) -d releases/$(1)/bin + @$(INSTALL) $(BINARIES) releases/$(1)/bin + @tar -czf releases/$(1).tar.gz -C releases/$(1) bin + @rm -rf releases/$(1) +endef + + releases/$(RELEASE).tar.gz: $(BINARIES) @echo "$(WHALE) $@" - @rm -rf releases/$(RELEASE) releases/$(RELEASE).tar.gz - @$(INSTALL) -d releases/$(RELEASE)/bin - @$(INSTALL) $(BINARIES) releases/$(RELEASE)/bin - @tar -czf releases/$(RELEASE).tar.gz -C releases/$(RELEASE) bin - @rm -rf releases/$(RELEASE) + $(call pack_release,$(RELEASE)) release: releases/$(RELEASE).tar.gz @echo "$(WHALE) $@" @cd releases && sha256sum $(RELEASE).tar.gz >$(RELEASE).tar.gz.sha256sum +releases/$(STATICRELEASE).tar.gz: +ifeq ($(GOOS),linux) + @make STATIC=1 $(BINARIES) + @echo "$(WHALE) $@" + $(call pack_release,$(STATICRELEASE)) +else + @echo "Skipping $(STATICRELEASE) for $(GOOS)" +endif + +static-release: releases/$(STATICRELEASE).tar.gz +ifeq ($(GOOS),linux) + @echo "$(WHALE) $@" + @cd releases && sha256sum $(STATICRELEASE).tar.gz >$(STATICRELEASE).tar.gz.sha256sum +else + @echo "Skipping releasing $(STATICRELEASE) for $(GOOS)" +endif + # install of cri deps into release output directory ifeq ($(GOOS),windows) install-cri-deps: $(BINARIES) diff --git a/releases/v1.7.0-beta.toml b/releases/v1.7.0-beta.toml index 6a9cfc8b1bfa..8f00466aa578 100644 --- a/releases/v1.7.0-beta.toml +++ b/releases/v1.7.0-beta.toml @@ -93,3 +93,17 @@ The 2.0 release will remove any feature deprecated in 1.x. Features deprecated i * **Add NoSameOwner option when unpacking tars** ([#7386](https://github.com/containerd/containerd/pull/7386)) See the changelog for complete list of changes""" + +# postface requires release-tool >= 1.1 +postface = """\ +### Which file should I download? +* `containerd---.tar.gz`: ✅Recommended. Dynamically linked with glibc 2.27 (Ubuntu 18.04). +* `containerd-static---.tar.gz`: Statically linked. Expected to be used on non-glibc Linux distributions. Not position-independent. +* `cri-containerd---.tar.gz`: (Deprecated) +* `cri-containerd-cni---.tar.gz`: (Deprecated) + +In addition to containerd, typically you will have to install [runc](https://github.com/opencontainers/runc/releases) +and [CNI plugins](https://github.com/containernetworking/plugins/releases) from their official sites too. + +See also the [Getting Started](https://github.com/containerd/containerd/blob/main/docs/getting-started.md) documentation. +"""