mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-20 11:28:42 +00:00
Otherwise we'll face the following error as part of our GHA: ``` The workflow is not valid. kata-containers/kata-containers/.github/workflows/release-$foo.yaml (Line: 13, Col: 14): Invalid input, stage is not defined in the referenced workflow. ``` Fixes: #7497 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
110 lines
3.1 KiB
YAML
110 lines
3.1 KiB
YAML
name: CI | Build kata-static tarball for amd64
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
stage:
|
|
required: false
|
|
type: string
|
|
default: test
|
|
tarball-suffix:
|
|
required: false
|
|
type: string
|
|
push-to-registry:
|
|
required: false
|
|
type: string
|
|
default: no
|
|
commit-hash:
|
|
required: false
|
|
type: string
|
|
|
|
jobs:
|
|
build-asset:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
asset:
|
|
- cloud-hypervisor
|
|
- cloud-hypervisor-glibc
|
|
- firecracker
|
|
- kernel
|
|
- kernel-sev
|
|
- kernel-dragonball-experimental
|
|
- kernel-tdx-experimental
|
|
- kernel-nvidia-gpu
|
|
- kernel-nvidia-gpu-snp
|
|
- kernel-nvidia-gpu-tdx-experimental
|
|
- nydus
|
|
- ovmf
|
|
- ovmf-sev
|
|
- qemu
|
|
- qemu-snp-experimental
|
|
- qemu-tdx-experimental
|
|
- rootfs-image
|
|
- rootfs-image-tdx
|
|
- rootfs-initrd
|
|
- rootfs-initrd-mariner
|
|
- rootfs-initrd-sev
|
|
- shim-v2
|
|
- tdvf
|
|
- virtiofsd
|
|
stage:
|
|
- ${{ inputs.stage }}
|
|
exclude:
|
|
- asset: cloud-hypervisor-glibc
|
|
stage: "release"
|
|
steps:
|
|
- name: Login to Kata Containers quay.io
|
|
if: ${{ inputs.push-to-registry == 'yes' }}
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: quay.io
|
|
username: ${{ secrets.QUAY_DEPLOYER_USERNAME }}
|
|
password: ${{ secrets.QUAY_DEPLOYER_PASSWORD }}
|
|
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
ref: ${{ inputs.commit-hash }}
|
|
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
|
|
|
- name: Build ${{ matrix.asset }}
|
|
run: |
|
|
make "${KATA_ASSET}-tarball"
|
|
build_dir=$(readlink -f build)
|
|
# store-artifact does not work with symlink
|
|
sudo cp -r "${build_dir}" "kata-build"
|
|
env:
|
|
KATA_ASSET: ${{ matrix.asset }}
|
|
TAR_OUTPUT: ${{ matrix.asset }}.tar.gz
|
|
PUSH_TO_REGISTRY: ${{ inputs.push-to-registry }}
|
|
|
|
- name: store-artifact ${{ matrix.asset }}
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: kata-artifacts-amd64${{ inputs.tarball-suffix }}
|
|
path: kata-build/kata-static-${{ matrix.asset }}.tar.xz
|
|
retention-days: 1
|
|
if-no-files-found: error
|
|
|
|
create-kata-tarball:
|
|
runs-on: ubuntu-latest
|
|
needs: build-asset
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
ref: ${{ inputs.commit-hash }}
|
|
- name: get-artifacts
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: kata-artifacts-amd64${{ inputs.tarball-suffix }}
|
|
path: kata-artifacts
|
|
- name: merge-artifacts
|
|
run: |
|
|
./tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh kata-artifacts versions.yaml
|
|
- name: store-artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: kata-static-tarball-amd64${{ inputs.tarball-suffix }}
|
|
path: kata-static.tar.xz
|
|
retention-days: 1
|
|
if-no-files-found: error
|