wip: fix workflow
Some checks failed
Build Zenyx ⚡ / 🔧 Setup Environment (pull_request) Successful in 3m26s
Build Zenyx ⚡ / 🏗️ Build x86_64-unknown-linux-gnu (pull_request) Failing after 3s
Build Zenyx ⚡ / 🏗️ Build x86_64-pc-windows-msvc (pull_request) Failing after 3s
Build Zenyx ⚡ / 🏗️ Build aarch64-unknown-linux-gnu (pull_request) Failing after 3s
Build Zenyx ⚡ / 🔧 Setup Environment (push) Successful in 3m17s
Build Zenyx ⚡ / 🏗️ Build aarch64-unknown-linux-gnu (push) Failing after 4s
Build Zenyx ⚡ / 🏗️ Build x86_64-unknown-linux-gnu (push) Failing after 3s
Build Zenyx ⚡ / 🏗️ Build x86_64-pc-windows-msvc (push) Failing after 3s
Some checks failed
Build Zenyx ⚡ / 🔧 Setup Environment (pull_request) Successful in 3m26s
Build Zenyx ⚡ / 🏗️ Build x86_64-unknown-linux-gnu (pull_request) Failing after 3s
Build Zenyx ⚡ / 🏗️ Build x86_64-pc-windows-msvc (pull_request) Failing after 3s
Build Zenyx ⚡ / 🏗️ Build aarch64-unknown-linux-gnu (pull_request) Failing after 3s
Build Zenyx ⚡ / 🔧 Setup Environment (push) Successful in 3m17s
Build Zenyx ⚡ / 🏗️ Build aarch64-unknown-linux-gnu (push) Failing after 4s
Build Zenyx ⚡ / 🏗️ Build x86_64-unknown-linux-gnu (push) Failing after 3s
Build Zenyx ⚡ / 🏗️ Build x86_64-pc-windows-msvc (push) Failing after 3s
This commit is contained in:
parent
6815a113cc
commit
2f5d523663
1 changed files with 36 additions and 24 deletions
|
@ -14,15 +14,6 @@ jobs:
|
|||
- 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/bin
|
||||
/tmp/zig
|
||||
key: tools-v1-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: 🦀 Install Rust toolchain
|
||||
uses: https://github.com/actions-rs/toolchain@v1
|
||||
with:
|
||||
|
@ -30,13 +21,28 @@ jobs:
|
|||
components: rust-src
|
||||
override: true
|
||||
|
||||
- name: 📦 Install Zig and cargo-zigbuild
|
||||
- name: 🗄️ Cache tools
|
||||
uses: https://github.com/actions/cache@v4
|
||||
id: cache-tools
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin
|
||||
/tmp/zig
|
||||
/tmp/xwin
|
||||
key: tools-v2-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: 🔧 Install build tools
|
||||
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
|
||||
mkdir -p /tmp/zig /tmp/xwin
|
||||
# Install cargo-binstall
|
||||
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||
# Install cross-compilation tools
|
||||
cargo binstall -y cargo-zigbuild cargo-xwin
|
||||
# Install Zig
|
||||
curl -L https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz | tar -xJ -C /tmp/zig --strip-components=1
|
||||
# Install Xwin
|
||||
cargo xwin --version >/dev/null 2>&1
|
||||
|
||||
build:
|
||||
name: 🏗️ Build ${{ matrix.target }}
|
||||
|
@ -64,23 +70,24 @@ jobs:
|
|||
- name: 📥 Checkout source
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: 🗄️ Restore tool cache
|
||||
- name: 🛠️ Restore tool cache
|
||||
uses: https://github.com/actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin
|
||||
/tmp/zig
|
||||
key: tools-v1-${{ hashFiles('**/Cargo.lock') }}
|
||||
/tmp/xwin
|
||||
key: tools-v2-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: 📍 Add Zig to PATH
|
||||
run: echo "/tmp/zig" >> $GITHUB_PATH
|
||||
- name: 📍 Add tools to PATH
|
||||
run: |
|
||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
echo "/tmp/zig" >> $GITHUB_PATH
|
||||
|
||||
- name: 🎯 Install Rust target
|
||||
uses: https://github.com/actions-rs/toolchain@v1
|
||||
- name: 🎯 Install Rust target (actions-rs)
|
||||
uses: https://github.com/actions-rs/install@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: ${{ matrix.target }}
|
||||
override: true
|
||||
|
||||
- name: 🗄️ Restore Cargo cache
|
||||
uses: https://github.com/actions/cache@v4
|
||||
|
@ -93,8 +100,13 @@ jobs:
|
|||
restore-keys: |
|
||||
cargo-${{ matrix.target }}-
|
||||
|
||||
- name: 🚀 Build release binary
|
||||
run: cargo zigbuild --target ${{ matrix.target }} --release
|
||||
- name: 🚀 Build project
|
||||
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