summary refs log tree commit diff
path: root/appveyor.yml
blob: d0cf82b7bb71d63d5698f64dc01ce0535790f722 (plain) (blame)
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
---

version: 0.6.3-{build}

configuration: Release
image: Visual Studio 2017
platform: x64

environment:
    BINTRAY_APIKEY:
        secure: "iGl5mzE9/ta9kFELUxDw9XtlYMSCMai9xowXIkYzU8WKHz7NfW0mLwMJZvblZFXJ"

cache: c:\tools\vcpkg\installed\

build:
    verbosity: minimal

install:
    - set QT_DIR=C:\Qt\5.10.1\msvc2017_64
    - set PATH=%PATH%;%QT_DIR%\bin;C:\MinGW\bin
    - set PATH=%PATH%;C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin
    - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
    - vcpkg install
            nlohmann-json:%PLATFORM%-windows
            boost-asio:%PLATFORM%-windows
            boost-beast:%PLATFORM%-windows
            boost-iostreams:%PLATFORM%-windows
            boost-random:%PLATFORM%-windows
            boost-signals2:%PLATFORM%-windows
            boost-system:%PLATFORM%-windows
            boost-thread:%PLATFORM%-windows
            libsodium:%PLATFORM%-windows
            lmdb:%PLATFORM%-windows
            openssl:%PLATFORM%-windows
            zlib:%PLATFORM%-windows

build_script:
    # VERSION format:     branch-master/branch-1.2
    # INSTVERSION format: x.y.z
    # WINVERSION format:  9999.0.0.123/1.2.0.234
    - if "%APPVEYOR_REPO_TAG%"=="false" set INSTVERSION=0.6.3
    - if "%APPVEYOR_REPO_TAG%"=="false" set VERSION=0.6.3
    - if "%APPVEYOR_REPO_TAG%"=="false" if "%APPVEYOR_REPO_BRANCH%"=="master" set INSTVERSION=9999.0
    - if "%APPVEYOR_REPO_TAG%"=="false" set WINVERSION=%INSTVERSION%.0.%APPVEYOR_BUILD_NUMBER%
    # VERSION format:     v1.2.3/v1.3.4
    # INSTVERSION format: 1.2.3/1.3.4
    # WINVERSION format:  1.2.3.123/1.3.4.234
    - if "%APPVEYOR_REPO_TAG%"=="true" set VERSION=%APPVEYOR_REPO_TAG_NAME%
    - if "%APPVEYOR_REPO_TAG%"=="true" set INSTVERSION=%VERSION:~1%
    - if "%APPVEYOR_REPO_TAG%"=="true" set WINVERSION=%VERSION:~1%.%APPVEYOR_BUILD_NUMBER%
    - set DATE=%date:~10,4%-%date:~4,2%-%date:~7,2%
    - echo %VERSION%
    - echo %INSTVERSION%
    - echo %DATE%

    # Build & install the dependencies
    - cmake -G "Visual Studio 15 2017 Win64" -Hdeps -B.deps
        -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
        -DUSE_BUNDLED_BOOST=OFF
    - cmake --build .deps --config Release

    # Build nheko
    - rm -f cmake/FindOlm.cmake
    - cmake -G "Visual Studio 15 2017 Win64" -H. -Bbuild
      -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
      -DLMDBXX_INCLUDE_DIR=.deps/usr/include
      -DTWEENY_INCLUDE_DIR=.deps/usr/include
      -DCMARK_INCLUDE_DIR=C:/projects/nheko/.deps/usr/include
      -DCMARK_LIBRARY=C:/projects/nheko/.deps/usr/lib/cmark.lib
    - cmake --build build --config Release

