From 64cbf1fcb35ce2cfba766971f5ff3d36b880715d Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Fri, 10 May 2024 21:51:36 +0200 Subject: [PATCH] Added a cross-platform build script --- app/MindWork AI Studio/build.nu | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 app/MindWork AI Studio/build.nu diff --git a/app/MindWork AI Studio/build.nu b/app/MindWork AI Studio/build.nu new file mode 100755 index 0000000..5928261 --- /dev/null +++ b/app/MindWork AI Studio/build.nu @@ -0,0 +1,29 @@ +#!/usr/bin/env nu + +build + +def build [] { + # Define the list of RIDs to build for, cf. https://learn.microsoft.com/en-us/dotnet/core/rid-catalog: + let rids = ["win-x64", "win-arm64", "linux-x64", "linux-arm64", "osx-arm64", "osx-x64"] + + # Get the current OS: + let current_os = (sys).host.name | str downcase + let current_os = match $current_os { + "windows" => "win-", + "linux" => "linux-", + "darwin" => "osx-", + _ => { + print $"Unsupported OS: ($current_os)" + return + } + } + + # Filter the RIDs to build for the current OS: + let rids = $rids | where $it =~ $current_os + + # Build for each RID: + for rid in $rids { + print $"Start building for ($rid)..." + ^dotnet publish -c release -r $rid + } +} \ No newline at end of file