-
-
Notifications
You must be signed in to change notification settings - Fork 9
446 lines (433 loc) · 13.7 KB
/
build.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
name: Build UIs
on:
push:
branches:
- 'develop'
- 'master'
tags:
- '[0-9]*'
pull_request:
branches:
- '*'
# Manual builds in all branches
workflow_dispatch:
branches:
- '*'
env:
build_type: Release
# defaults:
# shell: pwsh on windows, bash all the rest
# working-directory: ${{ github.workspace }}
jobs:
clang_tidy:
if: ${{ github.ref_type == 'branch' }}
name: Clang Tidy
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install clang-tidy
- name: Run
run: ./scripts/run_clang_tidy.sh
build_for_linux:
name: Linux Ubuntu 22.04
runs-on: ubuntu-22.04 # abseil (libabsl) is not available in 20.04 repository
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout lv2lint
uses: actions/checkout@v3
with:
repository: sfztools/lv2lint
path: lv2lint
ref: '0.16.2'
- name: Python Setup # lv2lint
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
lv2lint_packages=(
libcurl4-openssl-dev
libelf-dev
liblilv-dev
lv2-dev
)
packages=(
libcairo2-dev
libfontconfig1-dev
libjack-jackd2-dev
libpango1.0-dev
libx11-xcb-dev
libxcb-cursor-dev
libxcb-keysyms1-dev
libxcb-util-dev
libxcb-xkb-dev
libxkbcommon-dev
libxkbcommon-x11-dev
ninja-build
)
sudo apt-get update && sudo apt-get install ${packages[@]} ${lv2lint_packages[@]}
pip3 install meson
- name: Install abseil
if: ${{ github.ref_type == 'branch' }}
run: |
sudo apt-get install \
libabsl-dev \
libabsl20210324
- name: Configure CMake
run: |
options=(
-G Ninja
-B build
-S .
-D CMAKE_BUILD_TYPE=${{ env.build_type }}
-D SFIZZ_JACK=OFF
-D SFIZZ_RENDER=OFF
-D SFIZZ_SHARED=OFF
-D PLUGIN_LV2=ON
-D PLUGIN_LV2_UI=ON
-D PLUGIN_PUREDATA=ON
-D PLUGIN_VST3=ON
)
if [[ ${{ github.ref_type }} == 'branch' ]]; then
options=(
${options[@]}
-D SFIZZ_USE_SYSTEM_ABSEIL=ON
)
fi
cmake "${options[@]}"
echo "-- github.workspace: ${{ github.workspace }}"
echo "-- runner.workspace: ${{ runner.workspace }}"
- name: Build
run: |
options=(
--build build
--config ${{ env.build_type }}
--parallel 2
--verbose
)
cmake "${options[@]}"
- name: Build and install lv2lint
working-directory: ${{ github.workspace }}/lv2lint
run: |
meson setup -Donline-tests=enabled -Delf-tests=enabled buildl2l
cd buildl2l
ninja
sudo ninja install
- name: Run lv2lint
run: lv2lint -I build/sfizz.lv2 "http://sfztools.github.io/sfizz"
# No custom Linux packages, build from sources or provided in distro
build_for_macos:
name: macOS 11
runs-on: macos-11
steps:
- name: Update bash
run: brew install bash
- name: Set install_name
run: |
ghref=${{ github.ref_name }}
echo "install_name=sfizz-${ghref//'/'/'-'}-macos" >> "$GITHUB_ENV"
- name: Show summary
run: |
echo "install_name: ${{ env.install_name }}"
echo "BASH_VERSION: $BASH_VERSION"
system_profiler SPSoftwareDataType
cmake --version
gcc -v
xcodebuild -version
- name: Install dependencies
if: ${{ github.ref_type == 'branch' }}
run: brew install abseil
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure CMake
run: |
options=(
-B build
-S .
-D CMAKE_BUILD_TYPE=${{ env.build_type }}
-D SFIZZ_SHARED=OFF
-D PLUGIN_AU=ON
-D PLUGIN_LV2=ON
-D PLUGIN_LV2_UI=ON
-D PLUGIN_VST3=ON
)
if [[ ${{ github.ref_type }} == 'branch' ]]; then
options=(
${options[@]}
-D SFIZZ_USE_SYSTEM_ABSEIL=ON
)
else
options=(
${options[@]}
-D CMAKE_OSX_ARCHITECTURES="arm64;x86_64"
)
fi
cmake "${options[@]}"
echo "-- runner.workspace: ${{ runner.workspace }}"
echo "-- github.workspace: ${{ github.workspace }}"
- name: Build
run: |
options=(
--build build
--config ${{ env.build_type }}
--parallel 2
--verbose
)
cmake "${options[@]}"
lipo -i ./build/sfizz.component/Contents/MacOS/sfizz
- name: Validate AU
working-directory: ${{ github.workspace }}/build
# Force a rescan after copy (thank you @PythonBlue), see
# https://gist.github.com/olilarkin/8f378d212b0a59944d84f9f47061d70f#v2-audiounits
run: |
sudo cp -r ./sfizz.component /Library/Audio/Plug-Ins/Components/
sudo killall -9 AudioComponentRegistrar
auval -v aumu samp Sfzt
- name: Package bundles
if: github.ref_type == 'tag' || github.event_name == 'pull_request'
run: ./scripts/package-osx-bundles.sh
- name: Create installer
if: github.ref_type == 'tag' || github.event_name == 'pull_request'
working-directory: ${{ github.workspace }}/build
run: |
options=(
--distribution ${{ github.workspace }}/scripts/plugin.pkg/package.xml
--identifier "sfz.tools.sfizz"
--package-path "${{ github.workspace }}/build"
--version 0
${{ env.install_name }}.pkg
)
productbuild "${options[@]}"
- name: Upload
if: github.ref_type == 'tag' || github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
with:
name: macOS package
path: "${{ github.workspace }}/build/${{ env.install_name }}.pkg"
build_for_windows:
name: Windows 2019
runs-on: windows-2019
strategy:
matrix:
include:
- platform: x86
pkg_platform: Win32
release_arch: Win32
bits: 32
- platform: x64
pkg_platform: Win64
release_arch: x64
bits: 64
steps:
- name: Set install name
run: |
$stripped_name="${{ github.ref_name }}".replace('/', '-')
echo "install_name=sfizz-$stripped_name-win${{ matrix.bits }}" >> "${env:GITHUB_ENV}"
- name: Show summary
run: |
echo "install_name: $env:install_name"
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure CMake
run: |
cmake `
-G "Visual Studio 16 2019" `
-A "${{ matrix.release_arch }}" `
-B build `
-S . `
-D CMAKE_BUILD_TYPE=${{ env.build_type }} `
-D PLUGIN_LV2=ON `
-D PLUGIN_PUREDATA=ON `
-D PLUGIN_VST3=ON
echo "-- runner.workspace: ${{ runner.workspace }}"
echo "-- github.workspace: ${{ github.workspace }}"
- name: Build
run: |
cmake `
--build build `
--config ${{ env.build_type }} `
--parallel 2 `
--verbose `
- name: Install pluginval
if: ${{ matrix.platform == 'x64' }}
run: |
Invoke-WebRequest `
https://github.com/Tracktion/pluginval/releases/download/latest_release/pluginval_Windows.zip `
-OutFile pluginval.zip
Expand-Archive pluginval.zip -DestinationPath pluginval
echo "$(Get-Location)\pluginval" | Out-File `
-FilePath ${Env:GITHUB_PATH} `
-Encoding utf8 `
-Append
pluginval\pluginval --version
- name: Validate VST3
if: ${{ matrix.platform == 'x64' }}
working-directory: ${{ github.workspace }}/build
run: pluginval --validate-in-process --validate sfizz.vst3
- name: Create installer
if: github.ref_type == 'tag' || github.event_name == 'pull_request'
working-directory: ${{ github.workspace }}/build
run: iscc /O"." /F"${{ env.install_name }}" /dARCH="${{ matrix.platform }}" innosetup.iss
- name: Upload
if: github.ref_type == 'tag' || github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.pkg_platform }} installer
path: "${{ github.workspace }}/build/${{ env.install_name }}.exe"
archive_source_code:
if: ${{ github.ref_type == 'tag' }}
name: Source code archive
runs-on: ubuntu-20.04
env:
install_name: sfizz-${{ github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install python3-pip
sudo pip install git-archive-all
- name: Archive source code
run: |
git-archive-all \
--prefix="${{ env.install_name }}/" \
-9 "${{ github.workspace }}/${{ env.install_name }}.tar.gz"
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Source code tarball
path: "${{ github.workspace }}/${{ env.install_name }}.tar.gz"
build_for_mod:
if: ${{ false }} # DISABLED: Old image which doesn't work with CMake > 3.5
name: MOD
runs-on: ubuntu-20.04
container:
image: jpcima/mod-plugin-builder
options: --user 0
env:
install_name: sfizz-${{ github.ref_name }}-moddevices
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Fix up MOD environment
shell: bash
run: ln -sf /home/builder/mod-workdir ~/mod-workdir
- name: Configure CMake
shell: bash
working-directory: ${{ runner.workspace }}
run: |
mod-plugin-builder /usr/local/bin/cmake \
-B build \
-S "$GITHUB_WORKSPACE" \
-D PROJECT_SYSTEM_PROCESSOR=armv7-a \
-D CMAKE_BUILD_TYPE=Release \
-D SFIZZ_JACK=OFF \
-D PLUGIN_VST3=OFF \
-D PLUGIN_LV2_UI=OFF
- name: Build
shell: bash
working-directory: ${{ runner.workspace }}
run: |
mod-plugin-builder /usr/local/bin/cmake \
--build build --config ${{ env.build_type }} -- -j 2
- name: Install
working-directory: ${{ runner.workspace }}
shell: bash
run: |
DESTDIR="$(pwd)/${{ env.install_name }}" mod-plugin-builder \
/usr/local/bin/cmake --build build --config ${{ env.build_type }} --target install
tar czvf "${{ env.install_name }}".tar.gz "${{ env.install_name }}"
- name: Upload
uses: actions/upload-artifact@v3
with:
name: MOD devices tarball
path: "${{ runner.workspace }}/${{ env.install_name }}.tar.gz"
deploy:
if: ${{ github.ref_type == 'tag' }}
runs-on: ubuntu-20.04
needs:
- build_for_macos
# - build_for_mod
- build_for_windows
- archive_source_code
steps:
- name: macOS download
uses: actions/download-artifact@v3
with:
name: macOS package
- name: Windows 32 download
uses: actions/download-artifact@v3
with:
name: Win32 installer
- name: Windows 64 download
uses: actions/download-artifact@v3
with:
name: Win64 installer
- name: Source code download
uses: actions/download-artifact@v3
with:
name: Source code tarball
- name: MOD download
if: ${{ false }} # DISABLED: See comment above
uses: actions/download-artifact@v3
with:
name: MOD devices tarball
- name: Display file information
run: ls -lR
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: false
prerelease: false
files: |
sfizz-${{ github.ref_name }}-*
sfizz-${{ github.ref_name }}.*
update_website:
if: github.ref_type == 'tag'
name: Update website
needs: deploy
runs-on: ubuntu-latest
# Automate the creation of a post and atom feed to announce
# about the new version just released, and update the download links.
# We wants to make working this also with forks for testing purposes,
# so the site repository, branch and token names should be hardcoded
# to work at least with those having the same local settings:
# from "repository_owner/sfizz_fork" to "repository_owner/sfztools.github.io".
# So a classic token needed for authentication must be added in secrets
# with SITE_UPDATE_TOKEN as name (or please let us know if it's possible
# and eventually how to make it work with GITHUB_TOKEN instead).
steps:
- name: Build site
env:
api_version: "2022-11-28"
site_repo: sfztools.github.io
site_branch: master
site_workflow: build.yml
token: ${{ secrets.SITE_UPDATE_TOKEN }}
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ env.token }}" \
-H "X-GitHub-Api-Version: ${{ env.api_version }}" \
https://api.github.com/repos/${{ github.repository_owner }}/${{ env.site_repo }}/actions/workflows/${{ env.site_workflow }}/dispatches \
-d '{"ref":"${{ env.site_branch }}"}'