forked from FarGroup/FarManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
182 lines (164 loc) · 7.15 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
version: 3.0.{branch}.{build}
branches:
only:
- master
skip_tags: true
skip_non_tags: false
max_jobs: 8
image: Visual Studio 2019
init:
- git config --global core.autocrlf true
clone_folder: c:\projects\FarManager
shallow_clone: true
clone_depth: 1
install:
#update AppVeyor build number to match Far build number
- cd far && for /f "tokens=1,2,4 delims=, " %%i in ('tools\m4 -P farversion.inc.m4') do set VER_MAJOR=%%i && set VER_MINOR=%%j && set VER_BUILD=%%k && appveyor UpdateBuild -Version %%i.%%j.%%k.%APPVEYOR_BUILD_NUMBER% && cd ..
environment:
matrix:
- id: Release.x64
configuration: Release
arch: amd64
platform_name: x64
ADD_MAKE:
ADD_MAKE_MSI: RELEASE=1
NAME_ADD:
- id: Release.x86
configuration: Release
arch: amd64_x86
platform_name: x86
ADD_MAKE:
ADD_MAKE_MSI: RELEASE=1
NAME_ADD:
- id: Release.ARM64
configuration: Release
arch: amd64_arm64
platform_name: ARM64
ADD_MAKE:
ADD_MAKE_MSI: RELEASE=1
NAME_ADD:
- id: Debug.x64
configuration: Debug
arch: amd64
platform_name: x64
ADD_MAKE: DEBUG=1
ADD_MAKE_MSI:
NAME_ADD: .Debug
- id: Debug.x86
configuration: Debug
arch: amd64_x86
platform_name: x86
ADD_MAKE: DEBUG=1
ADD_MAKE_MSI:
NAME_ADD: .Debug
build_script:
#build Plugin SDK Encyclopedia
- set PATH=C:\Python39-x64;%PATH%;C:\Program Files (x86)\HTML Help Workshop
- enc/tools/tool.make_enc_chm.bat
#build Lua MacroAPI docs
- enc/tools/tool.make_lua_chm.bat
#set vs environment variables
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %arch%
#print version
- cl
#build far
- cd far
- set FARMANAGER_BUILD_TYPE=VS_RELEASE
- set FARMANAGER_SCM_REVISION=%APPVEYOR_REPO_COMMIT%
- nmake /f makefile_vc %ADD_MAKE%
- nmake /f makefile_vc install INSTALLDIR=..\ci\%configuration%.%platform_name% %ADD_MAKE%
- update_headers.bat nocommit
- cd ..
#build plugins
- cd plugins
- nmake /f makefile_all_vc %ADD_MAKE% INSTALL=..\ci\%configuration%.%platform_name%\Plugins FAR_WORKDIR=..\..\ci\%configuration%.%platform_name%
- cd ..
#build netbox
- curl --silent "https://api.github.com/repos/FarGroup/Far-NetBox/releases/latest" | grep '"tag_name":' | sed -E 's/.*^"v([^^^"]+)^".*/\1/' > TEMP
- set /p NETBOX_VERSION=<TEMP
- echo "Download NetBox %NETBOX_VERSION%"
- set NETBOX_BASE_NAME=NetBox.%platform_name%.%NETBOX_VERSION%
- set NETBOX_FILE_NAME=%NETBOX_BASE_NAME%.7z
- set NETBOX_PDB_NAME=%NETBOX_BASE_NAME%.pdb.7z
- set NETBOX_BASE_URL=https://github.com/FarGroup/Far-NetBox/releases/download/v%NETBOX_VERSION%/
- curl -fsLJO %NETBOX_BASE_URL%%NETBOX_FILE_NAME%
- curl -fsLJO %NETBOX_BASE_URL%%NETBOX_PDB_NAME%
- set NETBOX_DIR=ci\%configuration%.%platform_name%\Plugins
- 7z x %NETBOX_FILE_NAME% -o%NETBOX_DIR%
- 7z x %NETBOX_PDB_NAME% -o%NETBOX_DIR%\NetBox
#build FarColorer
- for /F "delims=" %%a in ('curl -fsLJ "https://raw.githubusercontent.com/colorer/FarColorer/master/version4far.txt"') do set COLORER_VERSION=%%a
- echo "Download FarColorer %COLORER_VERSION%"
- set COLORER_BASE_NAME=FarColorer.%platform_name%.v%COLORER_VERSION%
- set COLORER_FILE_NAME=%COLORER_BASE_NAME%.wobase.7z
- set COLORER_PDB_NAME=%COLORER_BASE_NAME%.pdb.7z
- set COLORER_BASE_URL=https://github.com/colorer/FarColorer/releases/download/v%COLORER_VERSION%/
- curl -fsLJO %COLORER_BASE_URL%%COLORER_FILE_NAME%
- curl -fsLJO %COLORER_BASE_URL%%COLORER_PDB_NAME%
#download colorer schemes
- curl --silent "https://api.github.com/repos/colorer/Colorer-schemes/releases/latest" | grep '"tag_name":' | sed -E 's/.*^"v([^^^"]+)^".*/\1/' > TEMP
- set /p COLORER_SCHEMES_VERSION=<TEMP
- echo "Download colorer schemes %COLORER_SCHEMES_VERSION%"
- set COLORER_SCHEMES_FILE_NAME=colorer-base.allpacked.%COLORER_SCHEMES_VERSION%.zip
- set COLORER_SCHEMES_BASE_URL=https://github.com/colorer/Colorer-schemes/releases/download/v%COLORER_SCHEMES_VERSION%/
- curl -fsLJO %COLORER_SCHEMES_BASE_URL%%COLORER_SCHEMES_FILE_NAME%
- set COLORER_DIR=ci\%configuration%.%platform_name%\Plugins\FarColorer
- mkdir %COLORER_DIR%
- 7z x %COLORER_FILE_NAME% -o%COLORER_DIR%
- 7z x %COLORER_PDB_NAME% -o%COLORER_DIR%\bin
- 7z x %COLORER_SCHEMES_FILE_NAME% -o%COLORER_DIR%\base
#remove not needed build artifacts
- ps: Get-ChildItem ci\${Env:configuration}`.${Env:platform}\ -recurse -File | Where-Object { @(".lib", ".exp", ".ilk") -contains $_.extension } | Remove-Item
test: off
after_build:
#copy pregenerated CHM files
- mkdir ci\%configuration%.%platform_name%\Encyclopedia
- copy /Y enc\build\chm\ru\FarEncyclopedia.ru.chm ci\%configuration%.%platform_name%\Encyclopedia
- copy /Y enc\build\lua\luafar_manual\luafar_manual.chm ci\%configuration%.%platform_name%\Encyclopedia
- copy /Y enc\build\lua\macroapi_manual.en\macroapi_manual.en.chm ci\%configuration%.%platform_name%\Encyclopedia
- copy /Y enc\build\lua\macroapi_manual.ru\macroapi_manual.ru.chm ci\%configuration%.%platform_name%\Encyclopedia
#copy misc docs and addons
- xcopy /e /q /y /k extra\* ci\%configuration%.%platform_name%\
#test & archive
- cd ci\%configuration%.%platform_name%
#Run macrotest.lua, on failure %ERRORLEVEL% is non zero
- if not "%platform_name%" == "ARM64" Far.exe "lua:far.MacroPost([=[R=win.GetEnv('FARHOME');R=R or os.exit(1); R=R..[[\Plugins\LuaMacro\macrotest.lua]]; R=loadfile(R);R=R or os.exit(2); OK,R=pcall(R);OK=OK or os.exit(3); OK,R=pcall(R.test_all);os.exit(OK and 0 or 4);]=],nil,'CtrlShiftF12')"
#set NAME_PREFIX variable as otherwise it is not available when artifacts are collected
- set NAME_PREFIX="Far%NAME_ADD%.%platform_name%.%appveyor_build_version%.%APPVEYOR_REPO_COMMIT%"
- appveyor SetVariable -Name NAME_PREFIX -Value "%NAME_PREFIX%"
#save artifacts only for release as we keep on reaching the appveyor limit
#archive PDBs
- if "%configuration%" == "Release" 7z a -ir!*.pdb "%APPVEYOR_BUILD_FOLDER%\%NAME_PREFIX%.pdb.7z"
#archive Far without PDBs
- if "%configuration%" == "Release" 7z a -xr!*.pdb "%APPVEYOR_BUILD_FOLDER%\%NAME_PREFIX%.7z"
- cd ..\..
#create msi
- cd misc\msi-installer
- appveyor DownloadFile https://wixtoolset.org/downloads/v3.14.0.5722/wix314-binaries.zip
- 7z x wix314-binaries.zip -owix
- set PATH=%PATH%;wix
- set SOURCE_DIR=%APPVEYOR_BUILD_FOLDER%\ci\%configuration%.%platform_name%
- set NIGHTLY=1
- nmake -nologo %ADD_MAKE_MSI%
- cd ..\..
- if "%configuration%" == "Release" move ci\%configuration%.%platform_name%\final.msi "%APPVEYOR_BUILD_FOLDER%\%NAME_PREFIX%.msi"
artifacts:
- path: $(NAME_PREFIX).7z
name: Far Manager
- path: $(NAME_PREFIX).msi
name: Far Manager MSI
- path: $(NAME_PREFIX).pdb.7z
name: Far Manager PDBs
deploy:
tag: ci/v$(appveyor_build_version)
release: v$(appveyor_build_version)
description: 'Far Manager $(appveyor_build_version) - $(APPVEYOR_REPO_COMMIT)'
provider: GitHub
auth_token:
secure: HAUGtOhYJyo0hSoGV+PsM992ZIDTahXGHo7Bj5QyOXusNqYGERVyjsvBvIY8owTJ
artifact: /.*\.(msi|7z)/
draft: false
prerelease: false
on:
branch: master # release from master branch only
configuration: Release # only release builds