-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
86 lines (69 loc) · 3.11 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
84
85
86
image: Visual Studio 2017
version: 1.0.{build}
environment:
SONAR_TOKEN:
secure: 7erJjZzqC/gHB5rNZ1aC/CDpHjrlnDT9rQX+CB7A30h5F34LB4jcibonoE7PvsYs
GITHUB_ACCESS_TOKEN:
secure: uj8259rTzhBmAdk/WjTMFBW69/ic/W4fC2OxxVxKDYnqTdzM7x4BYumGK5zvxfip
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: oPEFasghVkAHw/ker+25fhtJlcGrxFfesrXq2oCyHHEAzMy5HnGssvL1JZaFU0/J/pgAClBW5/WEIu0I4QEbqrawnVsicRTZmMAx7F28ro0=
channel: '#build-opensource'
install:
# compute version
- ps: . .\build\ComputeVersion.ps1
- ps: $version = Compute "Alm\Alm.csproj" $env:APPVEYOR_BUILD_NUMBER $env:APPVEYOR_REPO_TAG $env:APPVEYOR_PULL_REQUEST_NUMBER
- ps: Update-AppveyorBuild -Version $version.Semver
- choco install "msbuild-sonarqube-runner" -y
- choco install opencover.portable
- choco install codecov
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '{version}'
package_version: '{version}'
before_build:
- dotnet restore
- cmd: >-
IF "%APPVEYOR_PULL_REQUEST_NUMBER%"=="" (
C:\ProgramData\chocolatey\lib\msbuild-sonarqube-runner\tools\MSBuild.SonarQube.Runner.exe begin /k:"Alm" /d:"sonar.analysis.mode=publish" /d:"sonar.host.url=https://sonarcloud.io" /d:"sonar.organization=rducom-github" /d:"sonar.login=%SONAR_TOKEN%"
) ELSE (
C:\ProgramData\chocolatey\lib\msbuild-sonarqube-runner\tools\MSBuild.SonarQube.Runner.exe begin /k:"Alm" /d:"sonar.analysis.mode=preview" /d:"sonar.host.url=https://sonarcloud.io" /d:"sonar.organization=rducom-github" /d:"sonar.login=%SONAR_TOKEN%" /d:"sonar.github.pullRequest=%APPVEYOR_PULL_REQUEST_NUMBER%" /d:"sonar.github.repository=rducom/ALM" /d:"sonar.github.oauth=%GITHUB_ACCESS_TOKEN%"
)
build_script:
- ps: msbuild "C:\projects\alm\Alm.sln" /m /verbosity:minimal /property:$("VersionPrefix="+$version.Prefix+";VersionSuffix="+$version.Suffix) /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
after_build:
- cmd: >-
"C:\ProgramData\chocolatey\lib\msbuild-sonarqube-runner\tools\MSBuild.SonarQube.Runner.exe" end /d:"sonar.login=%SONAR_TOKEN%"
- ps: dotnet pack Alm\Alm.csproj --configuration Release /p:PackageVersion=$env:APPVEYOR_BUILD_VERSION -o artifacts
test_script:
- OpenCover.Console.exe -returntargetcode -oldstyle -register:user -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test /p:DebugType=full -c Debug .\Alm.Test\Alm.Test.csproj" -filter:"+[Alm*]* -[Alm.Test*]*" -excludebyattribute:"*.ExcludeFromCodeCoverage*" -output:coverage-opencover.xml
- codecov -f coverage-opencover.xml
artifacts:
- path: Alm\artifacts\*.nupkg
name: lib
deploy:
- provider: NuGet
api_key:
secure: pI7g9o0ov/i6LAUL4sOH9WsVniseBdJE4GRFlpXicLn6zJWCNPsamsi+/qgAqCFn
skip_symbols: true
artifact: /.*\.nupkg/
on:
branch: master
deploy_public: true
- provider: NuGet
server: https://ci.appveyor.com/nuget/raph-r95r21ggl8dg
api_key:
secure: JmWl2yOQSj9MLgHSmA1tHywqEsMktEO7PvKR+roJvRg=
skip_symbols: false
artifact: /.*\.nupkg/
on:
deploy_unstable: true