-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathappveyor.yml
88 lines (74 loc) · 2.56 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
version: 1.0.0+{build}
image:
- Visual Studio 2017
- Ubuntu
configuration: Release
platform: x64
environment:
APPVEYOR_SAVE_CACHE_ON_ERROR: true
VCPKG_PATH: "c:\\tools\\vcpkg"
NINJA_URL_WIN: "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip"
MSVC_HOME: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community"
DOCKER_LOGIN: infactum
DOCKER_PASSWORD:
secure: wWPsUiEtw8rfnjX2/Y3/AA==
DOCKER_IMAGE: infactum/telegram-native-builder
matrix:
- TARGET_PLATFORM: x86
- TARGET_PLATFORM: x64
matrix:
exclude:
- image: Ubuntu
TARGET_PLATFORM: x86
init:
- ps: |
If ($isLinux) {
$env:APPVEYOR_CACHE_SKIP_RESTORE = "true"
$env:APPVEYOR_CACHE_SKIP_SAVE = "true"
}
- cmd: |
appveyor DownloadFile %NINJA_URL_WIN% -FileName ninja.zip
7z x ninja.zip -oC:\ninja > nul
rm ninja.zip
set PATH=C:\ninja;%PATH%
ninja --version
- cmd: |
echo. >> "%VCPKG_PATH%\triplets\%TARGET_PLATFORM%-windows-static.cmake"
echo set(VCPKG_BUILD_TYPE release) >> "%VCPKG_PATH%\triplets\%TARGET_PLATFORM%-windows-static.cmake"
- sh: |
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
docker pull $DOCKER_IMAGE
install:
- cmd: |
vcpkg list
.\install_prereq.bat "%VCPKG_PATH%" %TARGET_PLATFORM%
- sh: docker build . --cache-from $DOCKER_IMAGE -t $DOCKER_IMAGE:latest -f tools/docker/linux-builder/Dockerfile
cache:
- '%VCPKG_PATH%\installed\ -> install_prereq.bat, ports'
build_script:
- cmd: |
call "%MSVC_HOME%\VC\Auxiliary\Build\vcvarsall.bat" %TARGET_PLATFORM%
mkdir build
cd build
cmake "-DCMAKE_TOOLCHAIN_FILE=%VCPKG_PATH%\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=%TARGET_PLATFORM%-windows-static" "-DCMAKE_BUILD_TYPE=%CONFIGURATION%" -GNinja ..
ninja
- sh: >-
docker run --rm -v $(pwd):/src $DOCKER_IMAGE /bin/bash -c "
mkdir build && cd build;
cmake -DCMAKE_BUILD_TYPE=Release /src;
cmake --build .;
ldd telegram_native.so;
cp telegram_native.so /src;"
after_build:
- sh: docker push $DOCKER_IMAGE
- ps: |
$prefix = "telegram_native"
$suffix = If ($isLinux) {".so"} Else {".dll"}
$artifact = "$($prefix)_$($env:TARGET_PLATFORM)$($suffix)"
Rename-Item -Path "$prefix$suffix" -NewName "$artifact"
Write-Host "Pushing artifact $artifact"
Push-AppveyorArtifact $artifact
on_failure:
- cmd: |
7z a logs.zip "%VCPKG_PATH%\buildtrees\**\*.log"
appveyor PushArtifact logs.zip