You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

707 lines
31KB

  1. name: build
  2. on: [push, pull_request]
  3. env:
  4. CACHE_VERSION: 3
  5. CARDINAL_UNDER_WINE: 1
  6. CIBUILD: true
  7. EMSCRIPTEN_VERSION: 3.1.27
  8. DEBIAN_FRONTEND: noninteractive
  9. HOMEBREW_NO_AUTO_UPDATE: 1
  10. LIBGL_ALWAYS_SOFTWARE: true
  11. PAWPAW_SKIP_LTO: 1
  12. jobs:
  13. linux:
  14. strategy:
  15. matrix:
  16. target: [aarch64, armhf, i386, riscv64, x86_64]
  17. runs-on: ubuntu-20.04
  18. steps:
  19. - uses: actions/checkout@v3
  20. with:
  21. submodules: recursive
  22. - name: Set up build cache
  23. id: cache
  24. uses: actions/cache@v3
  25. with:
  26. path: |
  27. ~/PawPawBuilds
  28. src/Rack/dep/bin
  29. src/Rack/dep/include
  30. src/Rack/dep/lib
  31. src/Rack/dep/share
  32. src/Rack/dep/jansson-2.12
  33. src/Rack/dep/libarchive-3.4.3
  34. src/Rack/dep/libsamplerate-0.1.9
  35. src/Rack/dep/speexdsp-SpeexDSP-1.2rc3
  36. src/Rack/dep/zstd-1.4.5
  37. key: linux-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  38. - name: Fix GitHub's mess
  39. run: |
  40. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  41. sudo apt-get update -qq
  42. sudo apt-get install -yqq --allow-downgrades libgd3/focal libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal
  43. sudo apt-get purge -yqq libclang* libgbm* libllvm* libmono* moby* mono* php* libgdiplus libpcre2-posix3 libzip4
  44. sudo apt-get clean
  45. - name: Setup dependencies (aarch64)
  46. if: ${{ matrix.target == 'aarch64' }}
  47. shell: bash
  48. run: |
  49. sudo dpkg --add-architecture arm64
  50. sudo sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list
  51. echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports-arm64.list
  52. echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-arm64.list
  53. echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-arm64.list
  54. sudo apt-get update -qq
  55. sudo apt-get install -yqq g++-aarch64-linux-gnu libasound2-dev:arm64 libdbus-1-dev:arm64 libgl1-mesa-dev:arm64 libglib2.0-dev:arm64 libsdl2-dev:arm64 libx11-dev:arm64 libxcursor-dev:arm64 libxext-dev:arm64 libxrandr-dev:arm64 gperf qemu-user-static
  56. sudo apt-get clean
  57. - name: Setup dependencies (armhf)
  58. if: ${{ matrix.target == 'armhf' }}
  59. shell: bash
  60. run: |
  61. sudo dpkg --add-architecture armhf
  62. sudo sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list
  63. echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports-armhf.list
  64. echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-armhf.list
  65. echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-armhf.list
  66. sudo apt-get update -qq
  67. sudo apt-get install -yqq g++-arm-linux-gnueabihf libasound2-dev:armhf libdbus-1-dev:armhf libgl1-mesa-dev:armhf libglib2.0-dev:armhf libsdl2-dev:armhf libx11-dev:armhf libxcursor-dev:armhf libxext-dev:armhf libxrandr-dev:armhf gperf qemu-user-static
  68. sudo apt-get clean
  69. - name: Setup dependencies (i386)
  70. if: ${{ matrix.target == 'i386' }}
  71. shell: bash
  72. run: |
  73. sudo dpkg --add-architecture i386
  74. sudo apt-get update -qq
  75. sudo apt-get install -yqq g++-i686-linux-gnu libasound2-dev:i386 libdbus-1-dev:i386 libgl1-mesa-dev:i386 libglib2.0-dev:i386 libsdl2-dev:i386 libx11-dev:i386 libxcursor-dev:i386 libxext-dev:i386 libxrandr-dev:i386 gperf
  76. sudo apt-get clean
  77. - name: Setup dependencies (riscv64)
  78. if: ${{ matrix.target == 'riscv64' }}
  79. shell: bash
  80. run: |
  81. sudo dpkg --add-architecture riscv64
  82. sudo sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list
  83. echo "deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports focal main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports-riscv64.list
  84. echo "deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-riscv64.list
  85. echo "deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-riscv64.list
  86. sudo apt-get update -qq
  87. sudo apt-get install -yqq g++-riscv64-linux-gnu libasound2-dev:riscv64 libdbus-1-dev:riscv64 libgl1-mesa-dev:riscv64 libglapi-mesa:riscv64 libglvnd0:riscv64 libglib2.0-dev:riscv64 libsdl2-dev:riscv64 libx11-dev:riscv64 libxcursor-dev:riscv64 libxext-dev:riscv64 libxrandr-dev:riscv64 gperf qemu-user-static
  88. sudo apt-get clean
  89. - name: Setup dependencies (x86_64)
  90. if: ${{ matrix.target == 'x86_64' }}
  91. shell: bash
  92. run: |
  93. sudo apt-get update -qq
  94. sudo apt-get install -yqq libasound2-dev libdbus-1-dev libgl1-mesa-dev libglib2.0-dev libsdl2-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev gperf
  95. sudo apt-get clean
  96. - name: Set up ccache
  97. uses: hendrikmuhs/ccache-action@v1.2
  98. with:
  99. key: ccache-linux-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  100. - name: Build extra dependencies
  101. env:
  102. PKG_CONFIG_PATH: /usr/lib/${{ matrix.target }}-linux-gnu/pkgconfig
  103. run: |
  104. ./deps/PawPaw/bootstrap-cardinal.sh linux-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh linux-${{ matrix.target }}
  105. - name: Build linux
  106. run: |
  107. export PATH="/usr/lib/ccache:${PATH}"
  108. source deps/PawPaw/local.env linux-${{ matrix.target }}
  109. export PKG_CONFIG_PATH+=:/usr/lib/${{ matrix.target }}-linux-gnu/pkgconfig
  110. make features
  111. make HAVE_PULSEAUDIO=false NOOPT=true -j $(nproc)
  112. make unzipfx
  113. - name: Set sha8 (non-release)
  114. if: startsWith(github.ref, 'refs/tags/') != true
  115. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  116. - name: Set sha8 (release)
  117. if: startsWith(github.ref, 'refs/tags/')
  118. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  119. - name: Pack binaries
  120. run: |
  121. tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-linux-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep -e lv2 -e vst -e clap) ../CardinalJACK ../CardinalNative ../LICENSE ../README.md ../docs
  122. - uses: actions/upload-artifact@v3
  123. with:
  124. name: ${{ github.event.repository.name }}-linux-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  125. path: |
  126. *.tar.gz
  127. - uses: softprops/action-gh-release@v1
  128. if: startsWith(github.ref, 'refs/tags/')
  129. with:
  130. tag_name: ${{ github.ref_name }}
  131. name: ${{ github.ref_name }}
  132. draft: false
  133. prerelease: false
  134. files: |
  135. *.tar.gz
  136. linux-x86_64-debug:
  137. runs-on: ubuntu-20.04
  138. steps:
  139. - uses: actions/checkout@v3
  140. with:
  141. submodules: recursive
  142. - name: Set up dependencies
  143. run: |
  144. sudo apt-get update -qq
  145. sudo apt-get install -yqq libasound2-dev libdbus-1-dev libgl1-mesa-dev liblo-dev libsdl2-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev gperf
  146. sudo apt-get clean
  147. - name: Build linux x86_64 (debug)
  148. env:
  149. LDFLAGS: -static-libgcc -static-libstdc++
  150. run: |
  151. make features
  152. # multiple jobs for building carla, deps and plugins
  153. make DEBUG=true carla deps dgl plugins resources -j $(nproc)
  154. # single job for final build stage, otherwise we might get killed due to OOM
  155. make DEBUG=true HAVE_PULSEAUDIO=false -j 1
  156. - name: Set sha8
  157. id: slug
  158. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  159. - name: Pack binaries
  160. run: |
  161. tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-linux-x86_64-debug-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep -e lv2 -e vst -e clap) ../LICENSE ../README.md ../docs
  162. - uses: actions/upload-artifact@v3
  163. with:
  164. name: ${{ github.event.repository.name }}-linux-x86_64-debug-${{ github.event.pull_request.number || env.SHA8 }}
  165. path: |
  166. *.tar.gz
  167. macos:
  168. strategy:
  169. matrix:
  170. target: [universal-10.15]
  171. runs-on: macos-11
  172. steps:
  173. - uses: actions/checkout@v3
  174. with:
  175. submodules: recursive
  176. - name: Set up cache
  177. id: cache
  178. uses: actions/cache@v3
  179. with:
  180. path: |
  181. ~/PawPawBuilds
  182. src/Rack/dep/bin
  183. src/Rack/dep/include
  184. src/Rack/dep/lib
  185. src/Rack/dep/share
  186. src/Rack/dep/jansson-2.12
  187. src/Rack/dep/libarchive-3.4.3
  188. src/Rack/dep/libsamplerate-0.1.9
  189. src/Rack/dep/speexdsp-SpeexDSP-1.2rc3
  190. src/Rack/dep/zstd-1.4.5
  191. key: macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  192. - name: Build extra dependencies
  193. run: |
  194. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  195. ./deps/PawPaw/bootstrap-cardinal.sh macos-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh macos-${{ matrix.target }}
  196. - name: Set up ccache
  197. if: steps.cache.outputs.cache-hit == 'true'
  198. uses: hendrikmuhs/ccache-action@v1.2
  199. with:
  200. key: ccache-macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  201. - name: Build macOS (base)
  202. if: steps.cache.outputs.cache-hit == 'true'
  203. run: |
  204. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  205. source deps/PawPaw/local.env macos-${{ matrix.target }}
  206. make features
  207. make NOOPT=true -j $(sysctl -n hw.logicalcpu)
  208. - name: Build macOS (AU using juce)
  209. if: steps.cache.outputs.cache-hit == 'true'
  210. run: |
  211. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  212. source deps/PawPaw/local.env macos-${{ matrix.target }}
  213. mkdir -p jucewrapper/build
  214. pushd jucewrapper/build; cmake -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd
  215. mv jucewrapper/build/*_artefacts/Release/AU/*.component bin/
  216. - name: Build macOS (packaging)
  217. if: steps.cache.outputs.cache-hit == 'true'
  218. env:
  219. MACOS_ARCHS: 'arm64,x86_64'
  220. run: |
  221. source deps/PawPaw/local.env macos-${{ matrix.target }}
  222. ./utils/create-macos-installer.sh
  223. - name: Set sha8 (non-release)
  224. if: startsWith(github.ref, 'refs/tags/') != true
  225. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  226. - name: Set sha8 (release)
  227. if: startsWith(github.ref, 'refs/tags/')
  228. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  229. - name: Rename macOS bundle
  230. if: steps.cache.outputs.cache-hit == 'true'
  231. run: |
  232. mv ${{ github.event.repository.name }}-macOS.pkg ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.pkg
  233. - uses: actions/upload-artifact@v3
  234. with:
  235. name: ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  236. path: |
  237. ${{ github.event.repository.name }}-*.pkg
  238. - uses: softprops/action-gh-release@v1
  239. if: startsWith(github.ref, 'refs/tags/')
  240. with:
  241. tag_name: ${{ github.ref_name }}
  242. name: ${{ github.ref_name }}
  243. draft: false
  244. prerelease: false
  245. files: |
  246. ${{ github.event.repository.name }}-*.pkg
  247. modaudio:
  248. strategy:
  249. matrix:
  250. include:
  251. - name: modduo
  252. target: modduo-static
  253. extraflags: MODDUO=true
  254. - name: modduox
  255. target: modduox-static
  256. - name: moddwarf
  257. target: moddwarf
  258. runs-on: ubuntu-20.04
  259. steps:
  260. - uses: actions/checkout@v3
  261. with:
  262. submodules: recursive
  263. - name: Set up cache
  264. uses: actions/cache@v3
  265. id: mpb-cache
  266. with:
  267. path: |
  268. ~/mod-workdir
  269. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  270. - name: Set up dependencies
  271. run: |
  272. sudo apt-get update -qq
  273. sudo apt-get install -yqq acl bc curl cvs git mercurial rsync subversion wget bison bzip2 flex gawk gperf gzip help2man nano perl patch tar texinfo unzip automake binutils build-essential cpio libtool libncurses-dev pkg-config python libtool-bin liblo-dev qemu-user-static
  274. sudo apt-get install -yqq pandoc texlive-latex-recommended texlive-latex-extra
  275. sudo apt-get clean
  276. - name: Bootstrap toolchain
  277. if: steps.mpb-cache.outputs.cache-hit != 'true'
  278. run: |
  279. git clone --depth=1 https://github.com/moddevices/mod-plugin-builder.git deps/mod-plugin-builder
  280. sed -i "s/CT_LOG_PROGRESS_BAR=y/CT_LOG_PROGRESS_BAR=n/" deps/mod-plugin-builder/toolchain/*.config
  281. $(pwd)/deps/mod-plugin-builder/bootstrap.sh ${{ matrix.target }} minimal && $(pwd)/deps/mod-plugin-builder/.clean-install.sh ${{ matrix.target }}
  282. - name: Build for modaudio
  283. if: steps.mpb-cache.outputs.cache-hit == 'true'
  284. run: |
  285. make HEADLESS=true ${{ matrix.name }}-features
  286. make HEADLESS=true ${{ matrix.extraflags }} ${{ matrix.name }} -j $(nproc)
  287. - name: Set sha8
  288. id: slug
  289. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  290. - name: Pack binaries
  291. if: steps.mpb-cache.outputs.cache-hit == 'true'
  292. run: |
  293. tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-${{ matrix.name }}-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep lv2)
  294. - uses: actions/upload-artifact@v3
  295. with:
  296. name: ${{ github.event.repository.name }}-${{ matrix.name }}-${{ github.event.pull_request.number || env.SHA8 }}
  297. path: |
  298. *.tar.gz
  299. wasm:
  300. strategy:
  301. matrix:
  302. target: [simd, nosimd]
  303. runs-on: ubuntu-22.04
  304. steps:
  305. - uses: actions/checkout@v3
  306. with:
  307. submodules: recursive
  308. - name: Set up cache
  309. id: cache
  310. uses: actions/cache@v3
  311. with:
  312. path: |
  313. ~/PawPawBuilds
  314. src/Rack/dep/bin
  315. src/Rack/dep/include
  316. src/Rack/dep/lib
  317. src/Rack/dep/share
  318. src/Rack/dep/jansson-2.12
  319. src/Rack/dep/libarchive-3.4.3
  320. src/Rack/dep/libsamplerate-0.1.9
  321. src/Rack/dep/speexdsp-SpeexDSP-1.2rc3
  322. src/Rack/dep/zstd-1.4.5
  323. key: wasm-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  324. - name: Set up dependencies
  325. run: |
  326. sudo apt-get update -qq
  327. sudo apt-get install -yqq brotli gperf
  328. sudo apt-get clean
  329. [ -e ~/PawPawBuilds/emsdk ] || git clone https://github.com/emscripten-core/emsdk.git ~/PawPawBuilds/emsdk
  330. cd ~/PawPawBuilds/emsdk && ./emsdk install ${{ env.EMSCRIPTEN_VERSION }} && ./emsdk activate ${{ env.EMSCRIPTEN_VERSION }}
  331. - name: Build extra dependencies
  332. run: |
  333. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  334. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  335. ./deps/PawPaw/bootstrap-cardinal.sh wasm && ./deps/PawPaw/.cleanup.sh wasm
  336. - name: Build wasm cross-compiled
  337. if: steps.cache.outputs.cache-hit == 'true'
  338. run: |
  339. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  340. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  341. source deps/PawPaw/local.env wasm
  342. # FIXME send patch upstream, assuming this works..
  343. sed -i -e 's/defined(__riscv)/defined(__riscv) || defined(__EMSCRIPTEN__)/' plugins/surgext/surge/src/common/globals.h
  344. make features
  345. make HAVE_LIBLO=false NOOPT=true NOSIMD=${{ matrix.target == 'nosimd' }} -j $(nproc)
  346. - name: Build modgui
  347. if: ${{ steps.cache.outputs.cache-hit == 'true' && matrix.target == 'nosimd' }}
  348. run: |
  349. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  350. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  351. source deps/PawPaw/local.env wasm
  352. make HAVE_LIBLO=false NOOPT=true NOSIMD=true -j $(nproc) -C src/CardinalMiniSep modgui
  353. - name: Make wasm versioned and compress
  354. if: steps.cache.outputs.cache-hit == 'true'
  355. run: |
  356. ${{ matrix.target == 'nosimd' }} && export SUFFIX="-nosimd"
  357. VERSION=$(cat Makefile | awk 'sub("VERSION = ","")')
  358. cd bin
  359. sed -i "s/CardinalMini\./CardinalMini-v${VERSION}\./g" *.html *.js
  360. sed -i "s/CardinalNative\./CardinalNative-v${VERSION}\./g" *.html *.js
  361. sed -i "s/CardinalMini-nosimd\./CardinalMini-nosimd-v${VERSION}\./g" *.html *.js
  362. sed -i "s/CardinalNative-nosimd\./CardinalNative-nosimd-v${VERSION}\./g" *.html *.js
  363. mv CardinalMini.data CardinalMini${SUFFIX}-v${VERSION}.data
  364. mv CardinalMini.js CardinalMini${SUFFIX}-v${VERSION}.js
  365. mv CardinalMini.wasm CardinalMini${SUFFIX}-v${VERSION}.wasm
  366. mv CardinalNative.data CardinalNative${SUFFIX}-v${VERSION}.data
  367. mv CardinalNative.js CardinalNative${SUFFIX}-v${VERSION}.js
  368. mv CardinalNative.wasm CardinalNative${SUFFIX}-v${VERSION}.wasm
  369. brotli -k -q 11 *.data *.html *.js *.wasm
  370. - name: Set sha8 (non-release)
  371. if: startsWith(github.ref, 'refs/tags/') != true
  372. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  373. - name: Set sha8 (release)
  374. if: startsWith(github.ref, 'refs/tags/')
  375. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  376. - name: Pack binaries
  377. if: steps.cache.outputs.cache-hit == 'true'
  378. run: |
  379. cd bin; zip -r -9 ../${{ github.event.repository.name }}-wasm-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.zip $(ls *.br *.html *.data *.js *.wasm)
  380. - uses: actions/upload-artifact@v3
  381. with:
  382. name: ${{ github.event.repository.name }}-wasm-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  383. path: |
  384. *.zip
  385. - uses: softprops/action-gh-release@v1
  386. if: startsWith(github.ref, 'refs/tags/')
  387. with:
  388. tag_name: ${{ github.ref_name }}
  389. name: ${{ github.ref_name }}
  390. draft: false
  391. prerelease: false
  392. files: |
  393. *.zip
  394. windows:
  395. strategy:
  396. matrix:
  397. target: [win32, win64]
  398. runs-on: ubuntu-22.04
  399. steps:
  400. - uses: actions/checkout@v3
  401. with:
  402. submodules: recursive
  403. - name: Set up cache
  404. id: cache
  405. uses: actions/cache@v3
  406. with:
  407. path: |
  408. ~/PawPawBuilds
  409. src/Rack/dep/bin
  410. src/Rack/dep/include
  411. src/Rack/dep/lib
  412. src/Rack/dep/share
  413. src/Rack/dep/jansson-2.12
  414. src/Rack/dep/libarchive-3.4.3
  415. src/Rack/dep/libsamplerate-0.1.9
  416. src/Rack/dep/speexdsp-SpeexDSP-1.2rc3
  417. src/Rack/dep/zstd-1.4.5
  418. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  419. - name: Fix GitHub's mess
  420. run: |
  421. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  422. sudo dpkg --add-architecture i386
  423. sudo apt-get update -qq
  424. sudo apt-get install libc6:i386 libgcc-s1:i386 libstdc++6:i386 --allow-downgrades
  425. sudo apt-get clean
  426. - name: Set up dependencies
  427. if: ${{ matrix.target == 'win32' }}
  428. run: |
  429. sudo apt-get install -yqq binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 wine-stable:i386 gperf qttools5-dev qttools5-dev-tools xvfb
  430. sudo apt-get clean
  431. - name: Set up dependencies
  432. if: ${{ matrix.target == 'win64' }}
  433. run: |
  434. sudo apt-get install -yqq binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable gperf qttools5-dev qttools5-dev-tools xvfb
  435. sudo apt-get clean
  436. - name: Set up ccache
  437. uses: hendrikmuhs/ccache-action@v1.2
  438. with:
  439. key: ccache-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  440. - name: Build extra dependencies
  441. run: |
  442. ./deps/PawPaw/bootstrap-cardinal.sh ${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh ${{ matrix.target }}
  443. - name: Build cross-compiled (base)
  444. if: steps.cache.outputs.cache-hit == 'true'
  445. run: |
  446. export PATH="/usr/lib/ccache:${PATH}"
  447. source deps/PawPaw/local.env ${{ matrix.target }}
  448. make features
  449. make NOOPT=true -j $(nproc)
  450. - name: Build cross-compiled (carla)
  451. if: steps.cache.outputs.cache-hit == 'true'
  452. run: |
  453. export PATH="/usr/lib/ccache:${PATH}"
  454. source deps/PawPaw/local.env ${{ matrix.target }}
  455. make carla-win32 -j $(nproc)
  456. make -C carla EMBED_TARGET=true TESTING=true dist
  457. make -C carla EMBED_TARGET=true TESTING=true dist
  458. - name: Build cross-compiled (packaging)
  459. if: steps.cache.outputs.cache-hit == 'true'
  460. run: |
  461. source deps/PawPaw/local.env ${{ matrix.target }}
  462. xvfb-run ./utils/create-windows-installer.sh ${{ matrix.target }}
  463. make unzipfx
  464. - name: Set sha8 (non-release)
  465. if: startsWith(github.ref, 'refs/tags/') != true
  466. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  467. - name: Set sha8 (release)
  468. if: startsWith(github.ref, 'refs/tags/')
  469. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  470. - name: Pack binaries
  471. if: steps.cache.outputs.cache-hit == 'true'
  472. run: |
  473. pushd bin
  474. zip -r -9 ../${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.zip $(ls | grep -e lv2 -e vst -e clap)
  475. popd
  476. zip -u -9 ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.zip LICENSE README.md docs/*.* CardinalJACK.exe CardinalNative.exe
  477. - uses: actions/upload-artifact@v3
  478. with:
  479. name: ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  480. path: |
  481. Cardinal-*.exe
  482. Cardinal-*.zip
  483. - uses: softprops/action-gh-release@v1
  484. if: startsWith(github.ref, 'refs/tags/')
  485. with:
  486. tag_name: ${{ github.ref_name }}
  487. name: ${{ github.ref_name }}
  488. draft: false
  489. prerelease: false
  490. files: |
  491. Cardinal-*.exe
  492. Cardinal-*.zip
  493. headless:
  494. runs-on: ubuntu-20.04
  495. steps:
  496. - uses: actions/checkout@v3
  497. with:
  498. submodules: recursive
  499. - name: Set up dependencies
  500. run: |
  501. sudo apt-get update -qq
  502. sudo apt-get remove -yqq libcairo2-dev libx11-dev libx11-dev libxext-dev
  503. sudo apt-get install -yqq liblo-dev
  504. sudo apt-get clean
  505. - name: Build linux (headless)
  506. run: |
  507. make HEADLESS=true features
  508. make HEADLESS=true -j $(nproc)
  509. lto:
  510. runs-on: ubuntu-20.04
  511. steps:
  512. - uses: actions/checkout@v3
  513. with:
  514. submodules: recursive
  515. - name: Set up dependencies
  516. run: |
  517. sudo apt-get update -qq
  518. sudo apt-get install -yqq libasound2-dev libdbus-1-dev libgl1-mesa-dev liblo-dev libsdl2-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev gperf
  519. sudo apt-get clean
  520. - name: Build linux (LTO)
  521. run: |
  522. make features
  523. make WITH_LTO=true -j $(nproc)
  524. sysdeps:
  525. runs-on: ubuntu-20.04
  526. steps:
  527. - uses: actions/checkout@v3
  528. with:
  529. submodules: recursive
  530. - name: Set up dependencies
  531. run: |
  532. sudo apt-get update -qq
  533. sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev liblo-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev libarchive-dev libfftw3-dev libjansson-dev libsamplerate0-dev libsndfile1-dev libspeexdsp-dev
  534. sudo apt-get clean
  535. - name: Build linux (sysdeps)
  536. run: |
  537. make features
  538. make SYSDEPS=true -j $(nproc)
  539. source-tarball:
  540. runs-on: ubuntu-20.04
  541. steps:
  542. - uses: actions/checkout@v3
  543. with:
  544. submodules: recursive
  545. - name: Set up dependencies
  546. run: |
  547. sudo apt-get update -qq
  548. sudo apt-get install -yqq liblo-dev
  549. sudo apt-get clean
  550. - name: Create source tarball
  551. run: |
  552. make HEADLESS=true tarball
  553. make HEADLESS=true tarball+deps
  554. - name: Set sha8 (non-release)
  555. if: startsWith(github.ref, 'refs/tags/') != true
  556. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  557. - name: Set sha8 (release)
  558. if: startsWith(github.ref, 'refs/tags/')
  559. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  560. - uses: actions/upload-artifact@v3
  561. with:
  562. name: ${{ github.event.repository.name }}-source-${{ github.event.pull_request.number || env.SHA8 }}
  563. path: |
  564. /home/runner/cardinal*.tar.xz
  565. /home/runner/*/cardinal*.tar.xz
  566. /home/runner/*/*/cardinal*.tar.xz
  567. - uses: softprops/action-gh-release@v1
  568. if: startsWith(github.ref, 'refs/tags/')
  569. with:
  570. tag_name: ${{ github.ref_name }}
  571. name: ${{ github.ref_name }}
  572. draft: false
  573. prerelease: false
  574. files: |
  575. /home/runner/cardinal*.tar.xz
  576. /home/runner/*/cardinal*.tar.xz
  577. /home/runner/*/*/cardinal*.tar.xz
  578. plugin-validation:
  579. runs-on: ubuntu-20.04
  580. steps:
  581. - uses: actions/checkout@v3
  582. with:
  583. submodules: recursive
  584. - name: Set up cache
  585. id: cache
  586. uses: actions/cache@v3
  587. with:
  588. path: |
  589. src/Rack/dep/bin
  590. src/Rack/dep/include
  591. src/Rack/dep/lib
  592. src/Rack/dep/share
  593. src/Rack/dep/jansson-2.12
  594. src/Rack/dep/libarchive-3.4.3
  595. src/Rack/dep/libsamplerate-0.1.9
  596. src/Rack/dep/speexdsp-SpeexDSP-1.2rc3
  597. src/Rack/dep/zstd-1.4.5
  598. key: pluginval-v${{ env.CACHE_VERSION }}
  599. - name: Set up dependencies
  600. run: |
  601. # custom repos
  602. wget https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_11.1.0_all.deb
  603. sudo dpkg -i kxstudio-repos_11.1.0_all.deb
  604. sudo apt-get update -qq
  605. # build-deps
  606. sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev liblo-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev
  607. # runtime testing
  608. sudo apt-get install -yqq carla-git lilv-utils lv2-dev lv2lint kxstudio-lv2-extensions mod-lv2-extensions valgrind xvfb
  609. sudo apt-get clean
  610. # multiple jobs for building carla, deps and plugins
  611. - name: Build Cardinal (carla, deps and plugins)
  612. env:
  613. CFLAGS: -g
  614. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  615. LDFLAGS: -static-libgcc -static-libstdc++
  616. run: |
  617. make features
  618. make NOOPT=true SKIP_STRIPPING=true carla deps dgl plugins resources -j $(nproc)
  619. # single job for final build stage, otherwise we might get killed due to OOM
  620. - name: Build Cardinal (final build stage)
  621. env:
  622. CFLAGS: -g
  623. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  624. LDFLAGS: -static-libgcc -static-libstdc++
  625. run: |
  626. make features
  627. make NOOPT=true SKIP_STRIPPING=true -j 1 -C src jack
  628. make NOOPT=true -j 1
  629. ./dpf/utils/generate-ttl.sh
  630. - name: Run Cardinal self-tests
  631. run: |
  632. # --exit-on-first-error=yes
  633. xvfb-run valgrind \
  634. --gen-suppressions=all \
  635. --error-exitcode=255 \
  636. --leak-check=no \
  637. --track-origins=yes \
  638. --keep-debuginfo=yes \
  639. --suppressions=./dpf/utils/valgrind-dpf.supp \
  640. ./bin/Cardinal selftest
  641. - name: Validate LV2 ttl syntax
  642. run: |
  643. lv2_validate \
  644. /usr/lib/lv2/kx-meta/*.ttl \
  645. /usr/lib/lv2/kx-control-input-port-change-request.lv2/*.ttl \
  646. /usr/lib/lv2/kx-programs.lv2/*.ttl \
  647. /usr/lib/lv2/mod.lv2/*.ttl \
  648. /usr/lib/lv2/modgui.lv2/*.ttl \
  649. ./bin/*.lv2/*.ttl
  650. - name: Validate LV2 metadata and binaries
  651. run: |
  652. export LV2_PATH=/tmp/lv2-path
  653. mkdir ${LV2_PATH}
  654. mv bin/CardinalFX.lv2 bin/CardinalSynth.lv2 ${LV2_PATH}
  655. cp -r /usr/lib/lv2/{atom,buf-size,core,data-access,kx-control-input-port-change-request,kx-programs,instance-access,midi,mod,modgui,parameters,port-groups,port-props,options,patch,presets,resize-port,state,time,ui,units,urid,worker}.lv2 ${LV2_PATH}
  656. xvfb-run lv2lint -s lv2_generate_ttl -l ld-linux-x86-64.so.2 -M nopack $(lv2ls)
  657. - name: Test LV2 plugin
  658. run: |
  659. export LV2_PATH=/tmp/lv2-path
  660. for p in $(lv2ls); do \
  661. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  662. xvfb-run valgrind \
  663. --error-exitcode=255 \
  664. --leak-check=no \
  665. --track-origins=yes \
  666. --keep-debuginfo=yes \
  667. --suppressions=./dpf/utils/valgrind-dpf.supp \
  668. /usr/lib/carla/carla-bridge-native lv2 "" ${p}; \
  669. done
  670. - name: Test VST2 plugin
  671. run: |
  672. for p in $(ls bin/*.vst/*.so); do \
  673. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  674. xvfb-run valgrind \
  675. --error-exitcode=255 \
  676. --leak-check=no \
  677. --track-origins=yes \
  678. --keep-debuginfo=yes \
  679. --suppressions=./dpf/utils/valgrind-dpf.supp \
  680. /usr/lib/carla/carla-bridge-native vst2 ./${p} ""; \
  681. done
  682. - name: Test VST3 plugin
  683. run: |
  684. for p in $(ls bin/ | grep vst3); do \
  685. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  686. xvfb-run valgrind \
  687. --error-exitcode=255 \
  688. --leak-check=no \
  689. --track-origins=yes \
  690. --keep-debuginfo=yes \
  691. --suppressions=./dpf/utils/valgrind-dpf.supp \
  692. /usr/lib/carla/carla-bridge-native vst3 ./bin/${p} ""; \
  693. done