29 lines
840 B
Bash
29 lines
840 B
Bash
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
|
|
outdir="bin"
|
|
project="SharpCalculator.Avalonia"
|
|
|
|
# Somebody broke dotnet10 sdk .target files
|
|
# To publish self-contained trimmed binary you should add <PublishTrimmed>true</PublishTrimmed> to project file.
|
|
# Command-line option -p:PublishTrimmed=true produces an error.
|
|
# Same with <PublishAot>true</PublishAot> if you want AOT compilation.
|
|
args="
|
|
--self-contained
|
|
--use-current-runtime
|
|
-p:PublishSingleFile=true
|
|
-p:TrimMode=partial
|
|
-p:EnableCompressionInSingleFile=true
|
|
-p:OptimizationPreference=Size
|
|
-p:InvariantGlobalization=true
|
|
-p:DebugType=none
|
|
-p:IncludeNativeLibrariesForSelfExtract=true"
|
|
|
|
rm -rf "$outdir"
|
|
command="dotnet publish $project -c Release -o $outdir $args"
|
|
echo "$command"
|
|
$command
|
|
|
|
find "$outdir" -name '*.pdb' -delete -printf "deleted '%p'\n"
|
|
tree -sh "$outdir"
|