Publish the logger and the recorder in one archive

publish.sh takes a runtime id and publishes both programs into
dist/nonemm-<rid>, which holds the runtime and the Avalonia files once.
The archive is a zip for Windows and a tar.gz for the rest.
publish-windows.sh and publish-linux.sh call it with their default id.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 23:57:47 +00:00
co-authored by Claude Sonnet 5.5
parent c01032a2cc
commit 0e5aa3238b
4 changed files with 44 additions and 15 deletions
Executable
+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh
# Builds self-contained copies of the logger and the recorder for one runtime
# id into one folder, dist/nonemm-<rid>, and archives it: a zip for Windows, a
# tar.gz for the rest. The two programs share the runtime and the Avalonia
# files, so the second publish only adds what the first lacks. The target
# machine needs no .NET install. Use publish-windows.sh or publish-linux.sh, or
# pass the runtime id, for example win-arm64 (the bridge and XMMT.ocx are 32
# bit x86 either way).
rid="${1:?usage: publish.sh <runtime id>}"
cd "$(dirname "$0")" || exit 1
name="nonemm-$rid"
out="dist/$name"
mkdir -p dist
rm -rf "$out"
for project in Nonemm.App Nonemm.Recorder.App; do
./build.sh publish "src/$project" -c Release -r "$rid" --self-contained -o "$out" || exit 1
done
rm -f "$out"/*.pdb
case "$rid" in
win-*)
rm -f "dist/$name.zip"
python3 -c 'import shutil, sys; shutil.make_archive(sys.argv[1], "zip", "dist", sys.argv[2])' \
"$out" "$name" || exit 1
echo "dist/$name.zip"
;;
*)
tar -C dist -czf "dist/$name.tar.gz" "$name" || exit 1
echo "dist/$name.tar.gz"
;;
esac