-
Notifications
You must be signed in to change notification settings - Fork 6
/
appveyor.ps1
31 lines (25 loc) · 1.21 KB
/
appveyor.ps1
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
param(
[string]$account = $env:APPVEYOR_ACCOUNT_NAME,
[string]$project = $env:APPVEYOR_PROJECT_NAME,
[string]$name = $env:APPVEYOR_PROJECT_NAME
)
$path = $env:APPVEYOR_BUILD_FOLDER
$version = $env:APPVEYOR_BUILD_VERSION
$postfix = '_' + $version -replace '\.', '-'
$apiUrl = 'https://ci.appveyor.com/api'
$data = Invoke-RestMethod -Method Get -Uri "$apiUrl/projects/$account/$project/build/$version"
$jobId = $data.build.jobs[0].jobId
Invoke-RestMethod -Method Get -OutFile "$path\Linux.zip" `
-Uri "$apiUrl/buildjobs/$jobId/artifacts/AddIn.zip"
Expand-Archive -Force -Path "$path\Linux.zip" -DestinationPath $path
Rename-Item "$path\lib${name}Win32.dll" "${name}Win32$postfix.dll"
Rename-Item "$path\lib${name}Win64.dll" "${name}Win64$postfix.dll"
Rename-Item "$path\lib${name}Lin32.so" "${name}Lin32$postfix.so"
Rename-Item "$path\lib${name}Lin64.so" "${name}Lin64$postfix.so"
$compress = @{
Path = "$path\$name*.dll", "$path\$name*.so", "$path\manifest.xml"
DestinationPath = "$path\AddIn.zip"
}
Compress-Archive @compress
New-Item -ItemType Directory -Force -Path "$path\Example\Templates\$name\Ext\" | Out-Null
Copy-Item -Path "$path\AddIn.zip" -Destination "$path\Example\Templates\$name\Ext\Template.bin"