2023-04-06 13:13:59 +10:00
|
|
|
name: Build Emulator
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "main" ]
|
2023-04-06 16:02:56 +10:00
|
|
|
paths: ["gb-emu/**", "lib/**", "vendored/**", "Cargo.toml"]
|
2023-04-06 13:13:59 +10:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
2023-04-06 14:32:40 +10:00
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu, macos, windows]
|
2023-04-06 13:13:59 +10:00
|
|
|
|
2023-04-06 14:04:41 +10:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-04-06 14:58:28 +10:00
|
|
|
- run: git submodule update --init --recursive
|
2023-04-06 14:15:05 +10:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
2023-04-06 16:12:34 +10:00
|
|
|
- run: rustup target add aarch64-apple-darwin x86_64-apple-darwin
|
2023-04-06 16:02:56 +10:00
|
|
|
if: ${{ matrix.os == 'macos' }}
|
2023-04-06 14:04:41 +10:00
|
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
2023-04-06 14:44:09 +10:00
|
|
|
if: ${{ matrix.os == 'ubuntu' }}
|
2023-04-06 14:04:41 +10:00
|
|
|
with:
|
|
|
|
packages: libasound2-dev libudev-dev
|
|
|
|
version: 1.0
|
2023-04-06 14:15:05 +10:00
|
|
|
- uses: actions-rs/cargo@v1
|
2023-04-06 16:02:56 +10:00
|
|
|
if: ${{ matrix.os != 'macos' }}
|
2023-04-06 14:15:05 +10:00
|
|
|
with:
|
|
|
|
command: build
|
2023-04-06 14:32:40 +10:00
|
|
|
args: --release
|
2023-04-06 16:02:56 +10:00
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
if: ${{ matrix.os == 'macos' }}
|
|
|
|
with:
|
|
|
|
command: build
|
|
|
|
args: --release --target x86_64-apple-darwin
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
if: ${{ matrix.os == 'macos' }}
|
|
|
|
with:
|
|
|
|
command: build
|
|
|
|
args: --release --target aarch64-apple-darwin
|
2023-04-06 14:32:40 +10:00
|
|
|
- uses: actions/upload-artifact@v3
|
2023-04-06 16:02:56 +10:00
|
|
|
if: ${{ matrix.os == 'ubuntu' }}
|
2023-04-06 14:15:05 +10:00
|
|
|
with:
|
2023-04-06 16:02:56 +10:00
|
|
|
name: gb-emu-linux
|
2023-04-06 14:32:40 +10:00
|
|
|
path: target/release/gb-emu
|
|
|
|
- uses: actions/upload-artifact@v3
|
2023-04-06 14:44:09 +10:00
|
|
|
if: ${{ matrix.os == 'windows' }}
|
2023-04-06 14:15:05 +10:00
|
|
|
with:
|
2023-04-06 16:02:56 +10:00
|
|
|
name: gb-emu-windows
|
|
|
|
path: target/release/gb-emu.exe
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: ${{ matrix.os == 'macos' }}
|
|
|
|
with:
|
|
|
|
name: gb-emu-macos-x86_64
|
|
|
|
path: target/x86_64-apple-darwin/release/gb-emu
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: ${{ matrix.os == 'macos' }}
|
|
|
|
with:
|
|
|
|
name: gb-emu-macos-aarch64
|
|
|
|
path: target/aarch64-apple-darwin/release/gb-emu
|