Compare commits
1 commit
abc3a54084
...
339c9ee2c2
Author | SHA1 | Date | |
---|---|---|---|
339c9ee2c2 |
1 changed files with 23 additions and 35 deletions
|
@ -14,13 +14,6 @@ jobs:
|
||||||
- name: 📥 Checkout source
|
- name: 📥 Checkout source
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
|
||||||
- name: 🦀 Install Rust toolchain
|
|
||||||
uses: https://github.com/actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
components: rust-src
|
|
||||||
override: true
|
|
||||||
|
|
||||||
- name: 🗄️ Cache tools
|
- name: 🗄️ Cache tools
|
||||||
uses: https://github.com/actions/cache@v4
|
uses: https://github.com/actions/cache@v4
|
||||||
id: cache-tools
|
id: cache-tools
|
||||||
|
@ -28,21 +21,22 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/bin
|
~/.cargo/bin
|
||||||
/tmp/zig
|
/tmp/zig
|
||||||
/tmp/xwin
|
key: tools-v1-${{ hashFiles('**/Cargo.lock') }}
|
||||||
key: tools-v2-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: 🔧 Install build tools
|
- name: 🦀 Install Rust toolchain
|
||||||
|
uses: https://github.com/actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
components: rust-src
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: 📦 Install Zig and cargo-zigbuild
|
||||||
if: steps.cache-tools.outputs.cache-hit != 'true'
|
if: steps.cache-tools.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /tmp/zig /tmp/xwin
|
mkdir -p /tmp/zig
|
||||||
# Install cargo-binstall
|
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 --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
curl -L 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 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:
|
build:
|
||||||
name: 🏗️ Build ${{ matrix.target }}
|
name: 🏗️ Build ${{ matrix.target }}
|
||||||
|
@ -70,24 +64,23 @@ jobs:
|
||||||
- name: 📥 Checkout source
|
- name: 📥 Checkout source
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
|
||||||
- name: 🛠️ Restore tool cache
|
- name: 🗄️ Restore tool cache
|
||||||
uses: https://github.com/actions/cache@v4
|
uses: https://github.com/actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/bin
|
~/.cargo/bin
|
||||||
/tmp/zig
|
/tmp/zig
|
||||||
/tmp/xwin
|
key: tools-v1-${{ hashFiles('**/Cargo.lock') }}
|
||||||
key: tools-v2-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: 📍 Add tools to PATH
|
- name: 📍 Add Zig to PATH
|
||||||
run: |
|
run: echo "/tmp/zig" >> $GITHUB_PATH
|
||||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
||||||
echo "/tmp/zig" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: 🎯 Install Rust target (actions-rs)
|
- name: 🎯 Install Rust target
|
||||||
uses: https://github.com/actions-rs/install@v1
|
uses: https://github.com/actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
toolchain: stable
|
||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
|
override: true
|
||||||
|
|
||||||
- name: 🗄️ Restore Cargo cache
|
- name: 🗄️ Restore Cargo cache
|
||||||
uses: https://github.com/actions/cache@v4
|
uses: https://github.com/actions/cache@v4
|
||||||
|
@ -100,13 +93,8 @@ jobs:
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
cargo-${{ matrix.target }}-
|
cargo-${{ matrix.target }}-
|
||||||
|
|
||||||
- name: 🚀 Build project
|
- name: 🚀 Build release binary
|
||||||
run: |
|
run: cargo zigbuild --target ${{ matrix.target }} --release
|
||||||
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
|
|
||||||
cargo xwin build --target ${{ matrix.target }} --release
|
|
||||||
else
|
|
||||||
cargo zigbuild --target ${{ matrix.target }} --release
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: 📦 Package artifact
|
- name: 📦 Package artifact
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue