Skip to content

Commit

Permalink
GitHub Actions: Add macOS builds
Browse files Browse the repository at this point in the history
  • Loading branch information
fruhland committed May 21, 2024
1 parent 6846234 commit abdd3b1
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 4 deletions.
82 changes: 78 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ name: build
on: [push]

jobs:
build:
build-on-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

- 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
Expand Down Expand Up @@ -43,4 +43,78 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: D3OS
path: d3os.img
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
8 changes: 8 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ]
Expand Down

0 comments on commit abdd3b1

Please sign in to comment.