-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·24 lines (18 loc) · 947 Bytes
/
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
#! /usr/bin/env bash
if [ -z "$BUILD_SOURCEBRANCH" ]
then
echo "Initialising local branch state"
BUILD_SOURCEBRANCH=`git branch --show-current`
fi
set -euox pipefail
dotnet --version
## Generate Version Information
dotnet tool restore
export $(dotnet tool run octoversion --CurrentBranch=${BUILD_SOURCEBRANCH} --OutputFormats:0=Environment | grep -v '^\[' | xargs)
versionFlags="/P:Version=${OCTOVERSION_NuGetVersion} /P:InformationalVersion=${OCTOVERSION_InformationalVersion}"
## Run the Build
dotnet build --configuration Release $versionFlags
dotnet test --no-build --configuration Release $versionFlags --collect:"XPlat Code Coverage" --logger 'trx' --logger 'console;verbosity=normal'
dotnet pack -o PublishOutput --configuration Release $versionFlags
## Pack up the code coverage results
dotnet reportgenerator -reports:**/TestResults/**/coverage.cobertura.xml -targetdir:CoverageReport -reporttypes:HtmlInline_AzurePipelines