From 1df685119d866cb9e483c59b93d3159c9be60fbe Mon Sep 17 00:00:00 2001
From: Marcello Lamonaca <marcello@lamonaca.eu>
Date: Tue, 26 Apr 2022 21:54:10 +0200
Subject: [PATCH] Update publish script

---
 dotnet-publish.ps1 | 26 ++++++++++++++++++++++++++
 publish-win.ps1    |  1 -
 2 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 dotnet-publish.ps1
 delete mode 100644 publish-win.ps1

diff --git a/dotnet-publish.ps1 b/dotnet-publish.ps1
new file mode 100644
index 0000000..43860c0
--- /dev/null
+++ b/dotnet-publish.ps1
@@ -0,0 +1,26 @@
+function Get-Runtime
+{
+    if($isLinux)
+    {
+        return "linux-x64";
+    }
+
+    if($isMac)
+    {
+        return "osx-x64";
+    }
+
+    if($isWindows)
+    {
+        return "win-x64";
+    }
+
+    return $null;
+}
+
+$runtime = Get-Runtime;
+
+if($runtime -ne $null)
+{
+    dotnet publish -o out -c Release --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=true -f net6.0 -r $runtime .\src\
+}
\ No newline at end of file
diff --git a/publish-win.ps1 b/publish-win.ps1
deleted file mode 100644
index 5fbf40c..0000000
--- a/publish-win.ps1
+++ /dev/null
@@ -1 +0,0 @@
-dotnet publish -o out -c Release --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=true -f net6.0 -r win-x64 .\src\
\ No newline at end of file