forked from rizinorg/rizin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
132 lines (115 loc) · 5.18 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Version format
version: 'git.{build}'
# Skip Github tags
skip_tags: true
# Environment variables
environment:
NINJA_URL: https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip
VSVARSALLPATH2017: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat'
VSVARSALLPATH2019: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat'
matrix:
# VS2017 64
- builder: vs2017_64
PYTHON: 'C:\\Python37-x64'
INNO_SETUP: 'C:\\Program Files (x86)\\Inno Setup 5'
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
BUILD_DIR: build
RUN_TESTS: false
# VS2019 64
- builder: vs2019_64
PYTHON: 'C:\\Python38-x64'
INNO_SETUP: 'C:\\Program Files (x86)\\Inno Setup 6'
APPVEYOR_BUILD_WORKER_IMAGE: Previous Visual Studio 2019
BUILD_DIR: build
RUN_TESTS: true
# VS2017 64 (Dynamic linking)
- builder: vs2017_64_dyn
PYTHON: 'C:\\Python37'
INNO_SETUP: 'C:\\Program Files (x86)\\Inno Setup 5'
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
BUILD_DIR: build
RUN_TESTS: false
# Clang-cl 64 (Dynamic linking)
- builder: clang_cl_64_dyn
PYTHON: 'C:\\Python38'
INNO_SETUP: 'C:\\Program Files (x86)\\Inno Setup 6'
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_DIR: build
RUN_TESTS: true
only_commits:
files:
- '**/*.c'
- '**/*.h'
- '**/*.in'
- '**/*.inc'
- '**/meson.build'
- 'shlr/rizin-shell-parser/'
- 'subprojects/'
- 'test/'
- '.appveyor.yml'
# Init
init:
# Build dependent custom commands
- cmd: "%init_command%"
# Required software for building
install:
# Update environment variables
- ps: $env:RZ_VERSION = ( python sys\\version.py )
- ps: $env:DIST_FOLDER = "rizin-$env:builder-$env:RZ_VERSION"
- ps: $env:ARTIFACT_ZIP = "$env:DIST_FOLDER.zip"
# Download required packages
- cmd: if defined BUILD_DIR ( %PYTHON%\python.exe -m pip install meson ninja PyYAML)
# Build scripts
build_script:
- appveyor AddMessage "Compiling rizin %RZ_VERSION% (%builder%)"
- cmd: if %builder% == vs2017_64 ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2017%" x64 && %PYTHON%\Scripts\meson --buildtype=release --prefix="%CD%\%DIST_FOLDER%" --default-library=static -Db_vscrt=static_from_buildtype -Duse_webui=true build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == vs2019_64 ( choco install mingw && refreshenv && set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2019%" x64 && %PYTHON%\Scripts\meson --buildtype=release --prefix="%CD%\%DIST_FOLDER%" --default-library=static -Db_vscrt=static_from_buildtype -Duse_webui=true build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == vs2017_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2017%" x64 && %PYTHON%\Scripts\meson --buildtype=release --prefix="%CD%\%DIST_FOLDER%" -Duse_webui=true build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
- cmd: if %builder% == clang_cl_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2019%" x64 && set CC=clang-cl && %PYTHON%\Scripts\meson --buildtype=release --prefix="%CD%\%DIST_FOLDER%" -Duse_webui=true build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )
# Run tests only conditionally
for:
-
matrix:
only:
- RUN_TESTS: true
test_script:
- set PATH=%APPVEYOR_BUILD_FOLDER%\%DIST_FOLDER%\bin;C:\Python38-x64;C:\msys64\mingw64\bin;%PATH%
- echo %PATH%
- where rizin
- rizin -v
- copy C:\Python38-x64\python.exe C:\Python38-x64\python3.exe
- python3 -m pip install "git+https://github.com/rizinorg/rz-pipe#egg=rzpipe&subdirectory=python"
- cd test
- git clone -q --depth 1 https://github.com/rizinorg/rizin-testbins bins
- cd ..
- "%PYTHON%\\Scripts\\ninja -C build test"
- cd test
- rz-test -o results.json -L db
- cd ..
after_test:
- git clone --depth 1 https://github.com/rizinorg/rizin-win-installer
- set PATH=%PATH%;%INNO_SETUP%
- iscc rizin-win-installer/rizin.iss /DRizinLocation=..\%DIST_FOLDER%\* /DIcoLocation=rizin.ico /DMyAppVersion=%RZ_VERSION%
- move rizin-win-installer\Output\rizin.exe rizin_installer-%builder%.exe
# Artifacts
artifacts:
# Binaries
- path: "%ARTIFACT_ZIP%"
# Inno Setup files
- path: rizin_installer-%builder%.exe
# Test results
- path: test/results.json
# Upload builds to the CI release at GitHub
# deploy:
# tag: Continuous-Windows
# release: Continuous-Windows
# description: 'Rizin Windows release'
# provider: GitHub
# auth_token:
# secure: aIhLJhegEu8fMuyfhVxiEyF5+28ozTtmDmQ3UBddNou3nQlXyIWJ5dZSPnf6HqsS # encrypted token from GitHub
# artifact: /.*\.zip/ # All generated ZIP packages for MSVC and clang-cl builds
# draft: false
# prerelease: true
# force_update: true
# on:
# branch: master # release from master branch only