forked from dn-vm/dnvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.sh
More file actions
executable file
·48 lines (38 loc) · 838 Bytes
/
publish.sh
File metadata and controls
executable file
·48 lines (38 loc) · 838 Bytes
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
#!/bin/bash
set -e
set -u
usage() { echo "Usage: $0 [-r RID]" 1>&2; exit 1; }
rid=
while getopts ":r:" o; do
case "${o}" in
r)
rid=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [[ $# -gt 0 ]]; then
usage
fi
cd "$(dirname "$0")"
dotnet tool restore
version=$(dotnet gitversion /showvariable semver)
if [[ -z "${rid}" ]]; then
if [[ $(uname) == 'Darwin' ]]; then
osname='osx'
else
osname='linux'
fi
name=$(uname -m)
if [[ $name == 'arm64' || $name == 'aarch64' ]]; then
arch='arm64'
else
arch='x64'
fi
rid=$osname-$arch
fi
dotnet publish --sc -r $rid -c Release src/dnvm/dnvm.csproj
tar -C ./artifacts/publish/dnvm/release_$rid/ -cvzf ./artifacts/dnvm-$version-$rid.tar.gz dnvm