From 25b99dec06be8b2f47c7cd3eff7ffeda42575089 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 3 Jan 2021 12:44:40 -0600 Subject: add flags to publish script --- bin/publish | 75 ++++++++++++++++++++++++++----------------------------------- 1 file changed, 32 insertions(+), 43 deletions(-) (limited to 'bin') 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 -- cgit v1.2.3