-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
83 lines (68 loc) · 3.15 KB
/
appveyor.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
image: Visual Studio 2019
version: 2.0.{build}
environment:
global:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
SONAR_TOKEN:
secure: KKNmFA7NIQUu011Wk8PK9bOqcqEDzf6aF24udDieJcsQSPJsAjUegGPwzRkejUMt
GITHUB_ACCESS_TOKEN:
secure: 4mw9uwMEkmIPucv0Aa6cziU8QdwKEzRCqOf2HWFRVdheolRbZJN4zWnnZjW+W0dL
branches:
only:
- master
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true
configuration: Release
platform: Any CPU
notifications:
- provider: Slack
auth_token:
secure: Y3i58yrHTt57qU64K8VsB06JMBZr7+9I44tYOd3oyWKnR+vpDilZKpiblJgwM2jHUQ88DzmBaeYzQIS9cA00oaamvT+zc/XizDsL7QBbisE=
channel: '#build-opensource'
install:
# Get last commit tag to compute version
- ps: wget "https://raw.githubusercontent.com/rducom/ALM/master/build/ComputeVersion.ps1" -outfile "ComputeVersion.ps1"
- ps: . .\ComputeVersion.ps1
- ps: $version = Compute "NExtends\NExtends.csproj" $env:APPVEYOR_BUILD_NUMBER $env:APPVEYOR_REPO_TAG $env:APPVEYOR_PULL_REQUEST_NUMBER
- ps: Update-AppveyorBuild -Version $version.Semver
- dotnet tool install --global dotnet-sonarscanner
- dotnet tool install --global dotnet-reportgenerator-globaltool
- dotnet tool install --global Codecov.Tool
before_build:
- dotnet restore
- cmd: >-
IF "%APPVEYOR_PULL_REQUEST_NUMBER%"=="" (
dotnet sonarscanner begin /k:"NExtends" /d:"sonar.host.url=https://sonarcloud.io" /o:lucca /d:"sonar.login=%SONAR_TOKEN%" /d:sonar.coverageReportPaths="./sonarCoverage/SonarQube.xml"
) ELSE (
dotnet sonarscanner begin /k:"NExtends" /d:"sonar.host.url=https://sonarcloud.io" /o:lucca /d:"sonar.login=%SONAR_TOKEN%" /d:sonar.coverageReportPaths="./sonarCoverage/SonarQube.xml" /d:"sonar.github.oauth=%GITHUB_ACCESS_TOKEN%" /d:"sonar.pullrequest.provider=github" /d:"sonar.pullrequest.branch=%APPVEYOR_REPO_BRANCH%" /d:"sonar.pullrequest.key=%APPVEYOR_PULL_REQUEST_NUMBER%" /d:"sonar.pullrequest.github.repository=LuccaSA/NExtends" /d:"sonar.pullrequest.github.endpoint=https://api.github.com"
)
build_script:
- ps: dotnet build NExtends.sln -c Debug -v minimal
test_script:
- dotnet test -f netcoreapp3.1 /p:DebugType=full -c Debug --collect:"XPlat Code Coverage" --settings coverlet.runsettings --results-directory:./coverage
- reportgenerator -reports:./coverage/*/*.xml -targetdir:./sonarCoverage -reporttypes:SonarQube
- dotnet sonarscanner end /d:"sonar.login=%SONAR_TOKEN%"
- codecov -f "coverage/**/*.xml"
after_test:
- ps: dotnet pack NExtends\NExtends.csproj --configuration Release /p:$("VersionPrefix="+$version.Prefix+";VersionSuffix="+$version.Suffix) /p:SourceLinkEnabled=true /p:PackageVersion=$env:APPVEYOR_BUILD_VERSION -o artifacts
artifacts:
- path: NExtends\artifacts\*.nupkg
name: lib
deploy:
- provider: NuGet
api_key:
secure: jANUk7TMziSU9RtEKxrH0Del6HL33yPNS00LJN2AxpnRRHzysT80IH20mjmilYbA
skip_symbols: true
artifact: /.*\.nupkg/
on:
branch: master
deploy_public: true
- provider: NuGet
server: https://ci.appveyor.com/nuget/luccaintegration-uvk5yq2c460b
api_key:
secure: shmMXUHQLw1te1msoPnFzFFxFEo2lLWF4wriUUAwOaY=
skip_symbols: false
artifact: /.*\.nupkg/
on:
deploy_unstable: true