zenyx-engine/.forgejo/workflows/rust.yml

60 lines
1.7 KiB
YAML

name: Build Zenyx ⚡
on:
push:
pull_request:
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- x86_64-pc-windows-gnu
- aarch64-apple-darwin
include:
- target: x86_64-unknown-linux-gnu
binary_name: zenyx-x86_64-linux
ext: ""
- target: aarch64-unknown-linux-gnu
binary_name: zenyx-aarch64-linux
ext: ""
- target: x86_64-pc-windows-gnu
binary_name: zenyx-x86_64-windows.exe
ext: ".exe"
- target: aarch64-apple-darwin
binary_name: zenyx-aarch64-apple
ext: ""
steps:
- name: 📥 Checkout source
uses: actions/checkout@v4
- name: 🛠️ Install Rust toolchain
uses: https://github.com/actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: 🚀 Build with cross
uses: https://github.com/actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --target ${{ matrix.target }}
- name: 📦 Package artifact
run: |
mkdir -p artifacts
cp target/${{ matrix.target }}/debug/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}
chmod +x artifacts/${{ matrix.binary_name }}
- name: ⬆️ Upload artifact
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with:
name: ${{ matrix.binary_name }}
path: artifacts/${{ matrix.binary_name }}