forked from ZEXSM/OData.QueryBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
44 lines (44 loc) · 3.37 KB
/
.travis.yml
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
language: csharp
dotnet: 3.1
mono: none
solution: OData.QueryBuilder.sln
env:
global:
- secure: SuKoVIfbXNAQQAQ8FhoK/USbDAJld63DKsBkmqONvUyOm8rBzFPkAfIl0qACKMMVJec7aJ9PhfxBA8nJdh7zCuaw0xcGxnVfQaxtegKo8+yz18LtUDnwv7h2aDDpsL5IdtgNZabusoz0CG0RB2vZEUQCbx80oH41L0Ijcya93ngnVeD4u0PdoFXbqxoBTiadI6qh/Od+jD+6+B04fz2XSa16WSjobSwsYNr5M+CIpa9OmLdZAJkvgHFlshmrAD2oE8iddImB9YIjDqCvnH/jqAP3/Eqci/N5sW5qpgRAyhvRxcI3Gev0wFexN8qMBUB3Iim92hf18s30R9K0Bvbb/Q+HX/VgnIBY8Yy3F68YNQvmga5AoODyuLaqPBe6ptckFp6yPkPBqeQgp1Pu2mySL0tFkjvg6/WWsxLVpco7zCjymF1IDhjVgbeO+rAQ5vEs1Fp89o4mpIAOcP10uM2b3W71fFSWTbKvIyp8ozL8PaTkRq5NiS7NvQ85hE/lVJyCL62vZ1YYOeQb0ArdoCZVdHbZp9L3UAIPYGUW6mJ9PlQtm9RC3hsnBJEvpoBnQl1wx25hhnTt16oif6L8h5XAbgVpW0Bd46LXMQbMXHKFyeMTuH4l94N9HD+qiDh82L95EQk+yHeCmfZqoKE+pf7HuscvHiFLkOxNbtJdPXqF99k=
branches:
only:
- master
before_script:
- dotnet restore
script:
- dotnet build
- dotnet test ./test/OData.QueryBuilder.Test -c $CONFIGURATION -f netcoreapp3.1
after_success:
- cd src/OData.QueryBuilder && dotnet minicover instrument --workdir ../../coverage --parentdir ../ --assemblies test/**/bin/$CONFIGURATION/**/*.dll --sources src/**/*.cs && dotnet minicover reset --workdir ../../coverage && cd ../../
- dotnet test --no-build ./test/OData.QueryBuilder.Test
- cd src/OData.QueryBuilder && dotnet minicover uninstrument --workdir ../../coverage && dotnet minicover report --threshold 90 --workdir ../../coverage && dotnet minicover coverallsreport --threshold 90 --workdir ../../coverage --root-path ../../ --output "coveralls.json" --service-name "travis-ci" --service-job-id $TRAVIS_JOB_ID && cd ../../
before_deploy:
- git checkout origin/master && git fetch && git remote set-url origin https://${GITHUB_OAUTH_TOKEN}@github.com/ZEXSM/OData.QueryBuilder.git
- PR_TITLE=$(git log -1 --pretty='%f')
- LAST_TAG=$(echo $(git describe --tags $(git rev-list --tags --max-count=1)) | cut -d'v' -f 2)
- CURRENT_MAJOR=$(echo $LAST_TAG | cut -d. -f 1)
- CURRENT_MINOR=$(echo $LAST_TAG | cut -d. -f 2)
- CURRENT_PATCH=$(echo $(echo $LAST_TAG | cut -d. -f 3) | cut -d- -f 1)
- RC=$(echo $(echo $LAST_TAG | cut -d. -f 3) | cut -d- -f 2)
- MAJOR=$(([ "$RC" == "rc" ] && echo $CURRENT_MAJOR) || ([ "$(echo $PR_TITLE | grep -oP 'release')" == "release" ] && echo $(($CURRENT_MAJOR+1))) || echo $CURRENT_MAJOR)
- MINOR=$(([ "$RC" == "rc" ] && echo $CURRENT_MINOR) || ([ "$(echo $PR_TITLE | grep -oP 'release')" == "release" ] && echo 0) || ([ "$(echo $PR_TITLE | grep -oP 'feature')" == "feature" ] && echo $(($CURRENT_MINOR+1))) || echo $CURRENT_MINOR)
- PATCH=$(([ "$RC" == "rc" ] && echo $CURRENT_PATCH) || ([ "$(echo $PR_TITLE | grep -oP 'release')" == "release" ] && echo 0) || ([ "$(echo $PR_TITLE | grep -oP 'feature')" == "feature" ] && echo 0) || echo $(($CURRENT_PATCH+1)))
- NEW_TAG=$(echo $MAJOR.$MINOR.$PATCH)
- PACKAGE_VERSION=${NEW_TAG:-$DEFAULT_PACKAGE_VERSION}
- git tag v$PACKAGE_VERSION && git push origin v$PACKAGE_VERSION
- dotnet pack -c $CONFIGURATION -p:PackageVersion=$PACKAGE_VERSION
deploy:
provider: releases
name: v$PACKAGE_VERSION
token: $GITHUB_OAUTH_TOKEN
cleanup: true
repo: ZEXSM/OData.QueryBuilder
on:
branch: master
after_deploy:
- dotnet nuget push ./src/OData.QueryBuilder/bin/Release/OData.QueryBuilder.$PACKAGE_VERSION.nupkg -k $NUGET_API_KEY -s $NUGET_SOURCE