forked from json-api-dotnet/JsonApiDotNetCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
112 lines (99 loc) · 2.9 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
image:
- Ubuntu
- Visual Studio 2022
version: '{build}'
stack: postgresql 13.4
environment:
PGUSER: postgres
PGPASSWORD: Password12!
GIT_ACCESS_TOKEN:
secure: vw2jhp7V38fTOqphzFgnXtLwHoHRW2zM2K5RJgDAnmkoaIKT6jXLDIfkFdyVz9nJ
branches:
only:
- master
- develop
- unstable
- /release\/.+/
pull_requests:
do_not_increment_build_number: true
nuget:
disable_publish_on_pr: true
matrix:
fast_finish: true
for:
-
matrix:
only:
- image: Visual Studio 2022
services:
- postgresql13
# REF: https://github.com/docascode/docfx-seed/blob/master/appveyor.yml
before_build:
- pwsh: |
if (-Not $env:APPVEYOR_PULL_REQUEST_TITLE) {
# https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html
git checkout $env:APPVEYOR_REPO_BRANCH -q
}
choco install docfx -y
if ($lastexitcode -ne 0) {
throw "docfx install failed with exit code $lastexitcode."
}
after_build:
- pwsh: |
CD ./docs
& ./generate-examples.ps1
& docfx docfx.json
if ($lastexitcode -ne 0) {
throw "docfx build failed with exit code $lastexitcode."
}
# https://www.appveyor.com/docs/how-to/git-push/
git config --global credential.helper store
Set-Content -Path "$HOME\.git-credentials" -Value "https://$($env:GIT_ACCESS_TOKEN):[email protected]`n" -NoNewline
git config --global user.email "[email protected]"
git config --global user.name "json-api-cibuild"
git config --global core.autocrlf false
git config --global core.safecrlf false
git clone https://github.com/json-api-dotnet/JsonApiDotNetCore.git -b gh-pages origin_site -q
Copy-Item origin_site/.git _site -recurse
Copy-Item CNAME _site/CNAME
Copy-Item home/*.html _site/
Copy-Item home/*.ico _site/
Copy-Item -Recurse home/assets/* _site/styles/
CD _site
git add -A 2>&1
git commit -m "Automated commit from cibuild" -q
if (-Not $env:APPVEYOR_PULL_REQUEST_TITLE) {
git push origin gh-pages -q
echo "Documentation updated successfully."
}
artifacts:
- path: .\**\artifacts\**\*.nupkg
name: NuGet
deploy:
- provider: NuGet
skip_symbols: false
api_key:
secure: OBYPCgp3WCuwkDRMuZ9a4QcBdTja/lqlUwZ+Yl5VHqooSJRVTYKP5y15XK0fuHsZ
on:
branch: master
appveyor_repo_tag: true
- provider: NuGet
skip_symbols: false
api_key:
secure: OBYPCgp3WCuwkDRMuZ9a4QcBdTja/lqlUwZ+Yl5VHqooSJRVTYKP5y15XK0fuHsZ
on:
branch: /release\/.+/
appveyor_repo_tag: true
build_script:
- pwsh: |
Write-Output ".NET version:"
dotnet --version
Write-Output "PostgreSQL version:"
if ($IsWindows) {
. "${env:ProgramFiles}\PostgreSQL\13\bin\psql" --version
}
else {
psql --version
}
.\Build.ps1
test: off