1
- version : 1.2.{build}
2
1
pull_requests :
3
2
do_not_increment_build_number : true
4
- os : Visual Studio 2015
3
+ os : Visual Studio 2017
5
4
configuration : Release
6
- platform :
7
- - x86
8
- - x64
5
+ platform : x64
9
6
clone_depth : 1
10
7
environment :
11
8
PGUSER : postgres
12
9
PGPASSWORD : Password12!
13
10
matrix :
11
+ - pg : 12.0-1
12
+ PlatformToolset : v141
14
13
- pg : master
15
14
PlatformToolset : v141
16
15
configuration : Debug
17
- APPVEYOR_BUILD_WORKER_IMAGE : Visual Studio 2017
18
- - pg : 9.4.22-1
19
- PlatformToolset : v120
20
- - pg : 9.5.17-1
21
- PlatformToolset : v120
22
- - pg : 9.6.13-1
23
- PlatformToolset : v120
24
- - pg : 10.8-1
25
- PlatformToolset : v120
26
- - pg : 11.3-1
16
+ - pg : 11.5-2
27
17
PlatformToolset : v140
28
18
matrix :
29
19
allow_failures :
30
20
- pg : master
31
- - pg : 9.4.22-1
32
- platform : x64
33
- - pg : 9.5.17-1
34
- platform : x64
35
- exclude :
36
- - platform : x86
37
- pg : 11.3-1
38
- - platform : x86
39
- pg : master
21
+
40
22
41
23
init : # Make %exe% available for caching
42
- - if %PLATFORM%==x64 ( set pf=%ProgramFiles%&& set x64=-x64) else set pf=%ProgramFiles(x86)%
43
- - set exe= postgresql-%pg% -windows% x64% .exe
44
- - setx /m exe % exe%
24
+ - ps : |
25
+ $env: exe = " postgresql-$env:pg -windows- x64.exe"
26
+ [Environment]::SetEnvironmentVariable(" exe", $env: exe, "Machine")
45
27
46
28
install :
47
-
48
- # http://www.databasesoup.com/2016/05/changing-postgresql-version-numbering.html
49
- - for /f "tokens=2 delims=-" %%A in ("%exe%") do set pgversion=%%~nA
50
- - echo pgversion=%pgversion%
51
- - set pgroot=%pf%\PostgreSQL\%pgversion%
52
- - echo %pgroot%
53
29
- ps : |
54
- if ("$env:pg" -eq "master") {
30
+ # http://www.databasesoup.com/2016/05/changing-postgresql-version-numbering.html
31
+ $env:pgversion = $env:pg -replace "\.\d+-\d+$", ""
32
+ $env:pgroot = "$env:ProgramFiles\PostgreSQL\$env:pgversion"
33
+ if ("$env:pg" -notmatch "\.") {
55
34
$env:Path += ";C:\msys64\usr\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64"
56
- git clone -q --depth 1 https://git.postgresql.org/git/postgresql.git c:\projects\postgresql
35
+ git clone -q --depth 1 --branch $env:pg https://git.postgresql.org/git/postgresql.git c:\projects\postgresql
57
36
pushd c:\projects\postgresql
58
37
perl src\tools\msvc\build.pl
59
38
perl src\tools\msvc\install.pl "$env:pgroot"
@@ -64,7 +43,7 @@ install:
64
43
Start-FileDownload "http://get.enterprisedb.com/postgresql/$env:exe"
65
44
}
66
45
& ".\$env:exe" --unattendedmodeui none --mode unattended --superpassword "$env:PGPASSWORD" --servicepassword "$env:PGPASSWORD" | Out-Null
67
- Stop-Service "postgresql$env: x64-$env:pgversion"
46
+ Stop-Service "postgresql- x64-$env:pgversion"
68
47
}
69
48
}
70
49
@@ -77,43 +56,38 @@ build_script:
77
56
/verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
78
57
79
58
after_build :
80
- - set dll=%PLATFORM:x86=.%\%CONFIGURATION%\temporal_tables.dll
81
- - appveyor AddMessage Packing -Category Information
82
- - md tmp\share\extension
83
- - copy *.sql tmp\share\extension\
84
- - copy *.control tmp\share\extension\
85
- - copy LICENSE tmp\TEMPORAL_TABLES_LICENSE
86
- - md tmp\lib
87
- - md tmp\symbols
88
- - copy "%dll%" tmp\lib
89
- - copy "%dll:.dll=.pdb%" tmp\symbols
90
- - set zip=temporal_tables-%APPVEYOR_REPO_COMMIT:~0,8%-pg%pgversion%-%PLATFORM%.zip
91
- - 7z a -r %zip% .\tmp\* > nul
59
+ - ps : |
60
+ $dll = "x64\$env:CONFIGURATION\temporal_tables.dll"
61
+ Add-AppveyorMessage Packing -Category Information
62
+ New-Item -Name tmp\share\extension -ItemType "directory"
63
+ Copy-Item "*.sql" -Destination tmp\share\extension\
64
+ Copy-Item "*.control" -Destination tmp\share\extension\
65
+ Copy-Item LICENSE -Destination tmp\TEMPORAL_TABLES_LICENSE
66
+ New-Item -Name tmp\lib -ItemType "directory"
67
+ New-Item -Name tmp\debug_symbols -ItemType "directory"
68
+ Copy-Item $dll -Destination tmp\lib
69
+ Copy-Item ($dll -replace "\.dll", ".pdb") -Destination tmp\debug_symbols
70
+ if ($env:APPVEYOR_REPO_TAG -eq "false") {
71
+ $env:APPVEYOR_REPO_TAG_NAME=${env:APPVEYOR_REPO_COMMIT}.SubString(0,8)
72
+ }
73
+ $zip = "temporal_tables-$env:APPVEYOR_REPO_TAG_NAME-pg$env:pgversion-windows-$env:PLATFORM.zip"
74
+ Compress-Archive -Path ".\tmp\*" -DestinationPath $zip
92
75
93
76
test_script :
94
- - path %pgroot%\bin;%PATH%
95
- - appveyor AddMessage "Copying the extension files to the PostgreSQL directories." -Category Information
96
- - 7z x %zip% "-o%pgroot%"
97
77
- ps : |
98
- if ("$env:pg" -eq "master") {
78
+ $env:path += ";$env:pgroot\bin"
79
+ Add-AppveyorMessage "Copying the extension files to the PostgreSQL directories." -Category Information
80
+ Expand-Archive -LiteralPath $zip -DestinationPath $env:pgroot
81
+ if ("$env:pg" -notmatch "\.") {
99
82
Set-Content -path pg.pass -value "$env:pgpassword" -encoding ascii
100
83
initdb -A md5 -U "$env:PGUSER" --pwfile=pg.pass C:\pgdata
101
- pg_ctl register -S demand -N "postgresql$env: x64-$env:pgversion" -D c:\pgdata
84
+ pg_ctl register -S demand -N "postgresql- x64-$env:pgversion" -D c:\pgdata
102
85
}
103
- - rem Start the database server.
104
- - net start postgresql%x64%-%pgversion%
105
-
106
- - appveyor AddTest Regression -Framework pg_regress -FileName sql\ -Outcome Running
107
- - ps : |
86
+ Start-Service postgresql-x64-$env:pgversion
108
87
Add-AppveyorTest Regression -Framework pg_regress -FileName sql\ -Outcome Running
109
- if ("9.4" -eq "$env:pgversion") {
110
- $env:psqlopt="--psqldir"
111
- } else {
112
- $env:psqlopt="--bindir"
113
- }
114
88
$env:Outcome="Passed"
115
89
$elapsed=(Measure-Command {
116
- pg_regress "$env:psqlopt =$env:pgroot\bin" --dbname=pl_regression `
90
+ pg_regress "--bindir =$env:pgroot\bin" --dbname=pl_regression `
117
91
install no_system_period invalid_system_period no_history_table `
118
92
no_history_system_period invalid_types invalid_system_period_values `
119
93
versioning versioning_custom_system_time structure uninstall 2>&1 |
@@ -135,9 +109,9 @@ artifacts:
135
109
deploy :
136
110
# Deploy to GitHub Releases
137
111
- provider : GitHub
138
- artifact : /.*\.zip/
139
- draft : false
112
+ draft : true
140
113
prerelease : false
114
+ auth_token :
115
+ secure : pR/CfKkATG5dbsaTAJS2WsKC+OBuli4eMe3hSylaNUMnvvjUEXmfIseZF+//1d/j
141
116
on :
142
- branch : master # release from master branch only
143
117
appveyor_repo_tag : true # deploy on tag push only
0 commit comments