From ad59a9e83aa1ab2ffb9d6b743402c34d725ee9f5 Mon Sep 17 00:00:00 2001 From: Ryan Mast Date: Mon, 10 Nov 2025 12:37:35 -0800 Subject: [PATCH] add ci workflow to build on linux x86_64 and aarch64 Builds qemu-static userspace binaries for x86_64 and aarch64 Linux. For releases, uploads the built artifacts to the release. Signed-off-by: Ryan Mast --- .github/workflows/build.yml | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..416c11ce --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,49 @@ +name: Build QEMU Static Binaries + +on: + workflow_dispatch: + push: + branches: [ master, main ] + pull_request: + branches: [ master, main ] + release: + types: [created] + +jobs: + build: + strategy: + matrix: + include: + - name: x86_64 + runs-on: ubuntu-latest + - name: aarch64 + runs-on: ubuntu-24.04-arm + runs-on: ${{ matrix.runs-on }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx (for multi-arch) + uses: docker/setup-buildx-action@v3 + + - name: Build Docker image + run: | + docker build --tag qemu . + + - name: Run container and copy artifacts + run: | + mkdir -p artifact + docker run --cidfile=qemu.cid qemu true + docker cp "$(cat qemu.cid):/work/artifact/." artifact/. + + - name: Upload QEMU binaries + uses: actions/upload-artifact@v4 + with: + name: qemu-static-binaries-${{ matrix.name }} + path: artifact/* + + - name: Upload binaries to GitHub Release + if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + files: artifact/*