forked from hydrogen-music/hydrogen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
676 lines (554 loc) · 26.7 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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
# Appveyor configuration
#
# Cache usage
# -----------
#
# The Appveyor build cache is used for:
#
# - ccache on Linux and Windows
# - Howebrew with build prerequisites on macOS
# - State of /usr with installed prerequisites on Linux
#
# The build cache limit is 1Gb which must be shared amongst all platforms,
# so we must take care about sizes, so we allocate:
#
# Homebrew 256Mb (currently uses about 130Mb)
# Linux /var 256Mb (currently uses about 170Mb)
# Linux ccache 256Mb
# Windows64 ccache 256Mb
#
# 32-bit Windows is not cached since it's not regularly built.
#
# Caching the macOS Homebrew configuration is the single largest
# impact on Appveyor build times, since Howebrew on the Appveyor images
# is very out of date, and some prerequisites require rebuilding.
#
# Since the Homebrew installation is much larger than the
# size of cache that Appveyor allows (1GB per project, shared
# between all configurations), so we cache only objects that
# are new or modified relative to the pre-existing 'clean' VM
# state, using `treestate.py` to compare.
#
# For most build jobs, we just unpack the cached Homebrew on top
# of the existing Homebrew installation.
#
# If the cache is cleaned or out of date, we first record the
# state of the Homebrew installation, then update it and install
# prerequisites, and build a new archive of the current Homebrew
# installation.
#
# Currently the necessary changes, compressed with xz, occupy
# about 170Mb of cache space.
#
environment:
GENERATOR: "MinGW Makefiles"
UPLOAD_ARTIFACTS: false
TARGET_VERSION: '1.3.0-alpha'
matrix:
- job_name: 'Ubuntu 20.04'
job_group: 'Linux'
appveyor_build_worker_image: Ubuntu2004
- job_name: 'Ubuntu 16.04 (AppImage)'
job_group: 'Linux (AppImage)'
appveyor_build_worker_image: Ubuntu1604
- job_name: 'OS X'
job_group: 'Mac OS X'
appveyor_build_worker_image: macos
- job_name: 'Windows64'
job_group: 'Windows'
MSYS: 'C:\msys64\mingw64'
MSYS_REPO: 'mingw64/mingw-w64-x86_64'
PACKAGE_PREFIX: 'mingw-w64-x86_64'
BUILD_TYPE: "Release"
CMAKE_FLAGS: "-DWANT_DEBUG:BOOL=OFF -DWIN64:BOOL=ON -DWANT_JACK=ON"
appveyor_build_worker_image: Visual Studio 2019
LIBSSL: libssl-3-x64.dll
LIBCRYPTO: libcrypto-3-x64.dll
- job_name: 'Windows32'
job_group: 'Windows'
MSYS: 'C:\msys64\mingw32'
MSYS_REPO: 'mingw32/mingw-w64-i686'
PACKAGE_PREFIX: 'mingw-w64-i686'
BUILD_TYPE: "Release"
CMAKE_FLAGS: "-DWANT_DEBUG:BOOL=OFF -DWIN64:BOOL=OFF -DWANT_JACK=OFF"
appveyor_build_worker_image: Visual Studio 2019
LIBSSL: libssl-3.dll
LIBCRYPTO: libcrypto-3.dll
build:
verbosity: detailed
# Upload artifacts in case either the branch is named *-artifacts or
# HEAD is located on a tag (affects both Linux and Mac OS jobs).
init:
- sh: |-
if [[ "$APPVEYOR_REPO_TAG_NAME" || "$APPVEYOR_REPO_BRANCH" == *"-artifacts" ]]; then
UPLOAD_ARTIFACTS=true
fi
- cmd: |-
REM *** Upload artifacts in case either the branch is named *-artifacts or HEAD is located on a tag. ***
if defined APPVEYOR_REPO_TAG_NAME (set UPLOAD_ARTIFACTS="true") else (echo No tag name defined)
if not "%APPVEYOR_REPO_BRANCH%"=="%APPVEYOR_REPO_BRANCH:-artifacts=%" set UPLOAD_ARTIFACTS="true"
for:
-
matrix:
only:
- job_group: 'Linux'
cache: $HOME/cache_dir
before_build: |-
# In case we are not at a tag, we append some additional information to a)
# indicate that the artifact is not an official release and b) allow use
# to track down which sources it corresponds to.
#
# Attention: Be sure to tweak both. Also adjust the copies in all other
# pipelines (it can't, unfortunately, moved in the `init` section as the
# git repo is not available at this point yet).
DISPLAY_VERSION=$TARGET_VERSION
if [[ "$(git describe --abbrev=0)" == "$TARGET_VERSION" ]]; then
# If the last tag matches the display version (we are working on the
# same branch the tag is located in - the release branch), we will use
# `git describe` since it nicely adds the number of commits passed
# since the tag next to the current commit id.
DISPLAY_VERSION=$(git describe --tags)
else
# We are working on a release which is not a patch release of the last
# one (feature branch, develop branch, master after splitting of a
# dedicated release branch). We just add the commit hash to the
# display version.
DISPLAY_VERSION="$TARGET_VERSION-$(git log --pretty=format:'%h' -n 1)"
fi
echo $DISPLAY_VERSION
cache_tag=usr_cache_portmidi # this can be modified to rebuild deps
cdir=$HOME/cache_dir
cache_tar=$cdir/$cache_tag.tar
cache=$cache_tar.xz
mkdir -p $cdir/ccache
ln -s $cdir/ccache $HOME/.ccache
if [ -d $cdir ] && [ -f $cache ]; then
echo "=== Unpacking cached /var $cache ==="
(
cd /
sudo tar xf $cache
)
echo "done"
else
echo "=== Building dependencies ==="
mkdir -p $cdir
sudo python3 ./treestate.py scan /usr usr.json
sudo apt-get update
sudo apt-get install -y clang qt5-default qttools5-dev qttools5-dev-tools libqt5xmlpatterns5-dev libarchive-dev libsndfile1-dev libasound2-dev libjack-jackd2-dev libqt5svg5-dev
sudo apt-get install -y liblo-dev libpulse-dev libportmidi-dev portaudio19-dev libcppunit-dev liblrdf-dev librubberband-dev ladspa-sdk ccache appstream intltool desktop-file-utils
# Install a recent PortMidi version
git clone https://github.com/PortMidi/PortMidi || exit 1
cd PortMidi || exit 1
git checkout v2.0.1 || exit 1
mkdir build || exit 1
cd build || exit 1
cmake .. || exit 1
make || exit 1
sudo make install || exit 1
cd ../.. || exit 1
rm -rf PortMidi || exit 1
sudo rm /usr/local/bin/doxygen
ccache -M 256M
ccache -s
(
sudo python3 ./treestate.py updates usr.json /usr > updates
echo $(wc -l updates) updates
sudo tar cf $cache_tar -T updates
sudo nice xz -9 -T0 $cache_tar
du -h $cache
) 2>&1 | sed 's/^/CACHE: /' &
fi
build_script: |-
git submodule init && git submodule update
export CMAKE_CXX_FLAGS="-fstrict-enums -fstack-protector-strong -Werror=format-security -Wformat -Wunused-result -D_FORTIFY_SOURCE=2"
CPUS=$(nproc)
echo "Building with $CPUS cpus"
mkdir build && cd build && \
cmake -DWANT_LASH=1 \
-DWANT_LRDF=1 \
-DWANT_PORTMIDI=1 \
-DWANT_PORTAUDIO=1 \
-DWANT_RUBBERBAND=1 \
-DDISPLAY_VERSION_PIPELINE=${DISPLAY_VERSION} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. \
&& \
make -j $CPUS
ccache -s
wait
echo "=== Build cache usage is " $( du -h $cdir | tail -1 ) "==="
test_script: |-
TMPDIR=/tmp src/tests/tests --appveyor --output-file=testOutput.log
res=$?;
if [ "$res" != "0" ]; then
# The tests failed. Upload all output to ease debugging.
appveyor PushArtifact testOutput.log
fi
echo "Validating desktop file."
desktop-file-validate ../linux/org.hydrogenmusic.Hydrogen.desktop || exit 1
echo "Validating AppStream meta data."
appstreamcli validate ../linux/org.hydrogenmusic.Hydrogen.metainfo.xml || exit 1
( exit $res )
-
matrix:
only:
- job_group: 'Linux (AppImage)'
cache: $HOME/cache_dir_appimage
before_build: |-
# In case we are not at a tag, we append some additional information to a)
# indicate that the artifact is not an official release and b) allow use
# to track down which sources it corresponds to.
#
# Attention: Be sure to tweak both. Also adjust the copies in all other
# pipelines (it can't, unfortunately, moved in the `init` section as the
# git repo is not available at this point yet).
DISPLAY_VERSION=$TARGET_VERSION
if [[ "$(git describe --abbrev=0)" == "$TARGET_VERSION" ]]; then
# If the last tag matches the display version (we are working on the
# same branch the tag is located in - the release branch), we will use
# `git describe` since it nicely adds the number of commits passed
# since the tag next to the current commit id.
DISPLAY_VERSION=$(git describe --tags)
else
# We are working on a release which is not a patch release of the last
# one (feature branch, develop branch, master after splitting of a
# dedicated release branch). We just add the commit hash to the
# display version.
DISPLAY_VERSION="$TARGET_VERSION-$(git log --pretty=format:'%h' -n 1)"
fi
echo $DISPLAY_VERSION
if [ "$UPLOAD_ARTIFACTS" == "false" ]; then
echo "Skipping AppImage build as artifacts are not requested"
exit 0
fi
cache_tag=usr_cache_appimage_fresh_2 # this can be modified to rebuild deps
## Since we use a different Linux image we, unfortunately, have
## to use a separate cache.
cdir=$HOME/cache_dir_appimage
cache_tar=$cdir/$cache_tag.tar
cache=$cache_tar.xz
mkdir -p $cdir/ccache || exit 1
ln -s $cdir/ccache $HOME/.ccache || exit 1
if [ -d $cdir ] && [ -f $cache ]; then
echo "=== Unpacking cached /var $cache ==="
(
cd /
sudo tar xf $cache || exit 1
# Ensure bricked doxygen version get's removed.
sudo rm -f /usr/local/bin/doxygen
)
echo "done"
else
echo "=== Building dependencies ==="
mkdir -p $cdir || exit 1
sudo python3 ./treestate.py scan /usr usr.json || exit 1
sudo apt-get update || exit 1
sudo apt-get install -y clang libarchive-dev libsndfile1-dev libasound2-dev libjack-jackd2-dev libflac-dev libgl1-mesa-dev libgles2-mesa-dev libglu1-mesa-dev libogg-dev libvorbis-dev mesa-common-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0 || exit 1
sudo apt-get install -y liblo-dev libpulse-dev libportmidi-dev portaudio19-dev libcppunit-dev liblrdf-dev librubberband-dev ladspa-sdk ccache appstream intltool desktop-file-utils || exit 1
# The doxygen version provided in the repo is bricked and
# would crash the `liblo` build.
sudo rm /usr/local/bin/doxygen || exit 1
# Ubuntu 16.04 is shipped with OpenSSL 1.0.2 which is not
# compatible with v 1.1.1X expected by Qt
git clone https://github.com/openssl/openssl || exit 1
cd openssl || exit 1
git checkout OpenSSL_1_1_1t || exit 1
./config || exit 1
make -j $(nproc) || exit 1
sudo make install || exit 1
cd ..
# liblo version shipped in Ubuntu 16.04 is to low for Hydrogen
# to compile.
git clone https://github.com/radarsat1/liblo || exit 1
cd liblo || exit 1
git checkout 0.31 || exit 1
./autogen.sh || exit 1
make || exit 1
sudo make install || exit 1
cd ..
ccache -M 256M || exit 1
ccache -s || exit 1
(
sudo python3 ./treestate.py updates usr.json /usr > updates || exit 1
echo $(wc -l updates) updates
sudo tar cf $cache_tar -T updates || exit 1
sudo nice xz -9 -T0 $cache_tar || exit 1
du -h $cache
) 2>&1 | sed 's/^/CACHE: /' &
fi
build_script: |-
git submodule init || exit 1
git submodule update || exit 1
export PATH=$HOME/Qt/5.15.2/gcc_64/bin:$PATH
export Qt5Widgets_DIR=$HOME/Qt/5.15.2/gcc_64/lib/cmake/Qt5Widgets
export CMAKE_CXX_FLAGS="-fstrict-enums -fstack-protector-strong -Werror=format-security -Wformat -Wunused-result -D_FORTIFY_SOURCE=2"
CPUS=$(nproc)
echo "Building with $CPUS cpus"
mkdir build || exit 1
cd build || exit 1
cmake -DWANT_LASH=1 \
-DWANT_LRDF=1 \
-DWANT_RUBBERBAND=1 \
-DWANT_APPIMAGE=1 \
-DWANT_DYNAMIC_JACK_CHECK=1 \
-DDISPLAY_VERSION_PIPELINE=${DISPLAY_VERSION} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_PREFIX_PATH=$HOME/Qt/5.15.2/gcc_64 .. || exit 1
make -j $CPUS || exit 1
ccache -s || exit 1
wait
echo "=== Build cache usage is " $( du -h $cdir | tail -1 ) "==="
echo -e "\n *** Creating AppDir ***\n"
make install DESTDIR=AppDir || exit 1
echo -e "\n *** Retrieve AppImage toolchain ***\n"
## We do not cache this binary since it represents a rolling
## release and it releases us from the burden for keeping it
## up-to-date manually.
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage || exit 1
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage || exit 1
chmod +x linuxdeploy-x86_64.AppImage || exit 1
chmod +x linuxdeploy-plugin-qt-x86_64.AppImage || exit 1
echo -e "\n *** Building AppImage ***\n"
## Add custom OpenSSL libraries. They are used as fallback by Qt
## and are only dl_opened in case no matching version was found
## on system level.
cp /usr/local/lib/libssl.so.1.1 AppDir/usr/lib || exit 1
cp /usr/local/lib/libcrypto.so.1.1 AppDir/usr/lib || exit 1
LD_LIBRARY_PATH=AppDir/usr/lib/x86_64-linux-gnu/:AppDir/usr/lib:$HOME/Qt/5.15.2/gcc_64/lib ./linuxdeploy-x86_64.AppImage \
--appdir AppDir \
--executable AppDir/usr/bin/hydrogen \
--desktop-file AppDir/usr/share/applications/org.hydrogenmusic.Hydrogen.desktop \
--icon-file AppDir/usr/share/hydrogen/data/img/gray/icon.svg \
--plugin qt \
--output appimage || exit 1
echo -e "\n *** Upload AppImage ***\n"
TARGET_NAME=Hydrogen-${DISPLAY_VERSION}-x86_64.AppImage
mv Hydrogen-x86_64.AppImage ${TARGET_NAME} || exit 1
appveyor PushArtifact ${TARGET_NAME} || exit 1
-
cache: /Users/appveyor/cache_dir
matrix:
only:
- job_group: 'Mac OS X'
before_build: |-
# In case we are not at a tag, we append some additional information to a)
# indicate that the artifact is not an official release and b) allow use
# to track down which sources it corresponds to.
#
# Attention: Be sure to tweak both. Also adjust the copies in all other
# pipelines (it can't, unfortunately, moved in the `init` section as the
# git repo is not available at this point yet).
DISPLAY_VERSION=$TARGET_VERSION
if [[ "$(git describe --abbrev=0)" == "$TARGET_VERSION" ]]; then
# If the last tag matches the display version (we are working on the
# same branch the tag is located in - the release branch), we will use
# `git describe` since it nicely adds the number of commits passed
# since the tag next to the current commit id.
DISPLAY_VERSION=$(git describe --tags)
else
# We are working on a release which is not a patch release of the last
# one (feature branch, develop branch, master after splitting of a
# dedicated release branch). We just add the commit hash to the
# display version.
DISPLAY_VERSION="$TARGET_VERSION-$(git log --pretty=format:'%h' -n 1)"
fi
echo $DISPLAY_VERSION
###############################################################
# Set up macOS dependencies
export MACOSX_DEPLOYMENT_TARGET=10.12
sudo ln -s /usr/local /opt/local;
cache_tag=usr_local_1 # this can be modified to rebuild deps
cdir=$HOME/cache_dir
cache_tar=$cdir/$cache_tag.tar
cache=$cache_tar.xz
CPUS=$(sysctl -n hw.ncpu)
if [ -d $cdir ] && [ -f $cache ]; then
echo "=== Unpacking cached Homebrew $cache ==="
(
cd /
tar xf $cache
)
echo "done"
else
echo "=== Building dependencies ==="
echo "Couldn't find cache $cache"
ls -alrt "$cdir"
echo "Recording /usr/local state"
python3 ./treestate.py scan /usr/local usrlocal.json
brew update
# Build our own versions of these for macOS 10.12 target systems.
brew install --build-from-source ./macos/HomebrewFormulae/berkeley-db.rb
brew install --build-from-source ./macos/HomebrewFormulae/libogg.rb
brew install --build-from-source ./macos/HomebrewFormulae/libvorbis.rb
brew install --build-from-source ./macos/HomebrewFormulae/libsndfile.rb
brew install qt5 libarchive jack pulseaudio cppunit ruby
# The build environment is now ready for use. We can complete
# the rest of the process of creating the Homebrew archive
# during the rest of the build, using idle CPU time. To minimise
# the amount of space needed for the archive, we compress with
# xz, which adds only about a minute to the non-cached build.
(
echo "=== Creating cache tarball $cache ==="
echo "Check /usr/local for updates"
python3 ./treestate.py updates usrlocal.json /usr/local \
| fgrep -v .git \
> updated_list
echo Need to record $( wc -l updated_list ) updates
mkdir -p $cdir
rm -f $cdir/*
nice tar cf $cache_tar -T updated_list
echo nice xz -9 -T$CPUS $cache_tar
nice xz -9 -T$CPUS $cache_tar
du -h $cdir
) 2>&1 | sed 's/^/CACHE: /' &
fi
export CMAKE_PREFIX_PATH="$(brew --prefix qt5)";
export PKG_CONFIG_PATH="$(brew --prefix libarchive)/lib/pkgconfig";
build_script: |-
# fix use of register keyword in jack: https://github.com/jackaudio/jack1/issues/84
sed -i '' 's/, int register,/, int,/g' /opt/local/include/jack/types.h
git submodule init && git submodule update
# Do the build
(
mkdir build && \
cd build && \
cmake -DWANT_LASH=1 \
-DWANT_LRDF=1 \
-DDISPLAY_VERSION_PIPELINE=${DISPLAY_VERSION} \
-DWANT_RUBBERBAND=1 .. && \
make -j $CPUS
) || exit 1
# Build installation DMG
(
cd build
PATH="$(brew --prefix qt5)/bin:$PATH"
../macos/build_dmg.sh -v src/gui/hydrogen.app Hydrogen-${DISPLAY_VERSION}.dmg
if [ "$UPLOAD_ARTIFACTS" == "true" ]; then
appveyor PushArtifact Hydrogen*.dmg -DeploymentName Installer;
fi
) || exit 1
test_script: |-
cd build
TMPDIR=/tmp src/tests/tests --appveyor --output-file=testOutput.log
res=$?
wait
if [ "$res" != "0" ]; then
# The tests failed. Upload all output to ease debugging.
appveyor PushArtifact testOutput.log
fi
echo "=== Build cache usage is " $( du -h $cdir | tail -1 ) "==="
( exit $res )
-
matrix:
only:
- job_group: 'Windows'
cache: '%USERPROFILE%\AppData\Roaming\ccache'
before_build:
cmd: |-
REM *** In case we are not at a tag, we append some additional information to a)
REM *** indicate that the artifact is not an official release and b) allow use
REM *** to track down which sources it corresponds to.
REM ***
REM *** Attention: the code for determining the version string is present in the
REM *** top-level CMakeLists.txt file too. Be sure to tweak both. Also adjust
REM *** the copies in all other pipelines (it can't, unfortunately, moved in the
REM *** `init` section as the git repo is not available at this point yet).
set DISPLAY_VERSION=%TARGET_VERSION%
echo %TARGET_VERSION%
FOR /F "delims=" %%i IN ('"git describe --abbrev=0"') DO set GIT_LAST_TAG=%%i
echo %GIT_LAST_TAG%
FOR /F "delims=" %%i IN ('"git describe --tags"') DO set GIT_DESCRIPTION=%%i
echo %GIT_DESCRIPTION%
FOR /F "delims=" %%i IN ('"git log --pretty=format:'%%h' -n 1"') DO set GIT_COMMIT_HASH=%%i
echo %GIT_COMMIT_HASH%
REM *** If the last tag matches the display version (we are working on the
REM *** same branch the tag is located in - the release branch), we will use
REM *** `git describe` since it nicely adds the number of commits passed
REM *** since the tag next to the current commit id.
if %GIT_LAST_TAG%==%TARGET_VERSION% set DISPLAY_VERSION=%GIT_DESCRIPTION%
REM *** We are working on a release which is not a patch release of the last
REM *** one (feature branch, develop branch, master after splitting of a
REM *** dedicated release branch). We just add the commit hash to the
REM *** display version.
if not %GIT_LAST_TAG%==%TARGET_VERSION% set DISPLAY_VERSION=%TARGET_VERSION%-%GIT_COMMIT_HASH%
REM *** Remove quotes from variable as this would prevent use from
REM *** properly find the file during upload.
set DISPLAY_VERSION=%DISPLAY_VERSION:'=%
echo %DISPLAY_VERSION%
if not %UPLOAD_ARTIFACTS%=="true" if %job_name%==Windows32 appveyor exit
set QTDIR=%MSYS%
set CMAKE_PREFIX_PATH=%QTDIR%
set PATH=%MSYS%\bin;%PATH%
set PKG_CONFIG_PATH=%MSYS%\lib\pkgconfig
cmake --version
g++ --version
REM *** Update pacman cache ***
c:\msys64\usr\bin\pacman --noconfirm -S -y
REM *** Install dependencies ***
c:\msys64\usr\bin\pacman --noconfirm -S -q %MSYS_REPO%-libarchive
c:\msys64\usr\bin\pacman --noconfirm -S -q %MSYS_REPO%-libsndfile
c:\msys64\usr\bin\pacman --noconfirm -S -q %MSYS_REPO%-cppunit
c:\msys64\usr\bin\pacman --noconfirm -S -q %MSYS_REPO%-portaudio
c:\msys64\usr\bin\pacman --noconfirm -S -q %MSYS_REPO%-portmidi
c:\msys64\usr\bin\pacman --noconfirm -S -q %MSYS_REPO%-winpthreads-git
c:\msys64\usr\bin\pacman --noconfirm -S -q %MSYS_REPO%-ladspa-sdk
REM *** The jack2 package does not seem to be available for 32bit Windows anymore ***
if not %job_name%==Windows32 c:\msys64\usr\bin\pacman --noconfirm -S -q %MSYS_REPO%-jack2
c:\msys64\usr\bin\pacman --noconfirm -S -q %MSYS_REPO%-ccache
c:\msys64\usr\bin\pacman --noconfirm -S -q %MSYS_REPO%-liblo
c:\msys64\usr\bin\pacman --noconfirm --assume-installed %PACKAGE_PREFIX%-gettext -U https://repo.msys2.org/mingw/%MSYS_REPO%-qt5-5.15.5-1-any.pkg.tar.zst
c:\msys64\usr\bin\pacman --noconfirm --assume-installed %PACKAGE_PREFIX%-gettext -U https://repo.msys2.org/mingw/%MSYS_REPO%-qt5-tools-5.15.9-1-any.pkg.tar.zst
ccache -M 256M
ccache -s
REM *** INIT SUBMODULES ***
git submodule init
git submodule update
REM *** Configure build ***
rename "C:\Program Files\Git\usr\bin\sh.exe" "sh2.exe"
mkdir build
cd build
cmake -G "%GENERATOR%" -DDISPLAY_VERSION_PIPELINE=%DISPLAY_VERSION% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% %CMAKE_FLAGS% -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
build_script:
- cmd: |-
if not %UPLOAD_ARTIFACTS%=="true" if %job_name%==Windows32 exit
REM *** Build ***
set VERBOSE=1
cmake --build . -j %NUMBER_OF_PROCESSORS%
REM *** Run tests and report results ***
set H2_HOME=%APPVEYOR_BUILD_FOLDER%
echo %H2_HOME%
SET CORE_PATH=%cd%\src\core
echo %CORE_PATH%
set PATH=%CORE_PATH%;%PATH%
src\tests\tests.exe --appveyor --output-file=testOutput.log
REM *** In case the test passed, we delete its output. If it fails, the
REM script won't reach this point and the output will be uploaded later on ***
IF %ERRORLEVEL% EQU 0 (del testOutput.log)
7z a %APPVEYOR_BUILD_FOLDER%\testresults.zip %TEMP%\hydrogen || cmd /c "exit /b 1"
if %UPLOAD_ARTIFACTS%=="true" appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\testresults.zip
mkdir %APPVEYOR_BUILD_FOLDER%\build\windows\extralibs
REM *** Deploy Qt ***
%QTDIR%\bin\windeployqt.exe -xmlpatterns --no-patchqt --dir %APPVEYOR_BUILD_FOLDER%\build\windows\extralibs src/gui/hydrogen.exe
REM *** Deploy other libraries ***
set PYTHON=C:\Python38\python
%PYTHON% -m pip install -r %APPVEYOR_BUILD_FOLDER%\windows\ci\requirements.txt
%PYTHON% %APPVEYOR_BUILD_FOLDER%\windows\ci\copy_thirdparty_dlls.py --no-overwrite -V info -L %MSYS%\bin -d %APPVEYOR_BUILD_FOLDER%\build\windows\extralibs src/gui/hydrogen.exe src/core/libhydrogen-core-%TARGET_VERSION%.dll
REM *** libcrypto and libssl are not picked up by the Python script above and needs to be copied manually ***
copy %MSYS%\bin\%LIBSSL% %APPVEYOR_BUILD_FOLDER%\build\windows\extralibs
copy %MSYS%\bin\%LIBCRYPTO% %APPVEYOR_BUILD_FOLDER%\build\windows\extralibs
REM *** Build installer ***
cpack -G NSIS -v
REM *** Run and verify installer ***
set INSTDIR=C:\hydrogen
mkdir %INSTDIR%
FOR %%F IN (Hydrogen-*.exe) DO %%F /S /D=%INSTDIR%
%PYTHON% -m pytest %APPVEYOR_BUILD_FOLDER%\windows\ci\test_installation.py --junitxml=test_installation.xml
ccache -s
on_finish:
- cmd: if %UPLOAD_ARTIFACTS%=="true" appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\build\CMakeCache.txt
- cmd: if %UPLOAD_ARTIFACTS%=="true" appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\build\CMakeFiles\CMakeConfigureLog.yaml
- cmd: if EXIST %APPVEYOR_BUILD_FOLDER%\build\testOutput.log appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\build\testOutput.log
- cmd: if %UPLOAD_ARTIFACTS%=="true" if not %job_name%==Windows32 appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\build\Hydrogen-%DISPLAY_VERSION%-win64.exe || cmd /c "exit /b 1"
- cmd: if %UPLOAD_ARTIFACTS%=="true" if %job_name%==Windows32 appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\build\Hydrogen-%DISPLAY_VERSION%-win32.exe || cmd /c "exit /b 1"
- cmd: |
if %UPLOAD_ARTIFACTS%=="true" curl -F file=@%APPVEYOR_BUILD_FOLDER%\build\test_installation.xml https://ci.appveyor.com/api/testresults/junit/%APPVEYOR_JOB_ID%