Compare commits

..

No commits in common. "971aad5414a83d32a2c103e69711d0e017be375a" and "cb91bde7f8545793699e374618447f85c5b5d0f0" have entirely different histories.

View file

@ -1,88 +1,75 @@
name: Build Zenyx ⚡
name: Build Zenyx ⚡
on:
on:
push:
pull_request:
jobs:
setup:
name: 🔧 Setup Environment
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.cache-tools.outputs.cache-hit }}
steps:
- name: 📥 Checkout source
uses: https://github.com/actions/checkout@v4
- name: 🗄️ Cache tools
uses: https://github.com/actions/cache@v4
id: cache-tools
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: tools-v1-${{ hashFiles('**/Cargo.lock') }}
- name: 🦀 Install Rust toolchain
uses: https://github.com/actions-rs/toolchain@v1
with:
toolchain: stable
components: rust-src
override: true
jobs:
build:
name: 🏗️ Build ${{ matrix.target }}
needs: setup
name: Build ${{ matrix.target }}
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
image: messense/cargo-zigbuild:latest
container: messense/cargo-zigbuild:latest
binary_name: zenyx-x86_64-linux
ext: ""
- target: aarch64-unknown-linux-gnu
image: messense/cargo-zigbuild:latest
container: messense/cargo-zigbuild:latest
binary_name: zenyx-aarch64-linux
ext: ""
- target: universal2-apple-darwin
container: messense/cargo-zigbuild:latest
binary_name: zenyx-universal-macos
ext: ""
- target: x86_64-pc-windows-msvc
image: messense/cargo-xwin:latest
container: messense/cargo-xwin:latest
binary_name: zenyx-x86_64-windows-msvc.exe
ext: ".exe"
container: ${{ matrix.image }}
steps:
- name: Ensure nodejs
run: |
apt-get -y install nodejs
- name: 📥 Checkout source
uses: https://github.com/actions/checkout@v4
- name: 🗄️ Restore Cargo cache
- name: 🧩 Restore Cargo cache
uses: https://github.com/actions/cache@v4
with:
path: |
/usr/local/cargo/registry
/usr/local/cargo/git
target
key: cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-${{ matrix.target }}-
${{ runner.os }}-cargo-${{ matrix.target }}-
- name: 🚀 Build release binary
- name: 🦀 Install macOS targets
if: matrix.target == 'universal2-apple-darwin'
uses: https://github.com/actions-rs/toolchain@v1
with:
target: x86_64-apple-darwin,aarch64-apple-darwin
- name: 🚀 Build project
run: |
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
cargo xwin build --target ${{ matrix.target }} --release
else
cargo zigbuild --target ${{ matrix.target }} --release
fi
if: matrix.target != 'x86_64-pc-windows-msvc'
- name: 🚀 Build Windows project
run: |
cargo xwin build --target ${{ matrix.target }} --release
if: matrix.target == 'x86_64-pc-windows-msvc'
- name: 📦 Package artifact
run: |
mkdir -p artifacts
cp target/${{ matrix.target }}/release/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}
run: mkdir -p artifacts && cp target/${{ matrix.target }}/release/zenyx${{ matrix.ext }} artifacts/${{ matrix.binary_name }}
- name: ⬆️ Upload artifact
uses: https://code.forgejo.org/forgejo/upload-artifact@v4