forked from nonsensical-dev/zenyx-engine
57 lines
No EOL
1.7 KiB
YAML
57 lines
No EOL
1.7 KiB
YAML
name: Build Zenyx ⚡
|
|
on:
|
|
push:
|
|
pull_request:
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- x86_64-unknown-linux-gnu
|
|
- aarch64-unknown-linux-gnu
|
|
include:
|
|
- target: x86_64-unknown-linux-gnu
|
|
binary_name: zenyx-x86_64
|
|
- target: aarch64-unknown-linux-gnu
|
|
binary_name: zenyx-aarch64
|
|
runs-on: codeberg-small
|
|
steps:
|
|
- name: 📥 Clone repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 🛠️ Install cross-compilation dependencies
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu qemu-user
|
|
|
|
- name: 🔧 Install Rust
|
|
uses: https://github.com/actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
target: ${{ matrix.target }}
|
|
profile: minimal
|
|
|
|
- name: 🏗️ Build
|
|
uses: https://github.com/actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --release --target ${{ matrix.target }}
|
|
env:
|
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
|
|
|
- name: 📦 Prepare binary
|
|
run: |
|
|
mkdir -p artifacts
|
|
cp target/${{ matrix.target }}/release/zenyx artifacts/${{ matrix.binary_name }}
|
|
chmod +x artifacts/${{ matrix.binary_name }}
|
|
|
|
- name: Upload artifacts
|
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.binary_name }}
|
|
path: artifacts/${{ matrix.binary_name }}
|
|
compression-level: 9 |