-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
39 lines (33 loc) · 1.3 KB
/
build.sh
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
#!/bin/bash
set -e
function cut {
# Workaround for https://github.com/appveyor/ci/issues/1956
/bin/cut $@
}
echo "====================================="
echo " Versioning "
echo "====================================="
DESCRIBE=`git describe --abbrev=7 --first-parent --long --dirty --always`
TAG=`echo $DESCRIBE | cut -d '-' -f 1 | cut -c 2-`
PATCH=`echo $DESCRIBE | cut -d '-' -f 2`
HASH=`echo $DESCRIBE | cut -d '-' -f 3 | cut -c 2-`
VERSION="$TAG.$PATCH"
FULLVERSION="$VERSION-$HASH"
echo "Version: $FULLVERSION"
echo "====================================="
echo " Build "
echo "====================================="
dotnet build ./src/ --configuration Release \
/property:Version=$VERSION \
/property:InformationalVersion=$FULLVERSION
echo "====================================="
echo " Run tests "
echo "====================================="
dotnet test ./src/*.Tests/ --configuration Release \
--no-build
echo "====================================="
echo " Create nuget packet "
echo "====================================="
dotnet pack ./src/ --configuration Release \
--no-build \
/property:PackageVersion=$VERSION