mirror of
https://github.com/zealdocs/zeal.git
synced 2024-11-26 15:43:49 +03:00
155 lines
4.5 KiB
YAML
155 lines
4.5 KiB
YAML
version: '{branch}-{build}'
|
|
pull_requests:
|
|
do_not_increment_build_number: true
|
|
branches:
|
|
only:
|
|
- master
|
|
- stable
|
|
- /release\/.*/
|
|
image:
|
|
- Visual Studio 2017
|
|
configuration: Release
|
|
platform:
|
|
- x86
|
|
- x64
|
|
environment:
|
|
matrix:
|
|
- ZEAL_PORTABLE_BUILD: "OFF"
|
|
- ZEAL_PORTABLE_BUILD: "ON"
|
|
init:
|
|
- ps: |-
|
|
if ($Env:PLATFORM -eq "x64") {
|
|
$Env:QT_ROOT = "C:\Qt\5.12\msvc2017_64"
|
|
} else {
|
|
$Env:QT_ROOT = "C:\Qt\5.12\msvc2017"
|
|
}
|
|
|
|
$Env:Path += ";${Env:QT_ROOT}\bin;C:\Program Files\7-Zip"
|
|
install:
|
|
- ps: |-
|
|
# Install vcpkg toolchain.
|
|
$Env:VCPKG_ROOT = "c:\projects\vcpkg-export"
|
|
$vcpkgArchive = "vcpkg-export-20200420.6-${Env:PLATFORM}.7z"
|
|
appveyor DownloadFile "https://dl.bintray.com/zealdocs/windows-ci/$vcpkgArchive"
|
|
7z x $vcpkgArchive -o"${Env:VCPKG_ROOT}"
|
|
before_build:
|
|
- ps: |-
|
|
Write-Output "Source directory: ${Env:APPVEYOR_BUILD_FOLDER}"
|
|
|
|
New-Item -ItemType Directory -Force -Path dist | Out-Null
|
|
Set-Location -Path dist
|
|
|
|
# Prepare .sln with CMake:
|
|
$cmakeGenerator = "Visual Studio 15 2017"
|
|
if ($Env:PLATFORM -eq "x64") {
|
|
$cmakeGenerator += " Win64"
|
|
}
|
|
|
|
Write-Output "Generator: $cmakeGenerator"
|
|
|
|
cmake "${Env:APPVEYOR_BUILD_FOLDER}" `
|
|
-G "$cmakeGenerator" `
|
|
-DZEAL_PORTABLE_BUILD="${Env:ZEAL_PORTABLE_BUILD}" `
|
|
-DCMAKE_BUILD_TYPE="${Env:CONFIGURATION}" `
|
|
-DCMAKE_PREFIX_PATH="${Env:QT_ROOT}" `
|
|
-DCMAKE_TOOLCHAIN_FILE="${Env:VCPKG_ROOT}\scripts\buildsystems\vcpkg.cmake"
|
|
|
|
Set-Location -Path ${Env:APPVEYOR_BUILD_FOLDER}
|
|
build_script:
|
|
- ps: |-
|
|
msbuild "dist\ALL_BUILD.vcxproj" /m /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
|
after_build:
|
|
- ps: |-
|
|
if ($Env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
|
Write-Output "Deployment is disabled for pull requests."
|
|
Exit-AppveyorBuild
|
|
}
|
|
|
|
$package = "zeal"
|
|
|
|
if ($Env:ZEAL_PORTABLE_BUILD -eq "ON") {
|
|
$package = $package + "-portable"
|
|
}
|
|
|
|
if ($Env:APPVEYOR_REPO_BRANCH -eq "master") {
|
|
$package = $package + "-unstable"
|
|
} elseif (${env:APPVEYOR_REPO_BRANCH}.StartsWith("release/")) {
|
|
$package = $package + "-stable"
|
|
} else {
|
|
Write-Output "Skipping deployment for this branch..."
|
|
Exit-AppveyorBuild
|
|
}
|
|
|
|
$Env:ZEAL_PKG_NAME = $package
|
|
# TODO: Use APPVEYOR_BUILD_VERSION.
|
|
$Env:ZEAL_PKG_VERSION = git describe | ForEach-Object {$_ -replace "^v",""}
|
|
|
|
$binaryDir = "dist\bin\Release"
|
|
$deploymentDir = "${Env:ZEAL_PKG_NAME}-${Env:ZEAL_PKG_VERSION}-windows-${Env:PLATFORM}"
|
|
|
|
Write-Output "Output Directory: $deploymentDir"
|
|
|
|
New-Item -Type directory -Path . -Name "$deploymentDir" -Force | Out-Null
|
|
|
|
& windeployqt `
|
|
--no-angle `
|
|
--no-compiler-runtime `
|
|
--no-opengl-sw `
|
|
--no-plugins `
|
|
--no-system-d3d-compiler `
|
|
--no-translations `
|
|
--dir "$deploymentDir" `
|
|
"$binaryDir\zeal.exe"
|
|
|
|
function AddItem ($path) {
|
|
Copy-Item "$path" "$deploymentDir"
|
|
Write-Host "Added $path"
|
|
}
|
|
|
|
AddItem "$binaryDir\*"
|
|
|
|
# OpenSSL is a runtime dependency, so copy it manually.
|
|
if ($Env:PLATFORM -eq "x64") {
|
|
AddItem "${Env:VCPKG_ROOT}\installed\${Env:PLATFORM}-windows\bin\libcrypto-1_1-x64.dll"
|
|
AddItem "${Env:VCPKG_ROOT}\installed\${Env:PLATFORM}-windows\bin\libssl-1_1-x64.dll"
|
|
} else {
|
|
AddItem "${Env:VCPKG_ROOT}\installed\${Env:PLATFORM}-windows\bin\libcrypto-1_1.dll"
|
|
AddItem "${Env:VCPKG_ROOT}\installed\${Env:PLATFORM}-windows\bin\libssl-1_1.dll"
|
|
}
|
|
|
|
function AddQtPlugin ($directory, $plugin) {
|
|
if ( -Not (Test-Path "$deploymentDir\$directory")) {
|
|
New-Item -ItemType directory -Path "$deploymentDir" -Name "$directory" | Out-Null
|
|
}
|
|
|
|
Copy-Item "${Env:QT_ROOT}\plugins\$directory\q$plugin.dll" "$deploymentDir\$directory"
|
|
Write-Host "Added $directory\$plugin.dll"
|
|
}
|
|
|
|
AddQtPlugin "imageformats" "gif"
|
|
AddQtPlugin "imageformats" "ico"
|
|
AddQtPlugin "imageformats" "jpeg"
|
|
AddQtPlugin "platforms" "windows"
|
|
AddQtPlugin "styles" "windowsvistastyle"
|
|
|
|
$archiveName = "$deploymentDir.zip"
|
|
& 7z a -mx=9 "$archiveName" "$deploymentDir"
|
|
|
|
Push-AppveyorArtifact "$archiveName"
|
|
test: off
|
|
artifacts:
|
|
- path: zeal-*.zip
|
|
deploy:
|
|
- provider: BinTray
|
|
username: trollixx
|
|
api_key:
|
|
secure: AsKi8j1sR34g/9+B22/dJ49X3Uie8TizgQD7lzNvW2/+deWq7oLyCQQUCrqPjOUY
|
|
subject: zealdocs
|
|
repo: windows-ci
|
|
package: $(ZEAL_PKG_NAME)
|
|
version: $(ZEAL_PKG_VERSION)
|
|
publish: true
|
|
override: true
|
|
on:
|
|
branch: stable
|