after_build:
    # Variables
    - set BUILD=%APPVEYOR_BUILD_FOLDER%
    - echo %BUILD%
    - mkdir NhekoRelease
    - copy build\Release\nheko.exe NhekoRelease\nheko.exe
    - windeployqt --qmldir %QT_DIR%\qml\ --release NhekoRelease\nheko.exe

    - copy C:\Tools\vcpkg\installed\x64-windows\lib\*.lib .\NhekoRelease\
    - copy C:\Tools\vcpkg\installed\x64-windows\bin\*.dll .\NhekoRelease\

    - copy C:\projects\nheko\.deps\usr\lib\cmark.lib .\NhekoRelease\
    - copy C:\projects\nheko\.deps\usr\bin\cmark.dll .\NhekoRelease\

    - 7z a nheko_win_64.zip .\NhekoRelease\*
    - ls -lh build\Release\
    - ls -lh NhekoRelease\
    - mkdir NhekoData
    - xcopy .\NhekoRelease\*.* NhekoData\*.* /s /e /c /y
    #
    # Create the Qt Installer Framework version
    #
    - mkdir installer
    - mkdir installer\config
    - mkdir installer\packages
    - mkdir installer\packages\com.mujx.nheko
    - mkdir installer\packages\com.mujx.nheko\data
    - mkdir installer\packages\com.mujx.nheko\meta
    - mkdir installer\packages\com.mujx.nheko.cleanup\meta
    # Copy installer data
    - copy %BUILD%\resources\nheko.ico installer\config
    - copy %BUILD%\resources\nheko.png installer\config
    - copy %BUILD%\LICENSE installer\packages\com.mujx.nheko\meta\license.txt
    - copy %BUILD%\LICENSE installer\packages\com.mujx.nheko.cleanup\meta\license.txt
    - copy %BUILD%\deploy\installer\config.xml installer\config
    - copy %BUILD%\deploy\installer\controlscript.qs installer\config
    - copy %BUILD%\deploy\installer\uninstall.qs installer\packages\com.mujx.nheko\data
    - copy %BUILD%\deploy\installer\gui\package.xml installer\packages\com.mujx.nheko\meta
    - copy %BUILD%\deploy\installer\gui\installscript.qs installer\packages\com.mujx.nheko\meta
    - copy %BUILD%\deploy\installer\cleanup\package.xml installer\packages\com.mujx.nheko.cleanup\meta
    - copy %BUILD%\deploy\installer\cleanup\installscript.qs installer\packages\com.mujx.nheko.cleanup\meta
    # Amend version and date
    - sed -i "s/__VERSION__/0.6.3/" installer\config\config.xml
    - sed -i "s/__VERSION__/0.6.3/" installer\packages\com.mujx.nheko\meta\package.xml
    - sed -i "s/__VERSION__/0.6.3/" installer\packages\com.mujx.nheko.cleanup\meta\package.xml
    - sed -i "s/__DATE__/%DATE%/" installer\packages\com.mujx.nheko\meta\package.xml
    - sed -i "s/__DATE__/%DATE%/" installer\packages\com.mujx.nheko.cleanup\meta\package.xml
    # Copy nheko data
    - xcopy NhekoData\*.* installer\packages\com.mujx.nheko\data\*.* /s /e /c /y
    - move NhekoRelease\nheko.exe installer\packages\com.mujx.nheko\data
    - mkdir tools
    - curl -L -O https://download.qt.io/official_releases/qt-installer-framework/3.0.4/QtInstallerFramework-win-x86.exe
    - 7z x QtInstallerFramework-win-x86.exe -otools -aoa
    - set PATH=%BUILD%\tools\bin;%PATH%
    - binarycreator.exe -f -c installer\config\config.xml -p installer\packages nheko-installer.exe

    - mv nheko-installer.exe nheko-%APPVEYOR_REPO_TAG_NAME%-installer.exe

on_success:
    - if "%APPVEYOR_REPO_TAG%" == "true" (curl -T nheko-%APPVEYOR_REPO_TAG_NAME%-installer.exe -uredsky17:%BINTRAY_APIKEY% https://api.bintray.com/content/nheko-reborn/nheko/%APPVEYOR_REPO_TAG_NAME%/nheko/%APPVEYOR_REPO_TAG_NAME%/)

deploy:
    description: "Development builds"
    provider: GitHub
    auth_token:
        secure: "ShStWeqp+TkYqJPQr7uFZb+B8ZTgC7Iwth+IkhjfRDCTLhy8gtWvlPzlQilder3E"
    artifact: nheko-${APPVEYOR_REPO_TAG_NAME}-installer.exe
    force_update: true
    prerelease: true
    on:
        appveyor_repo_tag: true

artifacts:
    - path: nheko_win_64.zip
    - path: nheko-$(APPVEYOR_REPO_TAG_NAME)-installer.exe