-
Notifications
You must be signed in to change notification settings - Fork 52
/
.appveyor.yml
334 lines (288 loc) · 13.3 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
version: 1.0.{build}
os: Visual Studio 2017
environment:
COMPILER: msys2
PLATFORM: x64
MSYS2_ARCH: x86_64
MSYS2_DIR: msys64
MSYSTEM: MINGW64
BIT: 64
SENTRY_KEYS:
secure: 4h/RDAT2VRFeFncyVmupjvYW2+ZVLLt8Meb0HZnKpeXw4DgSXxy2C8PicOvkBrxGsywvi1LTBDAJdTBdCaXHXETB0zLjFrasYj9hNUYhF2hWF7XZXA9qYPyhZHNVyg8t
SENTRY_OAUTH:
secure: 27P9bk8UQd9PDKzjLCfy1usKSpt+46f8RYs/cNaPxWS3CBksealddVYAA26iGLvog4AE0kLS/jUYAysDZ3yWQsGzRv8sCjC7S8imHwoDpWY=
CODECOV_TOKEN:
secure: kDB13lf6yyaC7d63D0DcRbEjf5vZ77xt2WMxHtxx7Jz32OUaR8Ouxso7WBQoubMO
AWS_ACCESS_KEY:
secure: FBWRLw84S0Uq5xlHzaNBfg9zknKUzTQ6+jUBWeQFg38=
AWS_SECRET_KEY:
secure: uYWVMV2S2RDPMKNuTmncDT75vWfYPwJfHQjog7UO2C0OdtWNuYzxDZnlEvIC/KSA
MIXPANEL_TOKEN:
secure: z3ZI9fB/7hbyMhWdZv9HVMdAqGGB2GmtIeqGPxCOiSNjfLwQIVsNtuOFxSTC3Pty
UPDATE_REPO_URL:
secure: JDDxl2ZAdBCu+BvfRCt4jkbEnCctwtGBoTdA3l74mwRS5LDPRyEfGxOyrxK43rbwhHaYk5w/7iIrP0vxFYiM9vYjBSsSlO3s/TWiprifBrg=
init:
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
cache:
- C:\msys64\var\cache\pacman\pkg
install:
- SET "PATH=C:\Qt\5.12.6\mingw73_64\bin;C:\%MSYS2_DIR%\%MSYSTEM%\bin;C:\%MSYS2_DIR%\usr\bin;%PATH%"
- bash -lc "pacman -S --needed --noconfirm mingw64/mingw-w64-x86_64-hdf5 mingw64/mingw-w64-x86_64-netcdf mingw64/mingw-w64-x86_64-boost"
- bash -lc "pacman -S --needed --noconfirm zlib-devel"
- bash -lc "pacman -S --noconfirm mingw64/mingw-w64-x86_64-curl"
- bash -lc "pacman -S --noconfirm rsync"
- C:\Python38\Scripts\pip.exe install pandas
- bash -lc "wget https://github.com/linux-test-project/lcov/releases/download/v1.15/lcov-1.15.tar.gz"
- bash -lc "tar -xzf lcov-1.15.tar.gz"
- bash -lc "ln -s $PWD/lcov-1.15/bin/lcov /c/msys64/mingw64/bin/lcov"
- bash -lc "ln -s $PWD/lcov-1.15/bin/geninfo /c/msys64/mingw64/bin/geninfo"
build_script:
# write to Sentry keys file
- ps: echo $env:SENTRY_KEYS | out-file -encoding ASCII keys
- ps: |
# check for Sentry keys file
if ( -not (Test-Path keys) ) {
echo "File not found - 'keys', needed for crash reporter to work properly."
exit 1
}
- SET "QTEST_FUNCTION_TIMEOUT=1200000"
- bash -lc "qmake -v"
- ps: |
&{ bash -lc "cd /c/projects/ElMaven ; git submodule update --init --recursive" 2>&1 | %{ "$_" } }
if ( $LASTEXITCODE -ne 0 ) {
exit 1
}
- ps: |
if ( Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER ) {
echo "Compiling in debug mode ..."
&{ bash -lc "cd C:/projects/ElMaven/ ; echo no | ./run.sh" 2>&1 | %{ "$_" } }
if ( $LASTEXITCODE -ne 0 ) {
exit 1
}
&{ bash -lc "cd C:/projects/ElMaven/ ; ./run_tests.sh" 2>&1 | %{ "$_" } }
if ( $LASTEXITCODE -ne 0 ) {
exit 1
}
bash -lc "lcov -b /c/Projects/ElMaven/src/core/libmaven/ --capture --directory /c/projects/build/tmp/maven/ --output-file /c/projects/ElMaven/lcov.info --no-external"
&{ bash -lc "lcov --summary /c/projects/ElMaven/lcov.info" 2>&1 | %{ "$_" } }
&{ bash -lc "cd /c/projects/ElMaven/ ; /c/Python38/python tests/test-scripts/test_gen_reports.py" 2>&1 | %{ "$_" } }
if ( $LASTEXITCODE -ne 0 ) {
exit 1
}
} else {
# export encoded update repository URL
$env:UPDATE_REPO_URL_BASE64 = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($env:UPDATE_REPO_URL))
echo "Compiling in release mode with debug information ..."
qmake CONFIG+=release CONFIG+=force_debug_info CONFIG+=warn_off NOTESTS=yes
# have to wrap this in a script block to make sure exit code is
# ignored (make's warnings would otherwise be treated as error
# signals by powershell).
&{ make --silent -j4 2>&1 | %{ "$_" } }
if ( $LASTEXITCODE -ne 0 ) {
exit 1
}
}
after_build:
- ps: |
# we do not create installers for pull requests, to save time
if ( Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER ) {
echo "This build is for a PR. Not proceeding with installer creation."
return
}
# clone packaging repo
echo "Cloning packaging repo ..."
git clone -q https://github.com/ElucidataInc/elmaven-packaging.git
# define variables
echo "Defining environment variables ..."
$env:PACKAGING_REPO = "elmaven-packaging"
$ELMAVEN_TAG = git describe --abbrev=0 --tags
$pos = $ELMAVEN_TAG.IndexOf("-")
if ( $pos -eq -1 ) {
$ELMAVEN_VERSION = $ELMAVEN_TAG.TrimStart('v')
} else {
$substr = $ELMAVEN_TAG.Substring(0, $pos)
$ELMAVEN_VERSION = $substr.TrimStart('v')
}
if ( Test-Path env:APPVEYOR_REPO_TAG_NAME ) {
$ELMAVEN_BRANCH = $env:APPVEYOR_REPO_TAG_NAME
} elseif ( Test-Path env:APPVEYOR_REPO_BRANCH ) {
$ELMAVEN_BRANCH = $env:APPVEYOR_REPO_BRANCH
}
cd $env:PACKAGING_REPO
$PARENT_DIR = Convert-Path .
$BIN = "$PARENT_DIR\bin\"
$ELMAVEN_BIN = "$PARENT_DIR\..\bin\"
$NODE_WIN = "$PARENT_DIR\node_win"
$ARCHIVE_FILE = "maven.7z"
$PACKAGE_DATA = "$PARENT_DIR\packages\com.vendor.product\data\"
$env:APPNAME = "El-MAVEN"
$env:INSTALLER = "$env:APPNAME-$ELMAVEN_BRANCH"
# collect runtime plugins
echo "Collecting plugins ..."
cd $PARENT_DIR
if ( -Not (Test-Path $BIN -PathType Container) ) { mkdir $BIN }
cd $BIN ; rm -Recurse -Force *
$excludes = "linux","node","node_bin","node.exe","MavenTests.exe","methods"
Get-ChildItem $ELMAVEN_BIN |
Where-Object{$_.Name -notin $excludes} |
Copy-Item -Destination $BIN -Recurse -Force
$libs = $(ldd "$env:APPNAME.exe" peakdetector.exe)
if ( $? -eq $false ) {
echo "Failed to copy files from build folder to packaging folder."
exit 1
}
foreach ( $line in $( $libs -split "`n" ) ) {
if ( $line -match '.*=>\s*(.*bin.*dll).*') {
$lib = $Matches[1]
if ( $lib.StartsWith("/c/") ) {
[regex]$p = "/c/"
$lib = $p.replace($lib, "C:/", 1)
} elseif ( $lib.StartsWith("/MINGW64/") ) {
[regex]$p = "/MINGW64/"
$lib = $p.replace($lib, "C:/$env:MSYS2_DIR/MINGW64/", 1)
}
if ( -Not ([io.path]::GetDirectoryName($lib) -eq $BIN) ) {
echo "Copying $lib"
Copy-item $lib $BIN
} else {
echo "Skipping $lib"
}
}
}
# overwrite Qt's std library with mingw's version
Copy-item "C:/$env:MSYS2_DIR/MINGW64/bin/libstdc++-6.dll" $BIN -Force
$qt_plugins_path = $(qmake -query QT_INSTALL_PLUGINS)
echo "Found plugins at $qt_plugins_path"
# since Qt5.9.7, windeployqt has stopped working. Going to use some
# copy paste magic instead to get all the extra plugins required.
Copy-item -recurse "$qt_plugins_path\platforms" .
Copy-item -recurse "$qt_plugins_path\imageformats" .
Copy-item -recurse "$qt_plugins_path\printsupport" .
Copy-item -recurse "$qt_plugins_path\sqldrivers" .
Copy-item -recurse "$qt_plugins_path\bearer" .
Copy-item -recurse "$qt_plugins_path\mediaservice" .
Copy-item -recurse "$qt_plugins_path\styles" .
# QtNetwork module requires extra ssl dlls to work
Copy-item ..\libs\OpenSSL\* .
# generate qt.conf
echo "[Paths]`nPrefix = .`n" >> qt.conf
# strip and upload debug symbols
echo "Stripping and uploading symbols ..."
cd $BIN
$WIN_BREAKPAD_TOOLS = "$env:APPVEYOR_BUILD_FOLDER\$env:PACKAGING_REPO\breakpad_tools\windows"
# convert Windows paths to Unix style paths
$BREAKPAD_TOOLS = (($WIN_BREAKPAD_TOOLS -replace "\\","/") -replace ":","").ToLower().Trim("/")
$EXE_DIR = (($BIN -replace "\\","/") -replace ":","").ToLower().Trim("/")
# need to perform symbol creation within bash environment otherwise they are not recognized
$APPNAME = $env:APPNAME ; bash -lc "/$BREAKPAD_TOOLS/cv2pdb.exe /$EXE_DIR/$APPNAME.exe"
$APPNAME = $env:APPNAME ; bash -lc "/$BREAKPAD_TOOLS/dump_syms.exe /$EXE_DIR/$APPNAME.pdb > /$EXE_DIR/$APPNAME.sym"
chmod +x $WIN_BREAKPAD_TOOLS\sentry-cli.exe
ls
& "$WIN_BREAKPAD_TOOLS\sentry-cli.exe" difutil check .\$APPNAME.sym
& "$WIN_BREAKPAD_TOOLS\sentry-cli.exe" --auth-token $env:SENTRY_OAUTH upload-dif -t breakpad --project el-maven-logging --org el-maven --wait --include-sources .\$APPNAME.sym
rm .\$APPNAME.pdb
rm .\$APPNAME.sym
# copy node
echo "Copying node requirements ..."
robocopy $NODE_WIN $BIN /e /copyall > $null
# expose pre-installed Qt Installer Framework binaries
$env:PATH="C:\Qt\QtIFW-3.0.1\bin;$env:PATH"
# generate archive
echo "Generating archive ..."
cd $PARENT_DIR
if ( Test-Path $ARCHIVE_FILE ) { rm $ARCHIVE_FILE }
if ( Test-Path $PACKAGE_DATA\$ARCHIVE_FILE ) { rm $PACKAGE_DATA\$ARCHIVE_FILE }
archivegen.exe $ARCHIVE_FILE $BIN > $null;
if ( $? -eq $false ) {
echo 'Failed to generate archive. Make sure archivegen is in system path.'
exit 1
}
mkdir $PACKAGE_DATA
Copy-Item $ARCHIVE_FILE $PACKAGE_DATA
# update version
echo "Updating version string in config file ..."
cd $PARENT_DIR
if ( Get-Command "python.exe" -ErrorAction SilentlyContinue ) {
python.exe update_version.py $ELMAVEN_VERSION $env:UPDATE_REPO_URL
} elseif ( Get-Command "python2.7.exe" -ErrorAction SilentlyContinue ) {
python2.7.exe update_version.py $ELMAVEN_VERSION $env:UPDATE_REPO_URL
} elseif ( Get-Command "python3.6.exe" -ErrorAction SilentlyContinue ) {
python3.6.exe update_version.py $ELMAVEN_VERSION $env:UPDATE_REPO_URL
} else {
echo 'Unable to find python.'
exit 1
}
if ( $? -eq $false ) {
echo 'Failed to update version in config file.'
exit 1
}
if ( (Test-Path env:APPVEYOR_REPO_TAG_NAME) -and
!($env:APPVEYOR_REPO_TAG_NAME -like "*alpha*") -and
!($env:APPVEYOR_REPO_TAG_NAME -like "*beta*") ) {
# create update repository for this release
echo "Creating an update repository for $ELMAVEN_BRANCH ..."
$env:ELMAVEN_UPDATES = "repository"
cd $PARENT_DIR
mkdir "$PARENT_DIR\$env:ELMAVEN_UPDATES"
repogen.exe -p packages -i com.vendor.product "$PARENT_DIR\$env:ELMAVEN_UPDATES"
if ( $? -eq $false ) {
echo 'Failed to create update archive for release.'
exit 1
}
Move-Item -Path "$PARENT_DIR\$env:ELMAVEN_UPDATES" -Destination "$PARENT_DIR\..\$env:ELMAVEN_UPDATES"
}
# create installer
echo "Creating installer ..."
cd $PARENT_DIR
binarycreator --offline-only -r extras.qrc -c config\config.xml -p packages\ $env:INSTALLER > $null
if ( $? -eq $false ) {
echo 'Make sure binarycreator is in system path'
exit 1
}
Copy-Item "$env:INSTALLER.exe" ..\
cd ..\
artifacts:
- path: $(INSTALLER).exe
name: $(INSTALLER)
- path: "$(ELMAVEN_UPDATES)"
name: "Updates"
deploy:
- provider: GitHub
auth_token:
secure: TVTb3zTJz43Xl5du7hKCp6gOcwMVRS8V2+HidpzMUgVHoqwsVVRPi5DVyZiM4joH
release: $(APPVEYOR_REPO_TAG_NAME)
artifact: $(INSTALLER).exe
draft: true
force_update: true
on:
APPVEYOR_REPO_TAG: true # deploy to release page on tag push only
- provider: S3
access_key_id: $(AWS_ACCESS_KEY)
secret_access_key: $(AWS_SECRET_KEY)
region: us-west-2
bucket: "elmaven-installers"
folder: "Windows"
set_public: true
artifact: $(INSTALLER).exe
- provider: S3
access_key_id: $(AWS_ACCESS_KEY)
secret_access_key: $(AWS_SECRET_KEY)
region: us-west-2
bucket: "elmaven-installers"
folder: "windows-updates"
unzip: true
set_public: true
artifact: "Updates"
on:
APPVEYOR_REPO_TAG: true # deploy updates for release builds only
# on_success:
# - ps: |
# if ( Test-Path env:APPVEYOR_PULL_REQUEST_NUMBER ) {
# bash -lc "cd /c/projects/ElMaven/ ; bash <(curl -s https://codecov.io/bash)"
# }
notifications:
# disable annoying email notifications
- provider: Email
on_build_success: false
on_build_failure: false
on_build_status_changed: false