-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-linux.sh
More file actions
31 lines (26 loc) · 802 Bytes
/
build-linux.sh
File metadata and controls
31 lines (26 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Build ConsoleImage AOT for Linux
# Run this on the target Linux machine
set -e
echo "Building ConsoleImage for Linux..."
# Ensure .NET 10 SDK is installed
if ! command -v dotnet &> /dev/null; then
echo "Installing .NET 10 SDK..."
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --channel 10.0
export PATH="$HOME/.dotnet:$PATH"
fi
# Build AOT
cd "$(dirname "$0")"
dotnet publish ConsoleImage/ConsoleImage.csproj \
-c Release \
-r linux-x64 \
--self-contained \
-p:PublishAot=true \
-o ./publish-linux-x64
# Show result
ls -lh ./publish-linux-x64/consoleimage
echo ""
echo "Binary ready at: ./publish-linux-x64/consoleimage"
echo "Test with: ./publish-linux-x64/consoleimage --help"