forked from bluthg/odbc_fdw
-
Notifications
You must be signed in to change notification settings - Fork 22
/
.appveyor.yml
115 lines (106 loc) · 4.03 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
pull_requests:
do_not_increment_build_number: true
os: Visual Studio 2017
configuration: Release
platform: x64
clone_depth: 1
services:
- mysql
- mssql2017
environment:
PGUSER: postgres
PGPASSWORD: Password12!
MYSQL_PWD: Password12!
SQLCMDPASSWORD: Password12!
matrix:
- pg: 11.5-2
PlatformToolset: v140
- pg: 12.0-1
PlatformToolset: v141
- pg: master
PlatformToolset: v141
configuration: Debug
matrix:
allow_failures:
- pg: master
init: # Make %exe% available for caching
- ps: |
if ("$env:PLATFORM" -eq "x64") {
$env:pf = "$env:ProgramFiles"
$env:x64 = "-x64"
} else {
$env:pf = "${env:ProgramFiles(x86)}"
}
$env:exe = "postgresql-$env:pg-windows$env:x64.exe"
[Environment]::SetEnvironmentVariable("exe", $env:exe, "Machine")
install:
- ps: |
# http://www.databasesoup.com/2016/05/changing-postgresql-version-numbering.html
$env:pgversion = $env:pg -replace "\.\d+-\d+$", ""
# [Environment]::SetEnvironmentVariable("pgversion", $env:pgversion, "Machine")
$env:pgroot = "$env:pf\PostgreSQL\$env:pgversion"
if ("$env:pg" -notmatch "\.") {
$env:Path += ";C:\msys64\usr\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64"
git clone -q --depth 1 --branch $env:pg https://git.postgresql.org/git/postgresql.git c:\projects\postgresql
pushd c:\projects\postgresql
perl src\tools\msvc\build.pl
perl src\tools\msvc\install.pl "$env:pgroot"
popd
} else {
if (-not (Test-Path "$env:pgroot\bin")) {
if (-not (Test-Path "$env:exe")) {
Start-FileDownload "http://get.enterprisedb.com/postgresql/$env:exe"
}
& ".\$env:exe" --unattendedmodeui none --mode unattended --superpassword "$env:PGPASSWORD" --servicepassword "$env:PGPASSWORD" | Out-Null
Stop-Service "postgresql$env:x64-$env:pgversion"
}
}
cache:
- '%exe%'
- psqlodbc_x64.msi
build_script:
- msbuild /p:PlatformToolset=%PlatformToolset% /p:configuration=%CONFIGURATION% /p:platform=%PLATFORM%
odbc_fdw.vcxproj
/verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
after_build:
- ps: |
$dll = ($env:PLATFORM -replace "x86", ".") + "\$env:CONFIGURATION\odbc_fdw.dll"
Add-AppveyorMessage Packing -Category Information
New-Item -Name tmp\share\extension -ItemType "directory"
Copy-Item "*.sql" -Destination tmp\share\extension\
Copy-Item "*.control" -Destination tmp\share\extension\
Copy-Item LICENSE -Destination tmp\ODBC_FDW_LICENSE
New-Item -Name tmp\lib -ItemType "directory"
New-Item -Name tmp\debug_symbols -ItemType "directory"
Copy-Item $dll -Destination tmp\lib
Copy-Item ($dll -replace "\.dll", ".pdb") -Destination tmp\debug_symbols
if ($env:APPVEYOR_REPO_TAG -eq "false") {
$env:APPVEYOR_REPO_TAG_NAME=${env:APPVEYOR_REPO_COMMIT}.SubString(0,8)
}
$zip = "odbc_fdw-$env:APPVEYOR_REPO_TAG_NAME-pg$env:pgversion-windows-$env:PLATFORM.zip"
Compress-Archive -Path ".\tmp\*" -DestinationPath $zip
test_script:
- ps: |
$env:path += ";$env:pgroot\bin"
Add-AppveyorMessage "Copying the extension files to the PostgreSQL directories." -Category Information
Expand-Archive -LiteralPath $zip -DestinationPath $env:pgroot
if ("$env:pg" -notmatch "\.") {
Set-Content -path pg.pass -value "$env:pgpassword" -encoding ascii
initdb -A md5 -U "$env:PGUSER" --pwfile=pg.pass C:\pgdata
pg_ctl register -S demand -N "postgresql$env:x64-$env:pgversion" -D c:\pgdata
}
Start-Service postgresql$env:x64-$env:pgversion
& .\test\appveyor_tests.ps1
artifacts:
- path: '*.zip'
deploy:
# Deploy to GitHub Releases
- provider: GitHub
draft: false
prerelease: false
auth_token:
secure: iABKJh8cHPJuyS1vHu44URWBRQkcivQVFZ0NUpTRFqyMvHuhkv/qLKkB/XqoKpC7
on:
appveyor_repo_tag: true # deploy on tag push only
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))