Improved Rust setup & customized Tauri bundle per platform

This commit is contained in:
Thorsten Sommer 2024-06-06 20:08:56 +02:00
parent 6c8d989e17
commit 10096380cb
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -14,16 +14,19 @@ jobs:
rust_target: 'aarch64-apple-darwin'
dotnet_runtime: 'osx-arm64'
dotnet_name_postfix: '-aarch64-apple-darwin'
tauri_bundle: 'dmg'
- platform: 'macos-latest' # for Intel-based macOS
rust_target: 'x86_64-apple-darwin'
dotnet_runtime: 'osx-x64'
dotnet_name_postfix: '-x86_64-apple-darwin'
tauri_bundle: 'dmg'
- platform: 'ubuntu-22.04' # for x86-based linux
rust_target: 'x86_64-unknown-linux-gnu'
dotnet_runtime: 'linux-x64'
dotnet_name_postfix: '-x86_64-unknown-linux-gnu'
tauri_bundle: 'appimage deb'
#
# Issue https://github.com/twistedfall/opencv-rust/issues/457
#
@ -31,16 +34,19 @@ jobs:
# rust_target: 'aarch64-unknown-linux-gnu'
# dotnet_runtime: 'linux-arm64'
# dotnet_name_postfix: '-aarch64-unknown-linux-gnu'
# tauri_bundle: 'appimage deb'
- platform: 'windows-latest' # for x86-based windows
rust_target: 'x86_64-pc-windows-msvc'
dotnet_runtime: 'win-x64'
dotnet_name_postfix: '-x86_64-pc-windows-msvc.exe'
taui_bundle: 'msi nsis'
- platform: 'windows-latest' # for ARM-based windows
rust_target: 'aarch64-pc-windows-msvc'
dotnet_runtime: 'win-arm64'
dotnet_name_postfix: '-aarch64-pc-windows-msvc.exe'
tauri_bundle: 'nsis'
runs-on: ${{ matrix.platform }}
steps:
@ -76,41 +82,10 @@ jobs:
cd publish/dotnet
mv mindworkAIStudio.exe "../../app/MindWork AI Studio/bin/dist/mindworkAIStudio${{ matrix.dotnet_name_postfix }}"
- name: Setup Rust stable (ARM macOS)
if: matrix.platform == 'macos-latest' && matrix.rust_target == 'aarch64-apple-darwin'
- name: Setup Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: 'aarch64-apple-darwin'
- name: Setup Rust stable (Intel macOS)
if: matrix.platform == 'macos-latest' && matrix.rust_target == 'x86_64-apple-darwin'
uses: dtolnay/rust-toolchain@stable
with:
targets: 'x86_64-apple-darwin'
- name: Setup Rust stable (x86 linux)
if: matrix.platform == 'ubuntu-22.04' && matrix.rust_target == 'x86_64-unknown-linux-gnu'
uses: dtolnay/rust-toolchain@stable
with:
targets: 'x86_64-unknown-linux-gnu'
- name: Setup Rust stable (ARM linux)
if: matrix.platform == 'ubuntu-22.04' && matrix.rust_target == 'aarch64-unknown-linux-gnu'
uses: dtolnay/rust-toolchain@stable
with:
targets: 'aarch64-unknown-linux-gnu'
- name: Setup Rust stable (x86 Windows)
if: matrix.platform == 'windows-latest' && matrix.rust_target == 'x86_64-pc-windows-msvc'
uses: dtolnay/rust-toolchain@stable
with:
targets: 'x86_64-pc-windows-msvc'
- name: Setup Rust stable (ARM Windows)
if: matrix.platform == 'windows-latest' && matrix.rust_target == 'aarch64-pc-windows-msvc'
uses: dtolnay/rust-toolchain@stable
with:
targets: 'aarch64-pc-windows-msvc'
targets: ${{ matrix.rust_target }}
- name: Setup dependencies (Ubuntu-specific)
if: matrix.platform == 'ubuntu-22.04'
@ -126,7 +101,7 @@ jobs:
- name: Build Tauri project
run: |
cd runtime
cargo tauri build --target ${{ matrix.rust_target }}
cargo tauri build --target ${{ matrix.rust_target }} --bundle ${{ matrix.tauri_bundle }}
- name: Upload artifact (macOS)
if: startsWith(matrix.platform, 'macos')