forked from gitextensions/gitextensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
161 lines (144 loc) · 6.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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
version: 3.2.0.{build}
os: Visual Studio 2017
branches:
except:
- configdata
- gh-pages
environment:
matrix:
- IdeVersion: VS2017
SKIP_PAUSE: TRUE
ARCHIVE_WITH_PDB: TRUE
spciuser: ""
init:
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# Build settings, not to be confused with "before_build" and "after_build".
# "project" is relative to the original build directory and not influenced by directory changes in "before_build".
build:
# enable MSBuild parallel builds
parallel: true
# MSBuild verbosity level
verbosity: minimal
cache:
#- packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified
- packages\WiX.3.11.0 -> Setup\packages.config
install:
- cmd: git submodule update --init --recursive
- cmd: echo /logger:"%ProgramFiles%\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll">> Directory.Build.rsp
- cmd: |-
cd Setup
C:\\Python35\\python set_version_to.py -v %APPVEYOR_BUILD_VERSION% -t %APPVEYOR_BUILD_VERSION%
cd ..
# to run your custom scripts instead of automatic MSBuild
build_script:
- ps: |
Write-Output "Platform: $env:IdeVersion"
# for release branches mark the repo as clean
if (!$env:APPVEYOR_PULL_REQUEST_TITLE -and $env:APPVEYOR_REPO_BRANCH.StartsWith("release/")) {
& Setup\Mark-RepoClean.ps1
}
# build
& Setup\Build.cmd
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
# to run your custom scripts instead of automatic tests
test_script:
- ps: |
$testAssemblies = (Get-ChildItem -Path UnitTests -Filter '*Tests.dll' -Recurse -Exclude 'ApprovalTests.dll').FullName | Where-Object { $_.Contains('\bin\Release') }
$packageConfig = [xml](Get-Content .nuget\packages.config)
$opencover_version = $packageConfig.SelectSingleNode('/packages/package[@id="OpenCover"]').version
$opencover_console = "packages\OpenCover.$opencover_version\tools\OpenCover.Console.exe"
&$opencover_console `
-register:user `
-returntargetcode `
-hideskipped:All `
-filter:"+[*]* -[FluentAssertions*]* -[SmartFormat*]* -[nunit*]*" `
-excludebyattribute:*.ExcludeFromCodeCoverage* `
-excludebyfile:*\*Designer.cs `
-output:"OpenCover.GitExtensions.xml" `
-target:"nunit3-console.exe" `
-targetargs:"$testAssemblies"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
$codecov_version = $packageConfig.SelectSingleNode('/packages/package[@id="Codecov"]').version
$codecov = "packages\Codecov.$codecov_version\tools\codecov.exe"
&$codecov -f ".\OpenCover.GitExtensions.xml" --flag production
&$codecov -f ".\OpenCover.GitExtensions.xml" --flag tests
# here we are going to override common configuration
for:
# configuration for all branches except release/*
-
branches:
except:
- /release\/.*/
# scripts to run after tests
after_test:
- ps: |
try {
& pwd
& Setup\BuildInstallers.cmd
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
& Setup\Set-Portable.ps1 -IsPortable
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
& Setup\MakePortableArchive.cmd Release $env:APPVEYOR_BUILD_VERSION
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
}
finally {
# -------------------------------
# debugging
# -------------------------------
#Write-Host "[INFO]: GitStatus.txt is to help find dirty status. File should say repo and submodules are clean."
#Write-Host "[INFO]: Update the skip-worktree section in this script to fix CI builds."
#& git status > GitStatus.txt
#& git submodule foreach --recursive git status >> GitStatus.txt
#Push-AppveyorArtifact .\GitStatus.txt
#& tree /F /A > tree.txt
#Push-AppveyorArtifact .\tree.txt
}
artifacts:
# upload the generated portable archive only
- path: 'Setup/GitExtensions-Portable-*.zip'
- path: 'Setup/GitExtensions-pdbs-*.zip'
- path: 'GitExtensionsVSIX/bin/Release/GitExtensionsVSIX.vsix'
# configuration for release branches ONLY
-
branches:
only:
- /release\/.*/
environment:
spciuser:
secure: d/ak/yIuPjpVeWl+gDR0Yl1s8L4AGP+sn46jqGl7EvVZMq0bhzZBFwBCm9JTy0P9
# scripts to run after tests
after_test:
- ps: |
# -------------------------------
# debugging
# -------------------------------
#Write-Host "[INFO]: GitStatus.txt is to help find dirty status. File should say repo and submodules are clean."
#Write-Host "[INFO]: Update the skip-worktree section in this script to fix CI builds."
#& git status > GitStatus.txt
#& git submodule foreach --recursive git status >> GitStatus.txt
#Push-AppveyorArtifact .\GitStatus.txt
# -------------------------------
# build artifacts
# -------------------------------
& Setup\BuildInstallers.cmd
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
& Setup\Set-Portable.ps1 -IsPortable
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
& Setup\MakePortableArchive.cmd Release $env:APPVEYOR_BUILD_VERSION
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
& Setup\Set-Portable.ps1
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
# -------------------------------
# sign artifacts
# -------------------------------
# do sign artifacts for non-release branches
if ($env:APPVEYOR_PULL_REQUEST_TITLE -or !$env:APPVEYOR_REPO_BRANCH.StartsWith("release/")) {
Write-Host "[INFO]: Do not sign non-release branches"
Get-ChildItem .\Setup\GitExtensions-Portable-*.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
Exit-AppVeyorBuild
return
}
Push-AppveyorArtifact .\GitExtensionsVSIX\bin\Release\GitExtensionsVSIX.vsix
# continue on with signing
& Setup\Sign-Artifacts.ps1
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }