forked from supercollider/supercollider
-
Notifications
You must be signed in to change notification settings - Fork 0
802 lines (743 loc) · 34.9 KB
/
actions.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
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
name: CI
on:
push:
paths-ignore:
- 'examples/**'
- 'HelpSource/**'
- 'sounds/**'
- '*.md'
pull_request:
paths-ignore:
- 'examples/**'
- 'HelpSource/**'
- 'sounds/**'
- '*.md'
schedule:
- cron: '0 0 * * 0' # run weekly to refresh cache
jobs:
lint:
runs-on: ubuntu-20.04
outputs:
sc-version: ${{ steps.set-version.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: lint class library
run: |
sudo npm install -g lintspaces-cli
lintspaces -e .editorconfig SCClassLibrary/**/*.sc || true # ignore failure
- name: lint cpp files
run: |
sudo apt-get install -y clang-format-8
echo "Running tools/clang-format.py lintall"
tools/clang-format.py -c clang-format-8 -d clang-format-diff-8 lintall || exit 1
echo "Lint successful"
- name: set version string for artifacts
id: set-version
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
FULL_TAG=${GITHUB_REF#refs/tags/}
SC_VERSION=${FULL_TAG##Version-}
else
SC_VERSION=$GITHUB_SHA
fi
echo "version=$SC_VERSION" >> $GITHUB_OUTPUT
Linux:
needs: lint
runs-on: ubuntu-${{ matrix.os-version }}
strategy:
fail-fast: false
matrix:
include:
- job-name: 'focal gcc7'
os-version: '20.04'
c-compiler: 'gcc-7'
cxx-compiler: 'g++-7'
use-syslibs: false
shared-libscsynth: false
- job-name: 'focal gcc9 shared libscsynth'
os-version: '20.04'
c-compiler: 'gcc-9'
cxx-compiler: 'g++-9'
use-syslibs: false
shared-libscsynth: true
- job-name: 'jammy gcc10 use system libraries'
os-version: '22.04'
c-compiler: 'gcc-10'
cxx-compiler: 'g++-10'
use-syslibs: true
shared-libscsynth: false
- job-name: 'jammy gcc11'
os-version: '22.04'
c-compiler: 'gcc-11'
cxx-compiler: 'g++-11'
use-syslibs: false
shared-libscsynth: false
- job-name: 'jammy gcc12'
os-version: '22.04'
c-compiler: 'gcc-12'
cxx-compiler: 'g++-12'
use-syslibs: false
shared-libscsynth: false
artifact-suffix: 'linux-jammy-gcc12' # set if needed - will trigger artifact upload
- job-name: 'focal clang7'
os-version: '20.04'
c-compiler: 'clang-7'
cxx-compiler: 'clang++-7'
use-syslibs: false
shared-libscsynth: false
- job-name: 'focal clang11'
os-version: '20.04'
c-compiler: 'clang-11'
cxx-compiler: 'clang++-11'
use-syslibs: false
shared-libscsynth: false
- job-name: 'focal clang12'
os-version: '20.04'
c-compiler: 'clang-12'
cxx-compiler: 'clang++-12'
use-syslibs: false
shared-libscsynth: false
- job-name: 'jammy clang13'
os-version: '22.04'
c-compiler: 'clang-13'
cxx-compiler: 'clang++-13'
use-syslibs: false
shared-libscsynth: false
- job-name: 'jammy clang14'
os-version: '22.04'
c-compiler: 'clang-14'
cxx-compiler: 'clang++-14'
use-syslibs: false
shared-libscsynth: false
name: Linux ${{ matrix.job-name }}
env:
BUILD_PATH: ${{ github.workspace }}/build
INSTALL_PATH: ${{ github.workspace }}/build/Install
USE_SYSLIBS: ${{ matrix.use-syslibs }}
SHARED_LIBSCSYNTH: ${{ matrix.shared-libscsynth }}
CC: ${{ matrix.c-compiler }}
CXX: ${{ matrix.cxx-compiler }}
ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}'
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: prepare daily timestamp for cache
id: current-date
run: echo "stamp=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: cache ccache
uses: actions/cache@v3
with:
path: |
~/.ccache
~/.cache/ccache
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.c-compiler }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.c-compiler }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes build-essential cmake pkg-config libjack-jackd2-dev libsndfile1-dev libasound2-dev libavahi-client-dev libreadline6-dev libfftw3-dev libicu-dev libxt-dev libudev-dev emacs ccache
# install appropriate clang/gcc compilers
if [[ "$CC" =~ clang-[1-9] ]]; then
sudo apt-get install -y $CC # package names are clang-X
sudo apt-get install -y libc++-${CC##clang-}-dev libc++abi-${CC##clang-}-dev # install additional libraries; package names are libc++-X-dev and libc++abi-X-dev
elif [[ "$CC" =~ gcc-[1-9] ]]; then
sudo apt-get install -y $CXX # package names are g++-X
fi
- name: install system libraries
if: env.USE_SYSLIBS == 'true'
run: sudo apt-get install --yes libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev libboost-test-dev libboost-program-options-dev libyaml-cpp-dev
- name: install qt from apt
run: sudo apt-get install qtbase5-dev qt5-qmake qttools5-dev qttools5-dev-tools qtdeclarative5-dev libqt5svg5-dev libqt5websockets5-dev qtwebengine5-dev
- name: configure
run: |
mkdir $BUILD_PATH && cd $BUILD_PATH
EXTRA_CMAKE_FLAGS=
if $USE_SYSLIBS; then EXTRA_CMAKE_FLAGS="-DSYSTEM_BOOST=ON -DSYSTEM_YAMLCPP=ON"; fi
if $SHARED_LIBSCSYNTH; then EXTRA_CMAKE_FLAGS="-DLIBSCSYNTH=ON $EXTRA_CMAKE_FLAGS"; fi
cmake $EXTRA_CMAKE_FLAGS -DSC_EL=ON -DSC_VIM=ON -DSC_ED=ON -DSC_QT=ON -DSC_IDE=ON -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PATH -DCMAKE_BUILD_TYPE=Release .. # --debug-output
- name: build
run: |
cd $BUILD_PATH
make install -j2
- name: create archive
if: matrix.artifact-suffix
run: cd $INSTALL_PATH && zip --symlinks -r $ARTIFACT_FILE.zip .
- name: upload artifacts
uses: actions/upload-artifact@v3
if: matrix.artifact-suffix
with:
name: ${{ env.ARTIFACT_FILE }}
path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}.zip
macOS:
needs: lint
runs-on: macos-${{ matrix.os-version }}
strategy:
fail-fast: false
matrix:
include:
- job-name: 'universal'
os-version: '12'
xcode-version: '13.4.1'
deployment-target: '10.14'
cmake-architectures: 'x86_64;arm64'
use-syslibs: false
shared-libscsynth: false
system-portaudio: true
build-libsndfile: false
build-readline: false
build-fftw: false
artifact-suffix: 'macOS-universal'
verify-app: true
- job-name: 'x64 legacy'
os-version: '12'
xcode-version: '13.4.1'
qt-version: '5.9.9' # will use qt from aqtinstall
deployment-target: '10.11'
cmake-architectures: x86_64
use-syslibs: false
shared-libscsynth: false
build-libsndfile: true
system-portaudio: false
build-fftw: true
vcpkg-triplet: x64-osx-release-supercollider # required for build-libsndfile
artifact-suffix: 'macOS-x64-legacy' # set if needed - will trigger artifact upload
- job-name: 'x64 use system libraries'
os-version: '12'
xcode-version: '13.4.1'
deployment-target: '10.14'
cmake-architectures: x86_64
use-syslibs: true
shared-libscsynth: false
verify-app: true
- job-name: 'x64 shared libscsynth'
os-version: '12'
xcode-version: '13.4.1'
deployment-target: '10.14'
cmake-architectures: x86_64
use-syslibs: false
shared-libscsynth: true
verify-app: true
name: macOS ${{ matrix.job-name }}
env:
BUILD_PATH: ${{ github.workspace }}/build
INSTALL_PATH: ${{ github.workspace }}/build/Install
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
USE_SYSLIBS: ${{ matrix.use-syslibs }}
SHARED_LIBSCSYNTH: ${{ matrix.shared-libscsynth }}
ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}.dmg'
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer'
MACOSX_DEPLOYMENT_TARGET: '${{ matrix.deployment-target }}'
CMAKE_OSX_ARCHITECTURES: '${{ matrix.cmake-architectures }}'
BREW_UNIVERSAL_WORKDIR: ${{ github.workspace }}/brew-universal
SKIP_SIGNING: 1 # for brew-install-universal
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: prepare timestamp for cache
id: current-date
run: |
echo "stamp=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "week=$(date '+%U')" >> $GITHUB_OUTPUT
- name: cache ccache
uses: actions/cache@v3
with:
path: ~/Library/Caches/ccache
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-${{ matrix.qt-version }}-${{ matrix.cmake-architectures }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-${{ matrix.qt-version }}-${{ matrix.cmake-architectures }}-
- name: cleanup homebrew downloads # always remove existing downloads first, as we bring back relevant downloads from cache
run: rm -rf $(brew --cache)
- name: cache homebrew downloads
uses: actions/cache@v3
id: cache-homebrew
with:
path: ~/Library/Caches/Homebrew/downloads
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-${{ matrix.qt-version }}-${{ matrix.cmake-architectures }}-homebrew-${{ steps.current-date.outputs.week }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-${{ matrix.qt-version }}-${{ matrix.cmake-architectures }}-homebrew-
- name: cache homebrew universal packages
uses: actions/cache@v3
if: matrix.cmake-architectures != 'x86_64' && (matrix.build-libsndfile != true || matrix.build-readline != true || matrix.build-fftw != true)
with:
path: ${{ env.BREW_UNIVERSAL_WORKDIR }}
key: ${{ runner.os }}-v1-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.deployment-target }}-brew_universal-${{ steps.current-date.outputs.week }}
restore-keys: ${{ runner.os }}-v1-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.deployment-target }}-brew_universal-
- name: cache vcpkg
if: matrix.vcpkg-triplet
uses: actions/cache@v3
with:
path: ~/.cache/vcpkg/archives
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.deployment-target }}-${{ matrix.vcpkg-triplet }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.deployment-target }}-${{ matrix.vcpkg-triplet }}-
- name: install dependencies
run: |
brew install ccache
# add ccamke to PATH - see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions
echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
if [[ "${{ matrix.system-portaudio }}" != "false" ]]; then brew install portaudio; fi
if [[ "${{ matrix.build-fftw }}" != "true" ]]; then brew install fftw; fi
# install universal versions of homebrew libraries
if [[ "${{ matrix.cmake-architectures }}" != "x86_64" ]]; then
echo "Downloading script for creating universal binaries from homebrew packages"
curl -O -J -L https://gist.githubusercontent.com/dyfer/6c83905d4593750105897e51e87ec345/raw/1f89f2fe767a2e637387e74f0c8dcc86a0963f60/brew-install-universal.sh
chmod +x brew-install-universal.sh
if [[ "${{ matrix.build-libsndfile }}" != "true" ]]; then ./brew-install-universal.sh libsndfile; fi
if [[ "${{ matrix.build-readline }}" != "true" ]]; then ./brew-install-universal.sh readline; fi
if [[ "${{ matrix.build-fftw }}" != "true" ]]; then ./brew-install-universal.sh fftw; fi
if [[ "${{ matrix.system-portaudio }}" != "false" ]]; then ./brew-install-universal.sh portaudio; fi
fi
- name: install libsndfile # to make it compatible with older OSes (lower deployment target)
if: matrix.build-libsndfile == true && matrix.vcpkg-triplet
run: |
brew uninstall --ignore-dependencies libsndfile libvorbis libogg flac opus
vcpkg install libsndfile --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
- name: install readline # to allow cross-compiling
if: matrix.build-readline == true && matrix.vcpkg-triplet
run: |
brew uninstall --ignore-dependencies readline
vcpkg install readline --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
# vcpkg readline currently fails on arm64 (ncurses dependency)
# see https://github.com/microsoft/vcpkg/issues/22654
- name: install fftw # to allow cross-compiling
if: matrix.build-fftw == true && matrix.vcpkg-triplet
run: |
vcpkg install fftw3 --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
- name: install system libraries
if: env.USE_SYSLIBS == 'true'
run: brew install yaml-cpp boost
- name: install qt from homebrew
if: matrix.cmake-architectures == 'x86_64' && !matrix.qt-version
run: brew install qt5
- name: install qt universal binary from homebrew
if: matrix.cmake-architectures != 'x86_64' && !matrix.qt-version
run: ./brew-install-universal.sh qt5
- name: install qt using aqtinstall
uses: jurplel/install-qt-action@v3
if: matrix.qt-version
env:
DEVELOPER_DIR: '' # remove developer dir which causes installation to fail
with:
modules: 'qtwebengine'
version: ${{ matrix.qt-version }}
cache: true
cache-key-prefix: ${{ runner.os }}-v1-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-qt${{ matrix.qt-version }}
- name: configure
run: |
mkdir $BUILD_PATH && cd $BUILD_PATH
EXTRA_CMAKE_FLAGS=
if $USE_SYSLIBS; then EXTRA_CMAKE_FLAGS="-DSYSTEM_BOOST=ON -DSYSTEM_YAMLCPP=ON $EXTRA_CMAKE_FLAGS"; fi
if $SHARED_LIBSCSYNTH; then EXTRA_CMAKE_FLAGS="-DLIBSCSYNTH=ON $EXTRA_CMAKE_FLAGS"; fi
if [[ -z "${{ matrix.qt-version }}" ]]; then EXTRA_CMAKE_FLAGS="-DCMAKE_PREFIX_PATH=`brew --prefix qt5` $EXTRA_CMAKE_FLAGS"; fi
if [[ "${{ matrix.verify-app }}" == "true" ]]; then EXTRA_CMAKE_FLAGS="-DSC_VERIFY_APP=ON $EXTRA_CMAKE_FLAGS"; fi
if [[ "${{ matrix.system-portaudio }}" == "false" ]]; then EXTRA_CMAKE_FLAGS="-DSYSTEM_PORTAUDIO=OFF $EXTRA_CMAKE_FLAGS"; fi
if [[ -n "${{ matrix.vcpkg-triplet }}" ]]; then
export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
EXTRA_CMAKE_FLAGS="-DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg-triplet }} -DCMAKE_BUILD_TYPE=Release $EXTRA_CMAKE_FLAGS"
fi
echo "EXTRA_CMAKE_FLAGS:" $EXTRA_CMAKE_FLAGS
cmake -G"Xcode" -DRULE_LAUNCH_COMPILE=ccache -DSUPERNOVA=ON $EXTRA_CMAKE_FLAGS ..
- name: build
run: cmake --build $BUILD_PATH --config Release --target install
- name: create archive
if: matrix.artifact-suffix
run: |
cd $INSTALL_PATH
ln -s /Applications SuperCollider/Applications
mkdir -p SuperCollider/.background
cp ../../package/background_2_arrow.png SuperCollider/.background/background_2_arrow.png
cp ../../package/ds_store SuperCollider/.DS_Store
# the following assumes that we end up with the build in the folder SuperCollider
# hdiutil sometimes fails with "create failed - Resource busy"
# when that happens, we run it again
hdiutil create -srcfolder SuperCollider -format UDZO -fs HFS+ $ARTIFACT_FILE || hdiutil create -srcfolder SuperCollider -format UDZO -fs HFS+ $ARTIFACT_FILE
- name: upload artifacts
uses: actions/upload-artifact@v3
if: matrix.artifact-suffix
with:
name: ${{ env.ARTIFACT_FILE }}
path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}
Windows:
needs: lint
runs-on: windows-${{ matrix.os-version }}
strategy:
fail-fast: false
matrix:
include:
- job-name: '32-bit'
fftw-arch: 'x86'
cmake-arch: 'Win32'
os-version: '2019'
qt-version: '5.15.2'
qt-arch: 'win32_msvc2019'
fftw-url: 'ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll32.zip'
cmake-generator: 'Visual Studio 16 2019'
msvc-year: '2019'
vcvars-script: 'vcvars32.bat'
vcpkg-triplet: x86-windows-release
use-qtwebengine: 'ON' # might need to be turned off for MinGW
qt-modules: 'qtwebengine'
artifact-suffix: 'win32' # set if needed - will trigger artifact upload
create-installer: ${{ startsWith(github.ref, 'refs/tags/') }}
installer-suffix: 'win32-installer'
- job-name: '64-bit'
fftw-arch: 'x64'
cmake-arch: 'x64'
os-version: '2019'
qt-version: '5.15.2'
qt-arch: 'win64_msvc2019_64'
fftw-url: 'ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip'
cmake-generator: 'Visual Studio 16 2019'
msvc-year: '2019'
vcvars-script: 'vcvars64.bat'
vcpkg-triplet: x64-windows-release
use-qtwebengine: 'ON' # might need to be turned off for MinGW
qt-modules: 'qtwebengine'
artifact-suffix: 'win64' # set if needed - will trigger artifact upload
create-installer: ${{ startsWith(github.ref, 'refs/tags/') }}
installer-suffix: 'win64-installer'
- job-name: '64-bit MinGW'
fftw-arch: 'x64'
os-version: '2019'
qt-version: '5.15.2'
qt-arch: 'win64_mingw81'
fftw-url: 'ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip'
cmake-generator: 'MinGW Makefiles'
chocolatey-options: '' # '--forcex86' for 32-bit build
use-qtwebengine: 'OFF' # might need to be turned off for MinGW
qt-modules: ''
artifact-suffix: 'win64-mingw' # set if needed - will trigger artifact upload
name: Windows ${{ matrix.job-name }}
env:
BUILD_PATH: ${{ github.workspace }}/build
INSTALL_PATH: ${{ github.workspace }}/build/Install
LIBS_DOWNLOAD_PATH: ${{ github.workspace }}/../3rd-party
VCVARS_SCRIPT_PATH: 'C:/Program Files (x86)/Microsoft Visual Studio/${{ matrix.msvc-year }}/Enterprise/VC/Auxiliary/Build/${{ matrix.vcvars-script }}'
FFTW_INSTALL_DIR: "C:/Program Files/fftw"
ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}'
INSTALLER_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.installer-suffix }}'
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: prepare timestamp for cache
id: current-date
shell: bash
run: echo "stamp=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: cache vcpkg
if: matrix.vcpkg-triplet
uses: actions/cache@v3
with:
path: ~/AppData/Local/vcpkg/archives
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-arch }}-${{ matrix.vcpkg-triplet }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-arch }}-${{ matrix.vcpkg-triplet }}-
- name: cache ccache
uses: actions/cache@v3
with:
path: ~/AppData/Local/ccache # updated in ccache 4.7, see https://github.com/ccache/ccache/issues/1023
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-arch }}-${{ matrix.qt-arch }}-${{ matrix.qt-version }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-arch }}-${{ matrix.qt-arch }}-${{ matrix.qt-version }}-
- name: install qt using aqtinstall
uses: jurplel/install-qt-action@v3
with:
modules: ${{ matrix.qt-modules }}
version: ${{ matrix.qt-version }}
arch: ${{ matrix.qt-arch }}
cache: true
cache-key-prefix: ${{ runner.os }}-v1-${{ matrix.os-version }}-${{ matrix.qt-version }}-qt${{ matrix.qt-arch }}
- name: install ccache
shell: bash
run: |
choco install ccache --no-progress
echo "`echo c:/ProgramData/chocolatey/lib/ccache/tools/ccache*`" >> $GITHUB_PATH # put the direct path before the path of the choco's "shim" (link subsitute)
- name: install libsndfile
shell: bash
run: |
if [[ -n "${{ matrix.vcpkg-triplet }}" ]]; then
vcpkg install libsndfile --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
else
choco install libsndfile --no-progress ${{ matrix.chocolatey-options }}
fi
- name: download fftw
shell: bash
run: |
mkdir -p "$FFTW_INSTALL_DIR" && cd "$FFTW_INSTALL_DIR"
curl -L ${{ matrix.fftw-url }} -o fftw.zip
7z x fftw.zip -y
- name: create fftw msvc library
if: matrix.vcvars-script
shell: cmd
working-directory: ${{ env.FFTW_INSTALL_DIR }}
run: |
call "%VCVARS_SCRIPT_PATH%"
lib.exe /machine:${{ matrix.fftw-arch }} /def:libfftw3f-3.def
- name: install asio sdk
shell: bash
env:
ASIO_PATH: ${{ env.LIBS_DOWNLOAD_PATH }}/asio_sdk
run: |
mkdir -p $ASIO_PATH && cd $ASIO_PATH
curl -L https://www.steinberg.net/asiosdk -o asio.zip
7z x asio.zip -y
mv asiosdk_* $GITHUB_WORKSPACE/external_libraries/portaudio/asiosdk
- name: install readline
if: matrix.vcpkg-triplet
shell: bash
run: |
vcpkg install readline --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
- name: configure
shell: bash
run: |
export PATH=$Qt5_DIR/bin:$PATH
export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
mkdir $BUILD_PATH && cd $BUILD_PATH
cmake -G "${{ matrix.cmake-generator }}" -A "${{ matrix.cmake-arch }}" -D CMAKE_PREFIX_PATH="$Qt5_DIR" -D SUPERNOVA=ON -D SC_USE_QTWEBENGINE=${{ matrix.use-qtwebengine }} -D CMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET="${{ matrix.vcpkg-triplet }}" .. # build type is specified here for MinGW build and for vcpkg
- name: build
shell: bash
run: |
cmake --build $BUILD_PATH --config Release --target install --parallel 2
- name: create archive
if: matrix.artifact-suffix
shell: bash
run: cd $INSTALL_PATH && 7z a $ARTIFACT_FILE.zip -tzip SuperCollider # this assumes that we end up with the build in the folder SuperCollider
- name: upload artifacts
uses: actions/upload-artifact@v3
if: matrix.artifact-suffix
with:
name: ${{ env.ARTIFACT_FILE }}
path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}.zip
- name: create installer
if: matrix.create-installer == true
shell: bash
run: |
export PATH="C:\Program Files (x86)\NSIS":$PATH
cmake --build $BUILD_PATH --config Release --target installer
- name: upload installer
uses: actions/upload-artifact@v3
if: matrix.create-installer == true
with:
name: ${{ env.INSTALLER_FILE }}
path: ${{ env.INSTALL_PATH }}/*.exe
test:
strategy:
fail-fast: false
matrix:
include:
- name: macOS
runs-on: macos-12
sclang: 'build/Install/SuperCollider/SuperCollider.app/Contents/MacOS/sclang'
artifact-suffix: macOS-universal
artifact-extension: '.dmg'
- name: Linux
runs-on: ubuntu-22.04
sclang: 'build/Install/bin/sclang'
artifact-suffix: linux-jammy-gcc12
# - name: Windows
# runs-on: windows-2022
# sclang: 'build/Install/SuperCollider/sclang'
# artifact-suffix: win64
needs: [lint, Linux, macOS, Windows] # unfortunately we can't use matrix expression here to make Linux test depend only on Linux build
runs-on: '${{ matrix.runs-on }}'
name: 'test on ${{ matrix.name }}'
env:
INSTALL_PATH: ${{ github.workspace }}/build/Install
ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}${{ matrix.artifact-extension }}'
TESTS_PATH: ${{ github.workspace }}/testsuite/classlibrary
SCLANG: ${{ github.workspace }}/${{ matrix.sclang }}
TEST_LIST_PROTO: ${{ github.workspace }}/testsuite/scripts/test_run_proto_gha.scd
TEST_LIST_RESULT: ${{ github.workspace }}/testsuite/scripts/run/gha_result.scxtar
SCRIPT_RUN_TESTS: ${{ github.workspace }}/testsuite/scripts/sclang_test_runner.scd
SCRIPT_ADD_PATH: ${{ github.workspace }}/testsuite/scripts/add_include_path.scd
SCRIPT_PRINT_RESULTS: ${{ github.workspace }}/testsuite/scripts/print_results.scd
steps:
- uses: actions/checkout@v3
with:
submodules: false # don't need submodules for testing
- name: download artifacts
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_FILE }}
path: ${{ env.INSTALL_PATH }}
- name: extract artifact
shell: bash
run: |
cd $INSTALL_PATH
echo Contents of `pwd`:
ls
if [[ ${{ runner.os }} == "macOS" ]]; then
hdiutil attach $ARTIFACT_FILE
echo "mkdir SuperCollider"
mkdir SuperCollider
cp -R /Volumes/SuperCollider/* SuperCollider/
else
unzip $ARTIFACT_FILE.zip
fi
- name: setup Linux environment
if: runner.os == 'Linux'
run: |
# install dependencies
sudo apt-get update
sudo apt-get install --yes libsndfile1 libavahi-client-dev libfftw3-dev libicu-dev libudev-dev qtbase5-dev qtwebengine5-dev jackd1 socat
# add bin to PATH so that scsynth can be found
echo "$INSTALL_PATH/bin" >> $GITHUB_PATH
# start jack
jackd --no-realtime --silent -d dummy &
# start virtual display server
export DISPLAY=:99
echo "DISPLAY=$DISPLAY" >> $GITHUB_ENV
Xvfb $DISPLAY -screen 0 1024x768x16 &
- name: setup macOS environment
if: runner.os == 'macOS'
env:
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: brew install coreutils # to get 'timeout' utility
- name: setup Windows environment
if: runner.os == 'Windows'
shell: bash
run: |
# install jack
# even though SC on Windows doesn't use JACK directly
# it will use JackRouter ASIO device
curl -O -J -L https://github.com/jackaudio/jack2-releases/releases/download/v1.9.22/jack2-win64-v1.9.22.exe
echo "installing JACK2"
./jack2-win64-v1.9.22.exe //TYPE="router" //SILENT //SUPPRESSMSGBOXES
# add bin to PATH so that scsynth can be found
echo "$INSTALL_PATH/SuperCollider" >> $GITHUB_PATH
# start jack
/c/Program\ Files/JACK2/jackd.exe --no-realtime -d dummy &
- name: run tests
shell: bash
continue-on-error: true
run: |
# add path
$SCLANG $SCRIPT_ADD_PATH $TESTS_PATH
# run tests
timeout 1200 $SCLANG $SCRIPT_RUN_TESTS $TEST_LIST_PROTO $TEST_LIST_RESULT
- name: post test results
shell: bash
run: |
$SCLANG $SCRIPT_PRINT_RESULTS $TEST_LIST_RESULT
deploy_s3:
strategy:
fail-fast: false
matrix:
include:
- artifact-suffix: macOS-universal
s3-os-name: osx
s3-artifact-suffx: ''
s3-artifact-extension: 'dmg'
artifact-extension: '.dmg' # for download-artifacts action, for non-zip only, should include `.`
s3-create-latest-link: true # create link to pointing to the "latest" build; activate only one per branch per s3-os-name
- artifact-suffix: win32
s3-os-name: win32
s3-artifact-suffx: ''
s3-artifact-extension: 'zip'
s3-create-latest-link: true # create link to pointing to the "latest" build
- artifact-suffix: win64
s3-os-name: win64
s3-artifact-suffx: ''
s3-artifact-extension: 'zip'
s3-create-latest-link: true # create link to pointing to the "latest" build
if: github.repository_owner == 'supercollider' && github.event_name != 'pull_request' # run in the main repo, but not on pull requests
needs: [lint, macOS, Windows]
runs-on: ubuntu-latest
name: 'deploy ${{ matrix.artifact-suffix }} to s3'
env:
INSTALL_PATH: ${{ github.workspace }}/build/Install
ARTIFACT_FILE: SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}${{ matrix.artifact-extension }}
UPLOAD_TO_S3: ${{ (secrets.S3_ACCESS_KEY_ID != 0) && !startsWith(github.ref, 'refs/tags/') }}
S3_CREATE_LATEST_LINK: ${{ matrix.s3-create-latest-link && (secrets.S3_ACCESS_KEY_ID != 0) && startsWith(github.ref, 'refs/heads/') }}
S3_ARTIFACT_PATH: ${{ github.workspace }}/build/s3-upload
S3_ARTIFACT_NAME: SC-${{ github.sha }}${{ matrix.s3-artifact-suffx }}.${{ matrix.s3-artifact-extension }}
S3_BUILD_LOCATION: builds/supercollider/supercollider/${{ matrix.s3-os-name }}
S3_ROOT_URL: 'https://supercollider.s3.amazonaws.com'
steps:
- name: download artifacts
uses: actions/download-artifact@v3
if: env.UPLOAD_TO_S3 == 'true'
with:
name: ${{ env.ARTIFACT_FILE }}
path: ${{ env.INSTALL_PATH }}
- name: preapre s3 upload
if: env.UPLOAD_TO_S3 == 'true'
run: |
mkdir $S3_ARTIFACT_PATH
mv $INSTALL_PATH/*.* $S3_ARTIFACT_PATH/$S3_ARTIFACT_NAME
# set S3_BUILD_LOCATION
echo 'S3_BUILD_URL<<EOF' >> $GITHUB_ENV
echo ${{ env.S3_ROOT_URL }}/${{ env.S3_BUILD_LOCATION }}/${{ env.S3_ARTIFACT_NAME }} >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
if [[ $S3_CREATE_LATEST_LINK == true ]]; then
# set LATEST_HTML_PATH and LATEST_HTML_URL
echo 'LATEST_HTML_PATH<<EOF' >> $GITHUB_ENV
echo ${{ env.S3_ARTIFACT_PATH }}/${GITHUB_REF#refs/heads/}-latest.html >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
echo 'LATEST_HTML_URL<<EOF' >> $GITHUB_ENV
echo ${{ env.S3_ROOT_URL }}/${{ env.S3_BUILD_LOCATION }}/${GITHUB_REF#refs/heads/}-latest.html >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
fi
- name: create latest link
if: env.S3_CREATE_LATEST_LINK == 'true'
env:
FWD_HTML: '<html><head><meta http-equiv="refresh" content="0; url=''${{ env.S3_BUILD_URL }}''" /></head></html>'
run: |
mkdir -p "${LATEST_HTML_PATH%/*}"
echo writing $FWD_HTML to $LATEST_HTML_PATH
echo $FWD_HTML > $LATEST_HTML_PATH
echo html file contents:
cat $LATEST_HTML_PATH
- name: upload to S3
uses: jakejarvis/s3-sync-action@master
if: env.UPLOAD_TO_S3 == 'true'
with:
args: --acl public-read
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET: supercollider
AWS_S3_ENDPOINT: https://s3-us-west-2.amazonaws.com
AWS_REGION: 'us-west-2'
SOURCE_DIR: ${{ env.S3_ARTIFACT_PATH }}
DEST_DIR: ${{ env.S3_BUILD_LOCATION }}
- name: post S3 build location
if: env.UPLOAD_TO_S3 == 'true'
run: |
echo "::group::S3 build location"
echo $S3_BUILD_URL
if [[ -n "$LATEST_HTML_URL" ]]; then echo $LATEST_HTML_URL; fi
echo "::endgroup::"
# release - list of files uploaded to GH release is specified in the *upload* step
deploy_gh:
if: startsWith(github.ref, 'refs/tags/') # run on tagged commits
needs: [lint, macOS, Windows]
runs-on: ubuntu-latest
name: 'deploy release'
env:
INSTALL_PATH: ${{ github.workspace }}/Install
ARTIFACT_FILE_PREFIX: 'SuperCollider-${{ needs.lint.outputs.sc-version }}'
steps:
- name: download artifacts
uses: actions/download-artifact@v3
with:
path: ${{ env.INSTALL_PATH }} # no "name" paramter - download all artifacts
- name: upload to the release page
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-macOS-x64.dmg/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-macOS-universal.dmg/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-macOS-arm64.dmg/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-macOS-x64-legacy.dmg/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-win32-installer/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-win64-installer/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-win32/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-win64/*
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}