Added linux arm64

This commit is contained in:
Thorsten Sommer 2024-06-08 23:09:43 +02:00
parent 9fad467e66
commit 530ffa0bd8
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -3,8 +3,8 @@ on:
push push
jobs: jobs:
build: build_main:
name: Build app name: Build app (Windows [x86, arm64], macOS [arm64, x86], Linux [x86])
strategy: strategy:
fail-fast: true fail-fast: true
@ -15,33 +15,25 @@ jobs:
dotnet_runtime: 'osx-arm64' dotnet_runtime: 'osx-arm64'
dotnet_name_postfix: '-aarch64-apple-darwin' dotnet_name_postfix: '-aarch64-apple-darwin'
tauri_bundle: 'dmg' tauri_bundle: 'dmg'
- platform: 'macos-latest' # for Intel-based macOS - platform: 'macos-latest' # for Intel-based macOS
rust_target: 'x86_64-apple-darwin' rust_target: 'x86_64-apple-darwin'
dotnet_runtime: 'osx-x64' dotnet_runtime: 'osx-x64'
dotnet_name_postfix: '-x86_64-apple-darwin' dotnet_name_postfix: '-x86_64-apple-darwin'
tauri_bundle: 'dmg' tauri_bundle: 'dmg'
- platform: 'ubuntu-22.04' # for x86-based linux - platform: 'ubuntu-22.04' # for x86-based linux
rust_target: 'x86_64-unknown-linux-gnu' rust_target: 'x86_64-unknown-linux-gnu'
dotnet_runtime: 'linux-x64' dotnet_runtime: 'linux-x64'
dotnet_name_postfix: '-x86_64-unknown-linux-gnu' dotnet_name_postfix: '-x86_64-unknown-linux-gnu'
tauri_bundle: 'appimage deb' tauri_bundle: 'appimage deb'
#
# Issue https://github.com/twistedfall/opencv-rust/issues/457
#
# - platform: 'ubuntu-22.04' # for ARM-based linux
# 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 - platform: 'windows-latest' # for x86-based windows
rust_target: 'x86_64-pc-windows-msvc' rust_target: 'x86_64-pc-windows-msvc'
dotnet_runtime: 'win-x64' dotnet_runtime: 'win-x64'
dotnet_name_postfix: '-x86_64-pc-windows-msvc.exe' dotnet_name_postfix: '-x86_64-pc-windows-msvc.exe'
tauri_bundle: 'msi nsis' tauri_bundle: 'msi nsis'
- platform: 'windows-latest' # for ARM-based windows - platform: 'windows-latest' # for ARM-based windows
rust_target: 'aarch64-pc-windows-msvc' rust_target: 'aarch64-pc-windows-msvc'
dotnet_runtime: 'win-arm64' dotnet_runtime: 'win-arm64'
@ -115,8 +107,8 @@ jobs:
with: with:
targets: ${{ matrix.rust_target }} targets: ${{ matrix.rust_target }}
- name: Setup dependencies (Ubuntu-specific) - name: Setup dependencies (Ubuntu-specific, x86)
if: matrix.platform == 'ubuntu-22.04' if: matrix.platform == 'ubuntu-22.04' && contains(matrix.rust_target, 'x86_64')
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
@ -187,4 +179,87 @@ jobs:
name: MindWork AI Studio (Linux - AppImage ${{ matrix.dotnet_runtime }}) name: MindWork AI Studio (Linux - AppImage ${{ matrix.dotnet_runtime }})
path: "runtime/target/${{ matrix.rust_target }}/release/bundle/appimage/mind-work-ai-studio_*.AppImage" path: "runtime/target/${{ matrix.rust_target }}/release/bundle/appimage/mind-work-ai-studio_*.AppImage"
if-no-files-found: error if-no-files-found: error
retention-days: 1
build_linux_arm64:
name: Build app (Linux [arm64])
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true # Enable Git LFS
- uses: pguyot/arm-runner-action@v2.6.5
with:
base_image: dietpi:rpi_armv8_bullseye
cpu: cortex-a53
image_additional_mb: 5000 # ~ 5GB
optimize_image: false
commands: |
# Rust complains (rightly) that $HOME doesn't match eid home:
export HOME=/root
# Workaround to CI worker being stuck on Updating crates.io index:
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
# Update and upgrade the system:
apt-get update --yes --allow-releaseinfo-change
apt-get upgrade --yes
apt-get autoremove --yes
apt-get install curl wget apt-transport-https --yes
export DEBIAN_FRONTEND=noninteractive
export TZ=Europe/Berlin
#
# Install .NET SDK:
#
# Note: We cannot use the official Microsoft package because it's not available for ARM64.
#
# Install the dependencies:
apt-get install --yes --no-install-recommends ca-certificates libc6 libgcc-s1 libgssapi-krb5-2 libicu69 libssl1.1 libstdc++6 zlib1g
# Download and install the .NET SDK:
# wget --no-verbose https://download.visualstudio.microsoft.com/download/pr/cd9decc0-f3ef-46d6-b7d1-348b757781ad/9ad92a8f4b805feb3d017731e78eca15/dotnet-sdk-8.0.301-linux-arm64.tar.gz -O dotnet-sdk.tar.gz
# mkdir -p /usr/share/dotnet
# tar -zxf dotnet-sdk.tar.gz -C /usr/share/dotnet
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --channel 8.0
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
export DOTNET_CLI_TELEMETRY_OPTOUT=true
# Compile the app:
cd "app/MindWork AI Studio"
dotnet publish --configuration release --runtime linux-arm --disable-build-servers --force --output ../../publish/dotnet
# Move & rename the .NET artifact:
cd ../..
mkdir -p "app/MindWork AI Studio/bin/dist"
cd publish/dotnet
mv mindworkAIStudio "../../app/MindWork AI Studio/bin/dist/mindworkAIStudio-aarch64-unknown-linux-gnu"
# Install Rust:
cd ../..
curl https://sh.rustup.rs -sSf | sh -s -- --yes
. "$HOME/.cargo/env"
# Install build tools and tauri-cli requirements:
apt-get install --yes libwebkit2gtk-4.0-dev build-essential libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
# Setup Tauri:
cargo install tauri-cli
# Build the runtime:
cd runtime
cargo tauri build --target aarch64-unknown-linux-gnu --bundles deb
- name: Upload artifact (Linux - Debian Package)
uses: actions/upload-artifact@v4
with:
name: MindWork AI Studio (Linux - deb linux-arm)
path: "${{ github.workspace }}/runtime/target/aarch64-unknown-linux-gnu/release/bundle/deb/mind-work-ai-studio_*.deb"
if-no-files-found: error
retention-days: 1 retention-days: 1