aboutsummaryrefslogtreecommitdiffstats
path: root/bin/publish
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-01-03 12:44:40 -0600
committerJP Dillingham <jpdillingham@gmail.com>2021-01-03 12:44:40 -0600
commit25b99dec06be8b2f47c7cd3eff7ffeda42575089 (patch)
treea0e14db64d58e9c0d40f779911f7b68db5eb200b /bin/publish
parent3b96db739b69d854c25b06a60f78273e0338a6a8 (diff)
downloadslskd-25b99dec06be8b2f47c7cd3eff7ffeda42575089.tar.gz
add flags to publish script
Diffstat (limited to 'bin/publish')
-rwxr-xr-xbin/publish75
1 files changed, 32 insertions, 43 deletions
diff --git a/bin/publish b/bin/publish
index 1cf592e2..6e53ae90 100755
--- a/bin/publish
+++ b/bin/publish
@@ -1,43 +1,43 @@
#!/bin/bash
set -e
-if [ ! "$1" == "--no-build" ]; then
+build=true
+
+while test $# -gt 0; do
+ case "$1" in
+ --no-build)
+ build=false
+ shift
+ ;;
+ --runtime*)
+ shift
+ runtime=$1
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
+if [ -z "$runtime" ]; then
+ echo "error: no runtime specified; provide a valid RID (https://docs.microsoft.com/en-us/dotnet/core/rid-catalog)"
+ exit 1
+fi
+
+if [ "$build" == true ]; then
echo $'\n> bin/build\n'
bin/build
+else
+ echo $'\n build skipped\n'
fi
cd src/slskd
echo $'\n> pwd\n'
pwd
-echo $'\n> dotnet publish ... --runtime win-x64\n'
-rm -rf dist/win-x64/*
-dotnet publish \
- --configuration Release \
- -p:PublishSingleFile=true \
- -p:ReadyToRun=true \
- -p:PublishTrimmed=true \
- -p:IncludeNativeLibrariesForSelfExtract=true \
- -p:CopyOutputSymbolsToPublishDirectory=false \
- --self-contained \
- --runtime win-x64 \
- --output ../../dist/win-x64
-
-echo $'\n> dotnet publish ... --runtime linux-x64\n'
-rm -rf dist/linux-x64/*
-dotnet publish \
- --configuration Release \
- -p:PublishSingleFile=true \
- -p:ReadyToRun=true \
- -p:PublishTrimmed=true \
- -p:IncludeNativeLibrariesForSelfExtract=true \
- -p:CopyOutputSymbolsToPublishDirectory=false \
- --self-contained \
- --runtime linux-x64 \
- --output ../../dist/linux-x64
-
-echo $'\n> dotnet publish ... --runtime linux-arm\n'
-rm -rf dist/linux-arm/*
+echo $'\n> dotnet publish ... --runtime '$runtime$'\n'
+rm -rf dist/$runtime/*
dotnet publish \
--configuration Release \
-p:PublishSingleFile=true \
@@ -46,18 +46,7 @@ dotnet publish \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:CopyOutputSymbolsToPublishDirectory=false \
--self-contained \
- --runtime linux-arm \
- --output ../../dist/linux-arm
+ --runtime $runtime \
+ --output ../../dist/$runtime
-echo $'\n> dotnet publish ... --runtime osx-x64\n'
-rm -rf dist/osx-x64/*
-dotnet publish \
- --configuration Release \
- -p:PublishSingleFile=true \
- -p:ReadyToRun=true \
- -p:PublishTrimmed=true \
- -p:IncludeNativeLibrariesForSelfExtract=true \
- -p:CopyOutputSymbolsToPublishDirectory=false \
- --self-contained \
- --runtime osx-x64 \
- --output ../../dist/osx-x64 \ No newline at end of file
+echo $'\npublish succeeded.' \ No newline at end of file