diff --git a/.github/workflows/kata-deploy-push.yaml b/.github/workflows/kata-deploy-push.yaml index ed3d29b66f..b861379ffb 100644 --- a/.github/workflows/kata-deploy-push.yaml +++ b/.github/workflows/kata-deploy-push.yaml @@ -1,6 +1,6 @@ -name: kata-deploy-build +name: kata deploy build -on: push +on: [push, pull_request] jobs: build-asset: @@ -24,7 +24,7 @@ jobs: - name: Build ${{ matrix.asset }} run: | - ./tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh --build="${KATA_ASSET}" + make "${KATA_ASSET}-tarball" build_dir=$(readlink -f build) # store-artifact does not work with symlink sudo cp -r --preserve=all "${build_dir}" "kata-build" @@ -47,12 +47,21 @@ jobs: uses: actions/download-artifact@v2 with: name: kata-artifacts - path: kata-artifacts + path: build - name: merge-artifacts run: | - ./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts + make merge-builds - name: store-artifacts uses: actions/upload-artifact@v2 with: name: kata-static-tarball path: kata-static.tar.xz + + make-kata-tarball: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: make kata-tarball + run: | + make kata-tarball + sudo make install-tarball diff --git a/Makefile b/Makefile index 4d1c49a2e7..77267f1864 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ TOOLS += agent-ctl STANDARD_TARGETS = build check clean install test vendor include utils.mk +include ./tools/packaging/kata-deploy/local-build/Makefile all: build @@ -33,10 +34,4 @@ generate-protocols: static-checks: build bash ci/static-checks.sh -binary-tarball: - make -f ./tools/packaging/kata-deploy/local-build/Makefile - -install-binary-tarball: - make -f ./tools/packaging/kata-deploy/local-build/Makefile install - .PHONY: all default static-checks binary-tarball install-binary-tarball diff --git a/tools/packaging/kata-deploy/local-build/Makefile b/tools/packaging/kata-deploy/local-build/Makefile index 85d0bb7545..ad7d480421 100644 --- a/tools/packaging/kata-deploy/local-build/Makefile +++ b/tools/packaging/kata-deploy/local-build/Makefile @@ -7,47 +7,51 @@ MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) MK_DIR := $(dir $(MK_PATH)) # Verbose build -V ?= -ifneq ($(V),) -SILENT_BUILD_FLAG = -else -SILENT_BUILD_FLAG = -s -endif +V := 1 define BUILD - $(MK_DIR)/kata-deploy-binaries-in-docker.sh $(SILENT_BUILD_FLAG) --build=$1 + $(MK_DIR)/kata-deploy-binaries-in-docker.sh $(if $(V),,-s) --build=$1 endef kata-tarball: | all-parallel merge-builds all-parallel: - make -f $(MK_PATH) all -j$$(( $$(nproc) - 1 )) NO_TTY="true" + ${MAKE} -f $(MK_PATH) all -j$$(( $$(nproc) - 1 )) NO_TTY="true" V= -all: cloud-hypervisor firecracker kernel qemu rootfs-image rootfs-initrd shim-v2 +all: cloud-hypervisor-tarball \ + firecracker-tarball \ + kernel-tarball \ + qemu-tarball \ + rootfs-image-tarball \ + rootfs-initrd-tarball \ + shim-v2-tarball -cloud-hypervisor: - $(call BUILD,$@) +%-tarball-build: + $(call BUILD,$*) -firecracker: - $(call BUILD,$@) +cloud-hypervisor-tarball: + ${MAKE} $@-build -kernel: - $(call BUILD,$@) +firecracker-tarball: + ${MAKE} $@-build -qemu: - $(call BUILD,$@) +kernel-tarball: + ${MAKE} $@-build -rootfs-image: - $(call BUILD,$@) +qemu-tarball: + ${MAKE} $@-build -rootfs-initrd: - $(call BUILD,$@) +rootfs-image-tarball: + ${MAKE} $@-build -shim-v2: - $(call BUILD,$@) +rootfs-initrd-tarball: + ${MAKE} $@-build + +shim-v2-tarball: + ${MAKE} $@-build merge-builds: $(MK_DIR)/kata-deploy-merge-builds.sh build -install: +install-tarball: tar -xvf ./kata-static.tar.xz -C /