From 10096380cb9b5e9121deca993ebfa552de551828 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Thu, 6 Jun 2024 20:08:56 +0200 Subject: [PATCH] Improved Rust setup & customized Tauri bundle per platform --- .github/workflows/build-and-release.yml | 43 ++++++------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index bddfb41c..954653cf 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -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')