#!/bin/sh # Builds self-contained copies of the logger and the recorder for one runtime # id into one folder, dist/nonemm-, 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 }" 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