aboutsummaryrefslogtreecommitdiffstats
path: root/bin/publish
blob: 6e53ae90d6b802acf3b1e3e3f6a4ecd7fe000adb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
set -e

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 '$runtime$'\n'
rm -rf dist/$runtime/*
dotnet publish \
    --configuration Release \
    -p:PublishSingleFile=true \
    -p:ReadyToRun=true \
    -p:PublishTrimmed=true \
    -p:IncludeNativeLibrariesForSelfExtract=true \
    -p:CopyOutputSymbolsToPublishDirectory=false \
    --self-contained \
    --runtime $runtime \
    --output ../../dist/$runtime

echo $'\npublish succeeded.'