-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
118 lines (97 loc) · 3.53 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
version: 1.0.{build}
configuration: Release
image:
- Visual Studio 2022
environment:
IGNORE_NORMALISATION_GIT_HEAD_MOVE: 1
GitHubOrganisation: MRCollective
GitEmail: [email protected]
GitName: MRCollective CI
GitHubToken:
secure: 7TOde4ZxLAF5UEnxhnOr8u8KE8z8Fe1UDCnTpsWVX6YntHxBSao6Gi+gjMPccwH2
services: mssql2019
branches:
only:
# PR builds are triggered via webhook
- master
cache:
- '%LocalAppData%\NuGet\Cache' # NuGet < v3
- '%LocalAppData%\NuGet\v3-cache' # NuGet v3
- C:\ProgramData\chocolatey\lib -> appveyor.yml
- C:\ProgramData\chocolatey\bin -> appveyor.yml
#init:
#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
before_build:
- ps: >-
& nuget restore
& GitVersion /output buildserver /updateassemblyinfo
If (Test-Path ".\PreBuild.ps1") {
Write-Host "Executing PreBuild.ps1"
& ".\PreBuild.ps1"
} else {
Write-Host "No PreBuild.ps1 found"
}
build:
parallel: true
verbosity: minimal
after_build:
- ps: >-
Get-ChildItem -Recurse *.nuspec | foreach { nuget pack $_.FullName -Properties "Configuration=Release;Platform=AnyCPU" -Symbols -SymbolPackageFormat snupkg -Version $Env:GitVersion_NuGetVersion }
$currentTag = git tag -l --points-at HEAD
$HTTP_Request = [System.Net.WebRequest]::Create("https://api.github.com/repos/$env:GitHubOrganisation/$env:APPVEYOR_PROJECT_NAME/releases/tags/$Env:GitVersion_NuGetVersion")
$HTTP_Request.UserAgent = "Powershell"
try {
$HTTP_Request.GetResponse()
} catch [Net.WebException] {
[System.Net.HttpWebResponse] $resp = [System.Net.HttpWebResponse] $_.Exception.Response
if ($currentTag -And $resp.StatusCode -eq 404 -And (-Not $env:APPVEYOR_PULL_REQUEST_TITLE)) {
$env:SHOULD_DEPLOY = 'true'
}
}
if (Test-Path "docfx.json") {
choco install docfx -y
& docfx docfx.json
}
test:
assemblies:
only:
- '**\*.*Tests.dll'
artifacts:
- path: '*.nupkg'
- path: '*.snupkg'
- path: '**\*.vsix'
- path: _site
deploy:
- provider: NuGet
api_key:
secure: VHLPzzX6q7AQhNZEkRwpnaX49ADEWyRe16ggQKFJt263041v9fm3TSmoIeDHVrP0
on:
SHOULD_DEPLOY: true
after_deploy:
- ps: >-
npm install github-release-notes -g
$currentTag = git tag -l --points-at HEAD
gren release --token=$env:GitHubToken --tags=$currentTag
if (Test-Path ".\_site") {
git clone https://github.com/$env:GitHubOrganisation/$env:APPVEYOR_PROJECT_NAME.git -b gh-pages documentation_upload -q
Copy-Item documentation_upload/.git _site -recurse
cd _site
git config user.email $env:GitEmail
git config user.name $env:GitName
git config core.autocrlf false
git config --global credential.helper store
Add-Content "$HOME\.git-credentials" "https://$($env:GitHubToken):[email protected]`n" -NoNewline
$hasEditsToTrackedFilesOrHasUntrackedFiles = !([string]::IsNullOrEmpty($(git status --porcelain)))
if ($hasEditsToTrackedFilesOrHasUntrackedFiles) {
git add -A 2>&1
git commit -m "$Env:GitVersion_NuGetVersion"
git push origin gh-pages
}
}
notifications:
- provider: GitHubPullRequest
on_build_success: true
on_build_failure: true
on_build_status_changed: false
on_finish:
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))