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

82 lines
2.3 KiB
YAML
Raw Normal View History

name: Build Zenyx ⚡
on:
push:
pull_request:
2025-04-11 13:42:20 -04:00
jobs:
build:
name: Build ${{ matrix.target }}
2025-04-11 16:30:28 -04:00
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
2025-04-11 13:42:20 -04:00
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- x86_64-pc-windows-gnu
2025-04-11 16:07:58 -04:00
# - aarch64-apple-darwin
include:
- target: x86_64-unknown-linux-gnu
binary_name: zenyx-x86_64-linux
2025-04-11 13:42:20 -04:00
ext: ""
- target: aarch64-unknown-linux-gnu
binary_name: zenyx-aarch64-linux
2025-04-11 13:42:20 -04:00
ext: ""
- target: x86_64-pc-windows-gnu
binary_name: zenyx-x86_64-windows.exe
2025-04-11 13:42:20 -04:00
ext: ".exe"
2025-04-11 16:07:58 -04:00
# - target: aarch64-apple-darwin
# binary_name: zenyx-aarch64-apple
# ext: ""
steps:
2025-04-11 13:42:20 -04:00
- name: 📥 Checkout source
uses: actions/checkout@v4
2025-04-11 14:50:34 -04:00
- name: 🐳 Setup Docker-in-Docker
run: |
# Install Docker using the convenience script
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
# Start Docker daemon directly (instead of using service)
2025-04-11 20:17:24 -04:00
sudo dockerd &
2025-04-11 14:50:34 -04:00
# Give the Docker daemon a moment to initialize
sleep 10
# Verify Docker is working
docker info || true
docker --version
2025-04-11 13:42:20 -04:00
- name: 🛠️ Install Rust toolchain
2025-04-11 14:50:34 -04:00
uses: https://github.com/actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
2025-04-11 15:06:35 -04:00
- name: 🧰 Install Cross
run: cargo install cross --locked
2025-04-11 13:42:20 -04:00
- name: 🚀 Build with cross
uses: https://github.com/actions-rs/cargo@v1
2025-04-11 15:47:00 -04:00
env:
2025-04-11 16:07:58 -04:00
CROSS_CONTAINER_IN_CONTAINER : true
with:
2025-04-11 13:42:20 -04:00
use-cross: true
command: build
2025-04-11 13:42:20 -04:00
args: --target ${{ matrix.target }}
- name: 📦 Package artifact
run: |
mkdir -p artifacts
2025-04-11 13:42:20 -04:00
cp target/${{ matrix.target }}/debug/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}
chmod +x artifacts/${{ matrix.binary_name }}
- name: ⬆️ Upload artifact
2025-04-11 13:44:08 -04:00
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with:
name: ${{ matrix.binary_name }}
2025-04-11 15:06:35 -04:00
path: artifacts/${{ matrix.binary_name }}