2019-05-15 14:13:57 +02:00
|
|
|
version: 5.0.{build}
|
2016-06-06 15:38:22 +02:00
|
|
|
skip_tags: true
|
2017-04-12 16:10:31 +02:00
|
|
|
image: Visual Studio 2017
|
2015-07-15 11:55:35 +02:00
|
|
|
environment:
|
2018-07-16 17:38:47 +02:00
|
|
|
access_token:
|
|
|
|
|
secure: Eq6BjtZ80BXKLwFMg76IjuQAvbLjbojIF/X/ARouGVhxPneJtgDfCXMPNgJ7KBKq
|
2018-09-24 16:30:59 +02:00
|
|
|
sonar_token:
|
|
|
|
|
secure: W7pHKhuTW6Lh8WlXJNTOIaOzeuxLi+H6Nqmnm4pr28jM6jyIpOZ+1r10lIQi0eCA
|
2018-09-21 16:08:48 +02:00
|
|
|
nuget:
|
|
|
|
|
disable_publish_on_pr: true
|
2016-06-03 14:47:11 +02:00
|
|
|
build_script:
|
|
|
|
|
- dotnet restore
|
2017-10-19 16:37:28 +02:00
|
|
|
- dotnet pack --include-symbols --include-source -c Release src\HtmlSanitizer
|
2016-06-05 22:54:31 +02:00
|
|
|
test_script:
|
2018-09-24 16:30:59 +02:00
|
|
|
- ps: |
|
|
|
|
|
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
|
|
|
|
dotnet tool install --global dotnet-sonarscanner
|
2020-01-24 12:37:32 +01:00
|
|
|
dotnet sonarscanner begin /k:"mganss_HtmlSanitizer" /v:$env:APPVEYOR_BUILD_VERSION /o:"mganss-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:sonar_token" /d:sonar.cs.opencover.reportsPaths="$($env:APPVEYOR_BUILD_FOLDER)\coverage.netcoreapp2.2.xml" /d:sonar.coverage.exclusions="**/Program.cs"
|
2018-09-24 16:30:59 +02:00
|
|
|
dotnet build
|
|
|
|
|
}
|
2020-01-24 12:41:21 +01:00
|
|
|
- dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput="..\..\coverage.xml" test\HtmlSanitizer.Tests\HtmlSanitizer.Tests.csproj -f netcoreapp2.2
|
2018-09-24 16:30:59 +02:00
|
|
|
- ps: |
|
|
|
|
|
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
|
|
|
|
dotnet sonarscanner end /d:sonar.login="$env:sonar_token"
|
|
|
|
|
}
|
2016-06-06 13:17:42 +02:00
|
|
|
- pip install codecov
|
2020-01-24 12:37:32 +01:00
|
|
|
- codecov -f "coverage.netcoreapp2.2.xml"
|
2016-06-03 14:47:11 +02:00
|
|
|
artifacts:
|
2016-06-06 13:34:59 +02:00
|
|
|
- path: 'src\**\*.nupkg'
|
2018-07-16 17:38:47 +02:00
|
|
|
on_success:
|
2018-09-21 16:08:48 +02:00
|
|
|
- ps: |
|
|
|
|
|
if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
|
|
|
|
git config --global credential.helper store
|
|
|
|
|
Add-Content "$HOME\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n"
|
|
|
|
|
git config --global user.email "michael@ganss.org"
|
|
|
|
|
git config --global user.name "Michael Ganss"
|
|
|
|
|
git tag v$env:APPVEYOR_BUILD_VERSION
|
|
|
|
|
git push origin --tags --porcelain
|
|
|
|
|
}
|