release: import umoci's release.sh script

This script is far easier to use than the previous `make release`
target, not to mention that it also automatically signs all of the
artefacts and makes everything really easy to do for maintainers.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
Aleksa Sarai
2017-08-12 00:07:49 +10:00
parent b31bdfc38a
commit ed68ee1e10
2 changed files with 131 additions and 25 deletions
+1 -25
View File
@@ -43,31 +43,7 @@ static: $(SOURCES)
CGO_ENABLED=1 $(GO) build $(EXTRA_FLAGS) -tags "$(BUILDTAGS) cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit=${COMMIT} -X main.version=${VERSION} $(EXTRA_LDFLAGS)" -o contrib/cmd/recvtty/recvtty ./contrib/cmd/recvtty
release:
@flag_list=(seccomp selinux apparmor static); \
unset expression; \
for flag in "$${flag_list[@]}"; do \
expression+="' '{'',$${flag}}"; \
done; \
eval profile_list=("$$expression"); \
for profile in "$${profile_list[@]}"; do \
output=${RELEASE_DIR}/runc; \
for flag in $$profile; do \
output+=."$$flag"; \
done; \
tags="$$profile"; \
ldflags="-X main.gitCommit=${COMMIT} -X main.version=${VERSION}"; \
buildflags="-buildmode=pie"; \
CGO_ENABLED=; \
[[ "$$profile" =~ static ]] && { \
tags="$${tags/static/static_build}"; \
tags+=" cgo"; \
buildflags=; \
ldflags+=" -w -extldflags -static"; \
CGO_ENABLED=1; \
}; \
echo "Building target: $$output"; \
$(GO) build $$buildflags $(EXTRA_FLAGS) -ldflags "$$ldflags $(EXTRA_LDFLAGS)" -tags "$$tags" -o "$$output" .; \
done
script/release.sh -r release/$(VERSION) -v $(VERSION)
dbuild: runcimage
docker run --rm -v $(CURDIR):/go/src/$(PROJECT) --privileged $(RUNC_IMAGE) make clean all