From abdd3b1d8dc285eea6f970f21a41f9708d21402d Mon Sep 17 00:00:00 2001 From: Fabian Ruhland Date: Tue, 21 May 2024 16:41:58 +0200 Subject: [PATCH] GitHub Actions: Add macOS builds --- .github/workflows/build.yml | 82 +++++++++++++++++++++++++++++++++++-- Makefile.toml | 8 ++++ 2 files changed, 86 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a35c781..a4b87da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: build on: [push] jobs: - build: + build-on-linux: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 @@ -10,9 +10,9 @@ jobs: - name: Install packages uses: amitie10g/install-package@v1.2.3 with: - apt: build-essential nasm wget + apt: build-essential nasm - - name: Install Rust for x86-64 Linux + - name: Install Rust for x86_64 Linux uses: actions-rs/toolchain@v1 with: toolchain: nightly @@ -43,4 +43,78 @@ jobs: uses: actions/upload-artifact@v4 with: name: D3OS - path: d3os.img \ No newline at end of file + path: d3os.img + + build-on-intel-mac: + runs-on: macos-12 + steps: + - uses: actions/checkout@v4 + + - name: Install packages + uses: amitie10g/install-package@v1.2.3 + with: + brew: x86_64-elf-binutils nasm + + - name: Install Rust for x86_64 MacOS + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + target: x86_64-apple-darwin + components: rust-src + - name: Install Rust for i686 UEFI + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + target: i686-unknown-uefi + - name: Install Rust for x86_64 UEFI + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + target: x86_64-unknown-uefi + + - name: Install cargo-make + run: cargo install --no-default-features cargo-make + + - name: Install towbootctl + run: cargo install --git https://github.com/hhuOS/towboot --features=binary -Z bindeps towbootctl + + - name: Build + run: cargo make --no-workspace image + + build-on-apple-silicon-mac: + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + + - name: Install packages + uses: amitie10g/install-package@v1.2.3 + with: + brew: x86_64-elf-binutils nasm + + - name: Install Rust for AArch64 MacOS + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + target: aarch64-apple-darwin + components: rust-src + - name: Install Rust for i686 UEFI + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + target: i686-unknown-uefi + - name: Install Rust for x86_64 UEFI + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + target: x86_64-unknown-uefi + + - name: Install cargo-make + run: cargo install --no-default-features cargo-make + + - name: Install towbootctl + run: cargo install --git https://github.com/hhuOS/towboot --features=binary -Z bindeps towbootctl + + - name: Build + run: cargo make --no-workspace image \ No newline at end of file diff --git a/Makefile.toml b/Makefile.toml index 6c9bda0..56c9c39 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -32,6 +32,14 @@ dependencies = [ "image", "ovmf" ] [tasks.qemu.mac] args = [ "-machine", "q35,pcspk-audiodev=audio0", "-m", "128M", "-cpu", "qemu64", "-bios", "RELEASEX64_OVMF.fd", "-boot", "d", "-vga", "std", "-rtc", "base=localtime", "-drive", "driver=raw,node-name=boot,file.driver=file,file.filename=d3os.img", "-audiodev", "id=audio0,driver=coreaudio" ] +[tasks.qemu-no-compile] +command = "qemu-system-x86_64" +args = [ "-machine", "q35,pcspk-audiodev=audio0", "-m", "128M", "-cpu", "qemu64", "-bios", "RELEASEX64_OVMF.fd", "-boot", "d", "-vga", "std", "-rtc", "base=localtime", "-drive", "driver=raw,node-name=boot,file.driver=file,file.filename=d3os.img", "-audiodev", "id=audio0,driver=pa" ] + +[tasks.qemu-no-compile.mac] +args = [ "-machine", "q35,pcspk-audiodev=audio0", "-m", "128M", "-cpu", "qemu64", "-bios", "RELEASEX64_OVMF.fd", "-boot", "d", "-vga", "std", "-rtc", "base=localtime", "-drive", "driver=raw,node-name=boot,file.driver=file,file.filename=d3os.img", "-audiodev", "id=audio0,driver=coreaudio" ] + + [tasks.ovmf] command = "wget" args = [ "-N", "${OVMF_URL}" ]