Moved .NET compilation to the x86 host and using cross-compilation

This commit is contained in:
Thorsten Sommer 2024-06-09 10:03:00 +02:00
parent 8ae50e055a
commit 1fe9e88a8d
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -190,7 +190,26 @@ jobs:
with:
lfs: true # Enable Git LFS
- name: Run ARM runner
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8'
dotnet-quality: 'ga'
cache: true
cache-dependency-path: 'app/MindWork AI Studio/packages.lock.json'
- name: Build .NET project
run: |
cd "app/MindWork AI Studio"
dotnet publish --configuration release --runtime linux-arm --disable-build-servers --force --output ../../publish/dotnet
- name: Move & rename the .NET artifact
run: |
mkdir -p "app/MindWork AI Studio/bin/dist"
cd publish/dotnet
mv mindworkAIStudio "../../app/MindWork AI Studio/bin/dist/mindworkAIStudio-aarch64-unknown-linux-gnu"
- name: Run ARM runner for compiling Rust (runtime)
uses: pguyot/arm-runner-action@v2.6.5
id: arm-runner
with:
@ -210,44 +229,9 @@ jobs:
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:
#export CLR_ICU_VERSION_OVERRIDE=$(dpkg-query -W -f='${Version}' libicu* | awk -F'-' '{print $1}')
#echo "CLR_ICU_VERSION_OVERRIDE is set to: $CLR_ICU_VERSION_OVERRIDE"
apt-get install --yes --no-install-recommends ca-certificates libc6 libgcc-s1 libgssapi-krb5-2 libicu67 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"
apt-get install curl wget --yes
# Install Rust:
cd ../..
curl https://sh.rustup.rs -sSf | sh -s -- --yes
. "$HOME/.cargo/env"