mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-01-31 00:35:19 +01:00
* feat(cli): add RISC-V 64-bit pre-built binary support Add riscv64gc-unknown-linux-gnu target to the tauri-cli release workflow, enabling pre-built binaries for RISC-V 64-bit Linux systems. This eliminates the multi-hour QEMU compilation time that currently blocks RISC-V adoption of Tauri apps. Native compilation on RISC-V hardware takes ~63 minutes. Changes: - Add RISC-V entry to build matrix with self-hosted runner support - Support custom `runs_on` field for matrix entries (falls back to `os`) - Skip dtolnay/rust-toolchain and rust-cache for self-hosted runners - Source ~/.cargo/env for self-hosted runners where Rust is pre-installed Tested on: - Hardware: Banana Pi F3 (RISC-V64, 16GB RAM) - OS: Debian Trixie (required for WebKit2GTK RISC-V support) - Build time: 1h 2m 28s - Binary: ELF 64-bit RISC-V, 16MB stripped * feat(cli): use cross for RISC-V cross-compilation Switch from self-hosted runners to cross-rs for building RISC-V binaries. This approach is simpler and doesn't require maintaining self-hosted infrastructure. Local testing confirms cross builds a valid RISC-V binary in ~4 minutes. * refactor(cli): address review feedback for RISC-V workflow - Skip Rust toolchain and cache setup for cross builds (unnecessary) - Pin cross version to 0.2.5 for reproducibility - Fix Linux dependencies condition to match ubuntu-* variants
123 lines
3.7 KiB
YAML
123 lines
3.7 KiB
YAML
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
name: publish `tauri-cli`
|
|
env:
|
|
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
|
on:
|
|
workflow_dispatch:
|
|
repository_dispatch:
|
|
types: [publish-clirs]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.config.os }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
config:
|
|
- os: ubuntu-22.04
|
|
rust_target: x86_64-unknown-linux-gnu
|
|
ext: ''
|
|
args: ''
|
|
- os: macos-latest
|
|
rust_target: x86_64-apple-darwin
|
|
ext: ''
|
|
args: ''
|
|
- os: macos-latest
|
|
rust_target: aarch64-apple-darwin
|
|
ext: ''
|
|
args: ''
|
|
- os: windows-latest
|
|
rust_target: x86_64-pc-windows-msvc
|
|
ext: '.exe'
|
|
args: ''
|
|
- os: windows-latest
|
|
rust_target: aarch64-pc-windows-msvc
|
|
ext: '.exe'
|
|
args: ''
|
|
- os: ubuntu-22.04
|
|
rust_target: riscv64gc-unknown-linux-gnu
|
|
ext: ''
|
|
args: ''
|
|
cross: true
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: 'Setup Rust'
|
|
if: ${{ !matrix.config.cross }}
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.config.rust_target }}
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
if: ${{ !matrix.config.cross }}
|
|
with:
|
|
key: ${{ matrix.config.rust_target }}
|
|
|
|
- name: install Linux dependencies
|
|
if: ${{ !matrix.config.cross && startsWith(matrix.config.os, 'ubuntu') }}
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libgtk-3-dev
|
|
|
|
- name: Install cross
|
|
if: ${{ matrix.config.cross }}
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: cross@0.2.5
|
|
|
|
- name: Build CLI
|
|
if: ${{ !matrix.config.cross }}
|
|
run: cargo build --manifest-path ./crates/tauri-cli/Cargo.toml --profile release-size-optimized ${{ matrix.config.args }}
|
|
|
|
- name: Build CLI (cross)
|
|
if: ${{ matrix.config.cross }}
|
|
run: cross build --manifest-path ./crates/tauri-cli/Cargo.toml --target ${{ matrix.config.rust_target }} --profile release-size-optimized ${{ matrix.config.args }}
|
|
|
|
- name: Upload CLI
|
|
if: ${{ !matrix.config.cross }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
|
|
path: target/release-size-optimized/cargo-tauri${{ matrix.config.ext }}
|
|
if-no-files-found: error
|
|
|
|
- name: Upload CLI (cross)
|
|
if: ${{ matrix.config.cross }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
|
|
path: target/${{ matrix.config.rust_target }}/release-size-optimized/cargo-tauri${{ matrix.config.ext }}
|
|
if-no-files-found: error
|
|
|
|
upload:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download built CLIs
|
|
uses: actions/download-artifact@v4.1.7
|
|
with:
|
|
path: outputs
|
|
|
|
- name: Pack archives
|
|
run: ./.scripts/ci/pack-cli.sh
|
|
|
|
- name: Get CLI version
|
|
run: echo "CLI_VERSION=$(cat crates/tauri-cli/metadata-v2.json | jq '."cli.js".version' -r)" >> $GITHUB_ENV
|
|
|
|
- name: Publish release
|
|
uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
|
|
with:
|
|
tag_name: tauri-cli-v${{ env.CLI_VERSION }}
|
|
files: |
|
|
outputs/cargo-tauri-*.zip
|
|
outputs/cargo-tauri-*.tgz
|