Skip to content

Build QEMU

Build QEMU #15

Workflow file for this run

name: Build QEMU
on:
workflow_dispatch:
inputs:
version:
required: false
type: string
default: '8.2.2'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [aarch64, x86_64]
steps:
- name: Install dependencies
run: sudo apt install -y libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build
- name: Cache QEMU source
id: cache
uses: actions/cache@v4
with:
path: qemu-${{ inputs.version }}
key: qemu-${{ inputs.version }}
- name: Download QEMU source
if: steps.cache.outputs.cache-hit != 'true'
run: |
wget --no-verbose https://download.qemu.org/qemu-${{ inputs.version }}.tar.xz
tar -xf qemu-${{ inputs.version }}.tar.xz
- name: Build QEMU
run: |
cd qemu-${{ inputs.version }}
# --disable-gio is required with --static
./configure --static --disable-gio --target-list=${{ matrix.arch }}-softmmu
make -j$(nproc)
- name: Upload QEMU binary
uses: actions/upload-artifact@v4
with:
name: qemu-${{ matrix.arch }}
path: qemu-${{ inputs.version }}/build/qemu-system-${{ matrix.arch }}
release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download QEMU binaries
uses: actions/download-artifact@v4
- name: Publish release
uses: softprops/action-gh-release@v2
with:
prerelease: true
tag_name: qemu-${{ inputs.version }}-${{ github.workflow_sha }}
files: |
qemu-x86_64/qemu-system-x86_64
qemu-aarch64/qemu-system-aarch64