From fc90bb53145ccc8839d2c5f8d25446ba631d9774 Mon Sep 17 00:00:00 2001 From: Carlos Venegas Date: Tue, 29 Jun 2021 14:54:46 +0000 Subject: [PATCH] Actions: Add new workflow to create static tarballs Tarballs are generated on push and merge events. push: Allows get a tarball from the PR and use locally. merge: After a PR is merged we have a quick way to get latest kata-tarball. The tarball can be downloaded from github page only. Fixes: #1710 Signed-off-by: Carlos Venegas --- .github/workflows/kata-deploy-push.yaml | 58 +++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/kata-deploy-push.yaml diff --git a/.github/workflows/kata-deploy-push.yaml b/.github/workflows/kata-deploy-push.yaml new file mode 100644 index 0000000000..ed3d29b66f --- /dev/null +++ b/.github/workflows/kata-deploy-push.yaml @@ -0,0 +1,58 @@ +name: kata-deploy-build + +on: push + +jobs: + build-asset: + runs-on: ubuntu-latest + strategy: + matrix: + asset: + - kernel + - shim-v2 + - qemu + - cloud-hypervisor + - firecracker + - rootfs-image + - rootfs-initrd + steps: + - uses: actions/checkout@v2 + - name: Install docker + run: | + curl -fsSL https://test.docker.com -o test-docker.sh + sh test-docker.sh + + - name: Build ${{ matrix.asset }} + run: | + ./tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh --build="${KATA_ASSET}" + build_dir=$(readlink -f build) + # store-artifact does not work with symlink + sudo cp -r --preserve=all "${build_dir}" "kata-build" + env: + KATA_ASSET: ${{ matrix.asset }} + + - name: store-artifact ${{ matrix.asset }} + uses: actions/upload-artifact@v2 + with: + name: kata-artifacts + path: kata-build/kata-static-${{ matrix.asset }}.tar.xz + if-no-files-found: error + + create-kata-tarball: + runs-on: ubuntu-latest + needs: build-asset + steps: + - uses: actions/checkout@v2 + - name: get-artifacts + uses: actions/download-artifact@v2 + with: + name: kata-artifacts + path: kata-artifacts + - name: merge-artifacts + run: | + ./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts + - name: store-artifacts + uses: actions/upload-artifact@v2 + with: + name: kata-static-tarball + path: kata-static.tar.xz