diff --git a/README.md b/README.md index 36cbf90..3d4f947 100644 --- a/README.md +++ b/README.md @@ -50,13 +50,19 @@ audio devices into one Opus file. See [docs/recorder.md](docs/recorder.md). Build the Windows copy on any machine that has the .NET 10 SDK: ```sh -./publish-windows.sh # writes dist/nonemm-win-x64/ and dist/nonemm-win-x64.zip +./publish-windows.sh # dist/nonemm-win-x64.zip +./publish-linux.sh # dist/nonemm-linux-x64.tar.gz ``` +Each archive holds the logger (`Nonemm.App`) and the recorder +(`nonemm-recorder`) as two programs in one folder. Both scripts call +`publish.sh`, which takes any runtime id, for example `./publish.sh win-arm64`. + On Windows itself, run this from PowerShell instead: ```powershell dotnet publish src\Nonemm.App -c Release -r win-x64 --self-contained -o dist\nonemm-win-x64 +dotnet publish src\Nonemm.Recorder.App -c Release -r win-x64 --self-contained -o dist\nonemm-win-x64 ``` The result needs no .NET install. Unzip it anywhere you can write to and run diff --git a/publish-linux.sh b/publish-linux.sh new file mode 100755 index 0000000..3959c34 --- /dev/null +++ b/publish-linux.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# Linux x64 by default; pass another runtime id such as linux-arm64. +exec "$(dirname "$0")/publish.sh" "${1:-linux-x64}" diff --git a/publish-windows.sh b/publish-windows.sh index 24b56e6..27eceab 100755 --- a/publish-windows.sh +++ b/publish-windows.sh @@ -1,15 +1,3 @@ #!/bin/sh -# Builds a self-contained Windows x64 copy in dist/nonemm-win-x64 and zips it. -# The target machine needs no .NET install. Pass another runtime id as the -# first argument, for example win-arm64 (the bridge and XMMT.ocx are 32 bit -# x86 either way). -rid="${1:-win-x64}" -cd "$(dirname "$0")" || exit 1 -out="dist/nonemm-$rid" -rm -rf "$out" -./build.sh publish src/Nonemm.App -c Release -r "$rid" --self-contained -o "$out" || exit 1 -rm -f "$out"/*.pdb -rm -f "dist/nonemm-$rid.zip" -python3 -c 'import shutil, sys; shutil.make_archive(sys.argv[1], "zip", "dist", sys.argv[2])' \ - "dist/nonemm-$rid" "nonemm-$rid" || exit 1 -echo "dist/nonemm-$rid.zip" +# Windows x64 by default; pass another runtime id such as win-arm64. +exec "$(dirname "$0")/publish.sh" "${1:-win-x64}" diff --git a/publish.sh b/publish.sh new file mode 100755 index 0000000..a85d084 --- /dev/null +++ b/publish.sh @@ -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-, 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