Skip to content

Build Kata OS for amd64 #22

Build Kata OS for amd64

Build Kata OS for amd64 #22

Workflow file for this run

name: Build Kata OS for amd64
run-name: Build Kata OS for amd64
on: [push]
env:
KERNEL_VERSION: 6.8
jobs:
build:
strategy:
matrix:
runner: [ubuntu-latest, arm-8core-linux]
include:
- runner: ubuntu-latest
arch: amd64
- runner: arm-8core-linux
arch: arm64
runs-on: ${{ matrix.runner }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libelf-dev flex bison
- name: Build Ubuntu image ${{ matrix.arch }}
run: cd tools/osbuilder && sudo make USE_DOCKER=true image-ubuntu
- name: Build Kernel ${{ env.KERNEL_VERSION }}
run: |
cd tools/packaging/kernel
sudo ./build-kernel.sh -v $KERNEL_VERSION setup
sudo ./build-kernel.sh -v $KERNEL_VERSION build
- name: Bundle artifacts
run: |
cp tools/packaging/kernel/kata-linux-*/vmlinux /tmp/vmlinux
cp tools/osbuilder/kata-containers-image-ubuntu.img /tmp/kata-containers-image-ubuntu.img
cp sbom.json /tmp/sbom.json
zip -j artifacts.zip /tmp/vmlinux /tmp/kata-containers-image-ubuntu.img /tmp/sbom.json
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.arch }}
path: artifacts.zip
retention-days: 1
release:
runs-on: ubuntu-latest
needs: build
# Only create a release when a new tag is created
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Download artifacts amd64
uses: actions/download-artifact@v4
with:
name: artifacts-amd64
- name: Download artifacts arm64
uses: actions/download-artifact@v4
with:
name: artifacts-arm64
- name: 'Create New Release'
env:
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN}}
run: |
RELEASE_VERSION=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')
echo "Creating release $RELEASE_VERSION"
gh release create ${RELEASE_VERSION} -t ${RELEASE_VERSION} --draft
gh release upload "${RELEASE_VERSION}" artifacts-amd64.zip
gh release upload "${RELEASE_VERSION}" artifacts-arm64.zip
gh release edit ${RELEASE_VERSION} --verify-tag --draft=false