wip: fix workflow
Some checks failed
Build Zenyx ⚡ / 🔧 Setup Environment (push) Successful in 1m27s
Build Zenyx ⚡ / 🏗️ Build aarch64-unknown-linux-gnu (push) Failing after 6s
Build Zenyx ⚡ / 🏗️ Build x86_64-unknown-linux-gnu (push) Failing after 4s
Build Zenyx ⚡ / 🏗️ Build x86_64-pc-windows-msvc (push) Failing after 4s
Some checks failed
Build Zenyx ⚡ / 🔧 Setup Environment (push) Successful in 1m27s
Build Zenyx ⚡ / 🏗️ Build aarch64-unknown-linux-gnu (push) Failing after 6s
Build Zenyx ⚡ / 🏗️ Build x86_64-unknown-linux-gnu (push) Failing after 4s
Build Zenyx ⚡ / 🏗️ Build x86_64-pc-windows-msvc (push) Failing after 4s
This commit is contained in:
parent
6815a113cc
commit
be0980a883
1 changed files with 22 additions and 35 deletions
|
@ -11,6 +11,10 @@ jobs:
|
|||
outputs:
|
||||
cache-hit: ${{ steps.cache-tools.outputs.cache-hit }}
|
||||
steps:
|
||||
- name: 🐤 Install NodeJS
|
||||
uses: https://github.com/actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- name: 📥 Checkout source
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
|
@ -19,8 +23,9 @@ jobs:
|
|||
id: cache-tools
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin
|
||||
/tmp/zig
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: tools-v1-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: 🦀 Install Rust toolchain
|
||||
|
@ -30,14 +35,6 @@ jobs:
|
|||
components: rust-src
|
||||
override: true
|
||||
|
||||
- name: 📦 Install Zig and cargo-zigbuild
|
||||
if: steps.cache-tools.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
mkdir -p /tmp/zig
|
||||
curl -L https://ziglang.org/builds/zig-linux-x86_64-0.11.0.tar.xz | tar -xJ -C /tmp/zig --strip-components=1
|
||||
curl -L https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||
cargo binstall -y cargo-zigbuild
|
||||
|
||||
build:
|
||||
name: 🏗️ Build ${{ matrix.target }}
|
||||
needs: setup
|
||||
|
@ -45,56 +42,46 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
- aarch64-unknown-linux-gnu
|
||||
- x86_64-pc-windows-msvc
|
||||
include:
|
||||
- target: x86_64-unknown-linux-gnu
|
||||
image: messense/cargo-zigbuild:latest
|
||||
binary_name: zenyx-x86_64-linux
|
||||
ext: ""
|
||||
|
||||
- target: aarch64-unknown-linux-gnu
|
||||
image: messense/cargo-zigbuild:latest
|
||||
binary_name: zenyx-aarch64-linux
|
||||
ext: ""
|
||||
|
||||
- target: x86_64-pc-windows-msvc
|
||||
image: messense/cargo-xwin:latest
|
||||
binary_name: zenyx-x86_64-windows-msvc.exe
|
||||
ext: ".exe"
|
||||
|
||||
container: ${{ matrix.image }}
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout source
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: 🗄️ Restore tool cache
|
||||
uses: https://github.com/actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin
|
||||
/tmp/zig
|
||||
key: tools-v1-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: 📍 Add Zig to PATH
|
||||
run: echo "/tmp/zig" >> $GITHUB_PATH
|
||||
|
||||
- name: 🎯 Install Rust target
|
||||
uses: https://github.com/actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: ${{ matrix.target }}
|
||||
override: true
|
||||
|
||||
- name: 🗄️ Restore Cargo cache
|
||||
uses: https://github.com/actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
/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: cargo zigbuild --target ${{ matrix.target }} --release
|
||||
run: |
|
||||
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
|
||||
cargo xwin build --target ${{ matrix.target }} --release
|
||||
else
|
||||
cargo zigbuild --target ${{ matrix.target }} --release
|
||||
fi
|
||||
|
||||
- name: 📦 Package artifact
|
||||
run: |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue