Compare commits

..

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

View file

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