forked from variar/klogg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
115 lines (93 loc) · 3.55 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
version: '19.11.0.{build}'
skip_tags: true
os: Visual Studio 2019
platform:
- x64
- x86
configuration:
- Release
environment:
QTDIR64: C:\Qt\5.12.5\msvc2017_64
QTDIR32: C:\Qt\5.12.5\msvc2017
CMAKE_GENERATOR_NAME: Ninja
CMAKE_BUILD_TYPE: Release
GITHUB_TOKEN:
secure: aE8TDUiHJOa/rVs/W0/8shXEhmyuJiIdJMLNviZpAlLXwL3jU3AmP5wU3wHAF2B0
GITHUB_RELEASE_TAG: continuous-win
matrix:
allow_failures:
- platform: x86
install:
- set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip"
- appveyor DownloadFile %NINJA_URL% -FileName ninja.zip
- 7z x ninja.zip -o%APPVEYOR_BUILD_FOLDER%\ninja > nul
- set PATH=%APPVEYOR_BUILD_FOLDER%\ninja;%PATH%
- ninja --version
- cinst pandoc
- set PATH=%ProgramFiles(x86)%\Pandoc;%PATH%
- pandoc -v
- ps: >-
if($env:platform -eq 'x64') {
$githubApi = 'https://api.github.com/repos/variar/klogg'
$headers = @{
"Authorization" = "token $env:GITHUB_TOKEN"
"Content-type" = "application/json"
}
$releaseTag = $env:GITHUB_RELEASE_TAG
$release = Invoke-RestMethod -Method Get -Uri "$githubApi/releases/tags/$releaseTag" -Headers $headers
echo $release
echo $release.id
}
before_build:
- if %platform%==x64 (set QTDIR=%QTDIR64%) else (set QTDIR=%QTDIR32%)
- '%QTDIR%\bin\qtenv2.bat'
- call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevcmd" -arch=%platform%
- set PATH=%ProgramFiles(x86)%\NSIS;%PATH%
- set
- md %APPVEYOR_BUILD_FOLDER%\build
- cd %APPVEYOR_BUILD_FOLDER%\build
- cmake -G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=%configuration% -DBUILD_NUMBER=%APPVEYOR_BUILD_NUMBER% -DBUILD_DOC=True %APPVEYOR_BUILD_FOLDER%
build_script:
- cmake --build . --config %configuration%
test_script:
- cmd: cd %APPVEYOR_BUILD_FOLDER%\build
- cmd: ctest --build-config %configuration% --verbose
after_test:
- cd %APPVEYOR_BUILD_FOLDER%
- scripts\win\prepare_release.cmd
- 7z a klogg-%APPVEYOR_BUILD_VERSION%-%PLATFORM%-portable.zip -r @scripts\win\7z_dll_listfile.txt
- 7z a klogg-%APPVEYOR_BUILD_VERSION%-%PLATFORM%-portable.zip @scripts\win\7z_klogg_listfile.txt
- makensis -DVERSION=%APPVEYOR_BUILD_VERSION% -DPLATFORM=%PLATFORM% klogg.nsi
artifacts:
- path: klogg-%APPVEYOR_BUILD_VERSION%-%PLATFORM%-portable.zip
name: klogg_portable
- path: klogg-%APPVEYOR_BUILD_VERSION%-%PLATFORM%-setup.exe
name: klogg_installer
before_deploy:
- ps: >-
if($env:platform -eq 'x64') {
$githubApi = 'https://api.github.com/repos/variar/klogg'
$headers = @{
"Authorization" = "token $env:GITHUB_TOKEN"
"Content-type" = "application/json"
}
$releaseTag = $env:GITHUB_RELEASE_TAG
$release = Invoke-RestMethod -Method Get -Uri "$githubApi/releases/tags/$releaseTag" -Headers $headers
$releaseId = $release.id
echo "Deleting release: $releaseId"
Invoke-RestMethod -Method Delete -Uri "$githubApi/releases/$releaseId" -Headers $headers
echo "Deleting tag: $releaseTag"
Invoke-RestMethod -Method Delete -Uri "$githubApi/git/refs/tags/$releaseTag" -Headers $headers
}
deploy:
- provider: GitHub
tag: $(GITHUB_RELEASE_TAG)
release: Continuous build (win)
description: 'Appveyor build: https://ci.appveyor.com/project/variar/klogg/builds/$(appveyor_build_id)'
auth_token:
secure: aE8TDUiHJOa/rVs/W0/8shXEhmyuJiIdJMLNviZpAlLXwL3jU3AmP5wU3wHAF2B0
artifact: klogg_portable, klogg_installer
prerelease: true
force_update: true
on:
branch: master