-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
appveyor.yml
119 lines (109 loc) · 5.22 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
branches:
only:
- master
configuration:
- Debug
- Release
image: Visual Studio 2017
skip_branch_with_pr: true
# Taken from https://boblokerse.github.io/2015/11/03/GitVersion-versioning-made-easy-and-dry/
install:
- ver
- set
- ps: get-childitem c:\tools\nunit3 -rec | where {!$_.PSIsContainer} | select-object FullName
- ps: choco install -y -r --no-progress resharper-clt.portable
- ps: choco install -y -r --no-progress fxcop
- ps: choco install -y -r --no-progress InnoSetup
- ps: |
function gitVersion() {
$env:newhash=git rev-parse HEAD
$env:shorthash=git rev-parse --short HEAD
If ($env:APPVEYOR_REPO_TAG -eq $TRUE) {
$env:newVersion="$env:APPVEYOR_REPO_TAG_NAME.$env:APPVEYOR_BUILD_NUMBER"
$env:appveyor_info_version="$env:APPVEYOR_REPO_TAG_NAME"
} Else {
$gitVersion=git describe --tags --abbrev=0 $env:APPVEYOR_REPO_BRANCH
$env:newVersion="$gitVersion.$env:APPVEYOR_BUILD_NUMBER"
$env:appveyor_info_version="$env:newVersion-$env:APPVEYOR_REPO_BRANCH"
}
$env:appveyor_build_version="$env:newVersion"
appveyor UpdateBuild -Version "$env:newVersion"
$regex = [regex]"AssemblyGitVersion\(.*\)"
Get-ChildItem $env.APPVEYOR_BUILD_FOLDER AssemblyInfo.* -recurse | Foreach-Object {
$c = ($_ | Get-Content)
$c = [regex]::replace($c -join "`r`n", $regex,"AssemblyGitVersion(`"$env:APPVEYOR_REPO_COMMIT`")")
$c | Set-Content $_.FullName
}
write-host "Using hash for build version: $env:newhash"
write-host "Update appveyor build version to: $env:appveyor_build_version"
write-host "Update appveyor info version to: $env:appveyor_info_version"
}
gitVersion
- ps: |
(Get-Content Buttplug.Components.Controls\ButtplugTabControl.xaml.cs).replace('SENTRY_API_URL', $env:sentry_api_url) | Set-Content Buttplug.Components.Controls\ButtplugTabControl.xaml.cs
# patch the assembly version, but only in our own directories
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: $(appveyor_build_version)
assembly_file_version: $(appveyor_build_version)
assembly_informational_version: $(appveyor_info_version)
# Patch <PackageVersion> in new .csproj files
dotnet_csproj:
patch: true
file: '**\*.csproj'
package_version: $(appveyor_info_version)
# Automatically register private account and/or project AppVeyor NuGet feeds.
nuget:
account_feed: true
project_feed: true
disable_publish_on_pr: true
before_build:
- nuget restore
build:
parallel: true
project: Buttplug.sln
publish_nuget: true
after_build:
- cmd: InspectCode.exe -o=resharper-clt-output.xml --project=Buttplug* Buttplug.sln
- ps: $result = [xml](Get-Content .\resharper-clt-output.xml)
- ps: $result.Report.Issues.ChildNodes | ForEach-Object {$project = $_.Name; $_.ChildNodes | ForEach-Object {Add-AppveyorCompilationMessage -Message $_.Message -Line $_.Line -FileName $_.File -ProjectName $project}}
test_script:
- ps: .\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -returntargetcode -register:user -target:"$env:SYSTEMDRIVE\Tools\NUnit3\nunit3-console.exe" -targetargs:"Buttplug.Server.Test\bin\$env:CONFIGURATION\Buttplug.Server.Test.dll Buttplug.Client.Test\bin\$env:CONFIGURATION\Buttplug.Client.Test.dll Buttplug.Apps.WebsocketServerGUI.Test\bin\$env:CONFIGURATION\Buttplug.Apps.WebsocketServerGUI.Test.dll Buttplug.Apps.KiirooEmulatorGUI.Test\bin\$env:CONFIGURATION\Buttplug.Apps.KiirooEmulatorGUI.Test.dll --workers=1 --inprocess --result=myresults.xml;format=AppVeyor" -output:"coverage.xml" -excludebyfile:"*\*LibLog.cs"
after_test:
- ps: |
If (($env:CONFIGURATION -imatch "Debug")) {
$env:PATH = 'C:\msys64\usr\bin;' + $env:PATH
Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh
bash codecov.sh -f "coverage.xml" -X gcov
}
- ps: set PATH=%PATH%;"C:\\Program Files (x86)\\Inno Setup 5"
- ps: iscc buttplug-installer.iss
- ps: installer\buttplug-installer.exe /VERYSILENT
# Test currently doesn't work, possibly because installer is blocked by access control dialog?
#- ps: test\check-registry.ps1
- ps: Push-AppveyorArtifact installer\buttplug-installer.exe -FileName Buttplug-$env:CONFIGURATION-$env:APPVEYOR_BUILD_VERSION-installer.exe
cache:
- packages -> **\packages.config
# Cache chocolatey packages
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
environment:
sentry_api_url:
secure: grqYfjT9kMwONAdl/iwYcI7NOEd8ounzFFehZIWX3I3y1oiIa7F4GrZJKNqWcucEhyyn9SpAnXiheKAJU/kl0nFT7QUlnXplEE9c/krbWDEy0mSMy5DaFv1+MijZ5hjm
deploy:
- provider: NuGet
api_key:
secure: gn49bOGMzEX8u7NhonO6w2eoaPZD/q+paTZ+pz9dnYftw3jHhnqr449ym11xkJu3
skip_symbols: true
artifact: /.*\.nupkg/
on:
branch: master
configuration: release
appveyor_repo_provider: github
appveyor_repo_name: metafetish/buttplug-csharp
notifications:
- provider: Slack
auth_token:
secure: niT02PuMtJmQsNxJo6dfdlU6X3gBzyPsFsskTSGHFDgkRL2IRj6iBzjTGhF1mM9x
channel: '#buttplug'