Skip to content

Commit 6b9f635

Browse files
authored
Create distributable packages on AppVeyor (#416)
1 parent 5ba37e4 commit 6b9f635

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

.appveyor.yml

+3
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ install:
3636
# build configuration
3737
build_script:
3838
- ps: .appveyor\build.ps1
39+
40+
after_build:
41+
- ps: .appveyor\package.ps1

.appveyor/install.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,5 @@ $bname = "$env:DEP-$env:VC-$env:ARCH.zip"
6767
if (-not (Test-Path "C:\build-cache\$bname")) {
6868
Invoke-WebRequest "http://windows.php.net/downloads/pecl/deps/$bname" -OutFile "C:\build-cache\$bname"
6969
Expand-Archive "C:\build-cache\$bname" 'C:\build-cache\deps'
70+
Copy-Item "C:\build-cache\deps\LICENSE" "C:\build-cache\deps\LICENSE.LIBRDKAFKA"
7071
}

.appveyor/package.ps1

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
$ErrorActionPreference = "Stop"
2+
3+
if ($env:TS -eq '0') {
4+
$ts_part = 'nts'
5+
} else {
6+
$ts_part = 'ts';
7+
}
8+
9+
if ($env:APPVEYOR_REPO_TAG -eq "true") {
10+
$bname = "php_rdkafka-$env:APPVEYOR_REPO_TAG_NAME-$env:PHP_VER-$ts_part-$env:VC-$env:ARCH"
11+
} else {
12+
$bname = "php_rdkafka-$($env:APPVEYOR_REPO_COMMIT.substring(0, 8))-$env:PHP_VER-$ts_part-$env:VC-$env:ARCH"
13+
}
14+
$zip_bname = "$bname.zip"
15+
16+
$dir = 'C:\projects\rdkafka\';
17+
if ($env:ARCH -eq 'x64') {
18+
$dir += 'x64\'
19+
}
20+
$dir += 'Release'
21+
if ($env:TS -eq '1') {
22+
$dir += '_TS'
23+
}
24+
25+
$files = @(
26+
"$dir\php_rdkafka.dll",
27+
"$dir\php_rdkafka.pdb",
28+
"C:\projects\rdkafka\CREDITS",
29+
"C:\projects\rdkafka\LICENSE",
30+
"C:\projects\rdkafka\README.md",
31+
"C:\build-cache\deps\bin\librdkafka.dll",
32+
"C:\build-cache\deps\bin\librdkafka.pdb",
33+
"C:\build-cache\deps\LICENSE.LIBRDKAFKA"
34+
)
35+
Compress-Archive $files "C:\$zip_bname"
36+
Push-AppveyorArtifact "C:\$zip_bname"

0 commit comments

Comments
 (0)