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.

866 lines
38KB

  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 arm64 cross-compiled
  106. run: |
  107. pushd deps/PawPaw; source local.env linux-${{ matrix.target }}; popd
  108. export PATH="/usr/lib/ccache:${PATH}"
  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-arm64-${{ 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-arm64-${{ 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. linux-headless:
  168. runs-on: ubuntu-20.04
  169. steps:
  170. - uses: actions/checkout@v3
  171. with:
  172. submodules: recursive
  173. - name: Set up dependencies
  174. run: |
  175. sudo apt-get update -qq
  176. sudo apt-get remove -yqq libcairo2-dev libx11-dev libx11-dev libxext-dev
  177. sudo apt-get install -yqq liblo-dev
  178. sudo apt-get clean
  179. - name: Build linux (headless)
  180. run: |
  181. make HEADLESS=true features
  182. make HEADLESS=true -j $(nproc)
  183. linux-lto:
  184. runs-on: ubuntu-20.04
  185. steps:
  186. - uses: actions/checkout@v3
  187. with:
  188. submodules: recursive
  189. - name: Set up dependencies
  190. run: |
  191. sudo apt-get update -qq
  192. 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
  193. sudo apt-get clean
  194. - name: Build linux (LTO)
  195. run: |
  196. make features
  197. make WITH_LTO=true -j $(nproc)
  198. linux-sysdeps:
  199. runs-on: ubuntu-20.04
  200. steps:
  201. - uses: actions/checkout@v3
  202. with:
  203. submodules: recursive
  204. - name: Set up dependencies
  205. run: |
  206. sudo apt-get update -qq
  207. 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
  208. sudo apt-get clean
  209. - name: Build linux (sysdeps)
  210. run: |
  211. make features
  212. make SYSDEPS=true -j $(nproc)
  213. macos:
  214. strategy:
  215. matrix:
  216. target: [intel, universal]
  217. runs-on: macos-11
  218. steps:
  219. - uses: actions/checkout@v3
  220. with:
  221. submodules: recursive
  222. - name: Set up cache
  223. id: cache
  224. uses: actions/cache@v3
  225. with:
  226. path: |
  227. ~/PawPawBuilds
  228. src/Rack/dep/bin
  229. src/Rack/dep/include
  230. src/Rack/dep/lib
  231. src/Rack/dep/share
  232. src/Rack/dep/jansson-2.12
  233. src/Rack/dep/libarchive-3.4.3
  234. src/Rack/dep/libsamplerate-0.1.9
  235. src/Rack/dep/speexdsp-SpeexDSP-1.2rc3
  236. src/Rack/dep/zstd-1.4.5
  237. key: macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  238. - name: Build extra dependencies
  239. run: |
  240. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  241. ./deps/PawPaw/bootstrap-cardinal.sh macos-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh macos-${{ matrix.target }}
  242. - name: Set up ccache
  243. if: steps.cache.outputs.cache-hit == 'true'
  244. uses: hendrikmuhs/ccache-action@v1.2
  245. with:
  246. key: ccache-macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  247. - name: Build macOS (base)
  248. if: steps.cache.outputs.cache-hit == 'true'
  249. run: |
  250. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  251. pushd deps/PawPaw; source local.env macos-${{ matrix.target }}; popd
  252. make features
  253. make NOOPT=true -j $(sysctl -n hw.logicalcpu)
  254. - name: Build macOS (AU using juce)
  255. if: steps.cache.outputs.cache-hit == 'true'
  256. run: |
  257. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  258. pushd deps/PawPaw; source local.env macos-${{ matrix.target }}; popd
  259. git clone --depth=1 -b v6.1.6 https://github.com/DISTRHO/JUCE.git jucewrapper/JUCE
  260. # sed -i -e 's/kAudioUnitProperty_SupportsMPE/kAudioUnitProperty_ignore_SupportsMPE/' jucewrapper/JUCE/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h
  261. mkdir -p jucewrapper/build
  262. pushd jucewrapper/build; cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd
  263. mv jucewrapper/build/*_artefacts/Release/AU/*.component bin/
  264. - name: Build macOS (intel packaging)
  265. if: ${{ steps.cache.outputs.cache-hit == 'true' && matrix.target == 'intel' }}
  266. env:
  267. MACOS_ARCHS: 'x86_64'
  268. run: |
  269. pushd deps/PawPaw; source local.env macos-${{ matrix.target }}; popd
  270. ./utils/create-macos-installer.sh
  271. - name: Build macOS (universal packaging)
  272. if: ${{ steps.cache.outputs.cache-hit == 'true' && matrix.target == 'universal' }}
  273. env:
  274. MACOS_ARCHS: 'arm64,x86_64'
  275. run: |
  276. pushd deps/PawPaw; source local.env macos-${{ matrix.target }}; popd
  277. ./utils/create-macos-installer.sh
  278. - name: Set sha8 (non-release)
  279. if: startsWith(github.ref, 'refs/tags/') != true
  280. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  281. - name: Set sha8 (release)
  282. if: startsWith(github.ref, 'refs/tags/')
  283. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  284. - name: Rename macOS bundle
  285. if: steps.cache.outputs.cache-hit == 'true'
  286. run: |
  287. mv ${{ github.event.repository.name }}-macOS.pkg ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.pkg
  288. - uses: actions/upload-artifact@v3
  289. with:
  290. name: ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  291. path: |
  292. ${{ github.event.repository.name }}-*.pkg
  293. - uses: softprops/action-gh-release@v1
  294. if: startsWith(github.ref, 'refs/tags/')
  295. with:
  296. tag_name: ${{ github.ref_name }}
  297. name: ${{ github.ref_name }}
  298. draft: false
  299. prerelease: false
  300. files: |
  301. ${{ github.event.repository.name }}-*.pkg
  302. modduo:
  303. runs-on: ubuntu-20.04
  304. steps:
  305. - uses: actions/checkout@v3
  306. with:
  307. submodules: recursive
  308. - name: Set up cache
  309. uses: actions/cache@v3
  310. id: mpb-cache
  311. with:
  312. path: |
  313. ~/mod-workdir
  314. key: modduo-static-v${{ env.CACHE_VERSION }}
  315. - name: Set up dependencies
  316. run: |
  317. sudo apt-get update -qq
  318. 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
  319. sudo apt-get install -yqq pandoc texlive-latex-recommended texlive-latex-extra
  320. sudo apt-get clean
  321. - name: Bootstrap toolchain
  322. if: steps.mpb-cache.outputs.cache-hit != 'true'
  323. run: |
  324. git clone --depth=1 https://github.com/moddevices/mod-plugin-builder.git deps/mod-plugin-builder
  325. sed -i "s/CT_LOG_PROGRESS_BAR=y/CT_LOG_PROGRESS_BAR=n/" deps/mod-plugin-builder/toolchain/*.config
  326. $(pwd)/deps/mod-plugin-builder/bootstrap.sh modduo-static minimal && $(pwd)/deps/mod-plugin-builder/.clean-install.sh modduo-static
  327. - name: Build for modduo
  328. if: steps.mpb-cache.outputs.cache-hit == 'true'
  329. run: |
  330. make HEADLESS=true modduo-features
  331. make HEADLESS=true MODDUO=true modduo -j $(nproc)
  332. - name: Set sha8
  333. id: slug
  334. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  335. - name: Pack binaries
  336. if: steps.mpb-cache.outputs.cache-hit == 'true'
  337. run: |
  338. tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-modduo-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep lv2)
  339. - uses: actions/upload-artifact@v3
  340. with:
  341. name: ${{ github.event.repository.name }}-modduo-${{ github.event.pull_request.number || env.SHA8 }}
  342. path: |
  343. *.tar.gz
  344. modduox:
  345. runs-on: ubuntu-20.04
  346. steps:
  347. - uses: actions/checkout@v3
  348. with:
  349. submodules: recursive
  350. - name: Set up cache
  351. uses: actions/cache@v3
  352. id: mpb-cache
  353. with:
  354. path: |
  355. ~/mod-workdir
  356. key: modduox-v${{ env.CACHE_VERSION }}
  357. - name: Set up dependencies
  358. run: |
  359. sudo apt-get update -qq
  360. 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
  361. sudo apt-get install -yqq pandoc texlive-latex-recommended texlive-latex-extra
  362. sudo apt-get clean
  363. - name: Bootstrap toolchain
  364. if: steps.mpb-cache.outputs.cache-hit != 'true'
  365. run: |
  366. git clone --depth=1 https://github.com/moddevices/mod-plugin-builder.git deps/mod-plugin-builder
  367. sed -i "s/CT_LOG_PROGRESS_BAR=y/CT_LOG_PROGRESS_BAR=n/" deps/mod-plugin-builder/toolchain/*.config
  368. $(pwd)/deps/mod-plugin-builder/bootstrap.sh modduox-static minimal && $(pwd)/deps/mod-plugin-builder/.clean-install.sh modduox-static
  369. - name: Build for modduox
  370. if: steps.mpb-cache.outputs.cache-hit == 'true'
  371. run: |
  372. make HEADLESS=true modduox-features
  373. make HEADLESS=true modduox -j $(nproc)
  374. - name: Set sha8
  375. id: slug
  376. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  377. - name: Pack binaries
  378. if: steps.mpb-cache.outputs.cache-hit == 'true'
  379. run: |
  380. tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-modduox-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep lv2)
  381. - uses: actions/upload-artifact@v3
  382. with:
  383. name: ${{ github.event.repository.name }}-modduox-${{ github.event.pull_request.number || env.SHA8 }}
  384. path: |
  385. *.tar.gz
  386. moddwarf:
  387. runs-on: ubuntu-20.04
  388. steps:
  389. - uses: actions/checkout@v3
  390. with:
  391. submodules: recursive
  392. - name: Set up cache
  393. uses: actions/cache@v3
  394. id: mpb-cache
  395. with:
  396. path: |
  397. ~/mod-workdir
  398. key: moddwarf-v${{ env.CACHE_VERSION }}
  399. - name: Set up dependencies
  400. run: |
  401. sudo apt-get update -qq
  402. 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
  403. sudo apt-get install -yqq pandoc texlive-latex-recommended texlive-latex-extra
  404. sudo apt-get clean
  405. - name: Bootstrap toolchain
  406. if: steps.mpb-cache.outputs.cache-hit != 'true'
  407. run: |
  408. git clone --depth=1 https://github.com/moddevices/mod-plugin-builder.git deps/mod-plugin-builder
  409. sed -i "s/CT_LOG_PROGRESS_BAR=y/CT_LOG_PROGRESS_BAR=n/" deps/mod-plugin-builder/toolchain/*.config
  410. $(pwd)/deps/mod-plugin-builder/bootstrap.sh moddwarf minimal && $(pwd)/deps/mod-plugin-builder/.clean-install.sh moddwarf
  411. - name: Build for moddwarf
  412. if: steps.mpb-cache.outputs.cache-hit == 'true'
  413. run: |
  414. make HEADLESS=true moddwarf-features
  415. make HEADLESS=true moddwarf -j $(nproc)
  416. - name: Set sha8
  417. id: slug
  418. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  419. - name: Pack binaries
  420. if: steps.mpb-cache.outputs.cache-hit == 'true'
  421. run: |
  422. tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-moddwarf-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep lv2)
  423. - uses: actions/upload-artifact@v3
  424. with:
  425. name: ${{ github.event.repository.name }}-moddwarf-${{ github.event.pull_request.number || env.SHA8 }}
  426. path: |
  427. *.tar.gz
  428. wasm:
  429. runs-on: ubuntu-22.04
  430. steps:
  431. - uses: actions/checkout@v3
  432. with:
  433. submodules: recursive
  434. - name: Set up cache
  435. id: cache
  436. uses: actions/cache@v3
  437. with:
  438. path: |
  439. ~/PawPawBuilds
  440. src/Rack/dep/bin
  441. src/Rack/dep/include
  442. src/Rack/dep/lib
  443. src/Rack/dep/share
  444. src/Rack/dep/jansson-2.12
  445. src/Rack/dep/libarchive-3.4.3
  446. src/Rack/dep/libsamplerate-0.1.9
  447. src/Rack/dep/speexdsp-SpeexDSP-1.2rc3
  448. src/Rack/dep/zstd-1.4.5
  449. key: wasm-v${{ env.CACHE_VERSION }}
  450. - name: Set up dependencies
  451. run: |
  452. sudo apt-get update -qq
  453. sudo apt-get install -yqq brotli gperf
  454. sudo apt-get clean
  455. [ -e ~/PawPawBuilds/emsdk ] || git clone https://github.com/emscripten-core/emsdk.git ~/PawPawBuilds/emsdk
  456. cd ~/PawPawBuilds/emsdk && ./emsdk install ${{ env.EMSCRIPTEN_VERSION }} && ./emsdk activate ${{ env.EMSCRIPTEN_VERSION }}
  457. - name: Build extra dependencies
  458. run: |
  459. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  460. ./deps/PawPaw/bootstrap-cardinal.sh wasm && ./deps/PawPaw/.cleanup.sh wasm
  461. - name: Build wasm cross-compiled
  462. if: steps.cache.outputs.cache-hit == 'true'
  463. run: |
  464. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  465. pushd deps/PawPaw; source local.env wasm; popd
  466. make features
  467. make HAVE_LIBLO=false NOOPT=true -j $(nproc)
  468. - name: Make wasm versioned and compress
  469. if: steps.cache.outputs.cache-hit == 'true'
  470. run: |
  471. VERSION=$(cat Makefile | awk 'sub("VERSION = ","")')
  472. cd bin
  473. sed -i "s/CardinalMini\./CardinalMini-v${VERSION}\./g" *.html *.js
  474. sed -i "s/CardinalNative\./CardinalNative-v${VERSION}\./g" *.html *.js
  475. mv CardinalMini.data CardinalMini-v${VERSION}.data
  476. mv CardinalMini.js CardinalMini-v${VERSION}.js
  477. mv CardinalMini.wasm CardinalMini-v${VERSION}.wasm
  478. mv CardinalNative.data CardinalNative-v${VERSION}.data
  479. mv CardinalNative.js CardinalNative-v${VERSION}.js
  480. mv CardinalNative.wasm CardinalNative-v${VERSION}.wasm
  481. brotli -k -q 11 *.data *.html *.js *.wasm
  482. - name: Set sha8 (non-release)
  483. if: startsWith(github.ref, 'refs/tags/') != true
  484. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  485. - name: Set sha8 (release)
  486. if: startsWith(github.ref, 'refs/tags/')
  487. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  488. - name: Pack binaries
  489. if: steps.cache.outputs.cache-hit == 'true'
  490. run: |
  491. cd bin; zip -r -9 ../${{ github.event.repository.name }}-wasm-${{ github.event.pull_request.number || env.SHA8 }}.zip $(ls *.br *.html *.data *.js *.wasm)
  492. - uses: actions/upload-artifact@v3
  493. with:
  494. name: ${{ github.event.repository.name }}-wasm-${{ github.event.pull_request.number || env.SHA8 }}
  495. path: |
  496. *.zip
  497. - uses: softprops/action-gh-release@v1
  498. if: startsWith(github.ref, 'refs/tags/')
  499. with:
  500. tag_name: ${{ github.ref_name }}
  501. name: ${{ github.ref_name }}
  502. draft: false
  503. prerelease: false
  504. files: |
  505. *.zip
  506. wasm-noopt:
  507. runs-on: ubuntu-22.04
  508. steps:
  509. - uses: actions/checkout@v3
  510. with:
  511. submodules: recursive
  512. - name: Set up cache
  513. id: cache
  514. uses: actions/cache@v3
  515. with:
  516. path: |
  517. ~/PawPawBuilds
  518. src/Rack/dep/bin
  519. src/Rack/dep/include
  520. src/Rack/dep/lib
  521. src/Rack/dep/share
  522. src/Rack/dep/jansson-2.12
  523. src/Rack/dep/libarchive-3.4.3
  524. src/Rack/dep/libsamplerate-0.1.9
  525. src/Rack/dep/speexdsp-SpeexDSP-1.2rc3
  526. src/Rack/dep/zstd-1.4.5
  527. key: wasm-noopt-v${{ env.CACHE_VERSION }}
  528. - name: Set up dependencies
  529. run: |
  530. sudo apt-get update -qq
  531. sudo apt-get install -yqq brotli gperf
  532. sudo apt-get clean
  533. [ -e ~/PawPawBuilds/emsdk ] || git clone https://github.com/emscripten-core/emsdk.git ~/PawPawBuilds/emsdk
  534. cd ~/PawPawBuilds/emsdk && ./emsdk install ${{ env.EMSCRIPTEN_VERSION }} && ./emsdk activate ${{ env.EMSCRIPTEN_VERSION }}
  535. - name: Build extra dependencies
  536. env:
  537. PAWPAW_NOSIMD: 1
  538. run: |
  539. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  540. ./deps/PawPaw/bootstrap-cardinal.sh wasm && ./deps/PawPaw/.cleanup.sh wasm
  541. - name: Build wasm-noopt cross-compiled
  542. if: steps.cache.outputs.cache-hit == 'true'
  543. env:
  544. PAWPAW_NOSIMD: 1
  545. NOSIMD: true
  546. run: |
  547. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  548. pushd deps/PawPaw; source local.env wasm; popd
  549. # FIXME send patch upstream, assuming this works..
  550. sed -i -e 's/defined(__riscv)/defined(__riscv) || defined(__EMSCRIPTEN__)/' plugins/surgext/surge/src/common/globals.h
  551. make features
  552. make HAVE_LIBLO=false NOOPT=true -j $(nproc)
  553. make HAVE_LIBLO=false NOOPT=true -j $(nproc) -C src/CardinalMiniSep modgui
  554. - name: Make wasm-noopt versioned and compress
  555. if: steps.cache.outputs.cache-hit == 'true'
  556. run: |
  557. VERSION=$(cat Makefile | awk 'sub("VERSION = ","")')
  558. cd bin
  559. sed -i "s/CardinalMini\./CardinalMini-noopt-v${VERSION}\./g" *.html *.js
  560. sed -i "s/CardinalNative\./CardinalNative-noopt-v${VERSION}\./g" *.html *.js
  561. mv CardinalMini.data CardinalMini-noopt-v${VERSION}.data
  562. mv CardinalMini.js CardinalMini-noopt-v${VERSION}.js
  563. mv CardinalMini.wasm CardinalMini-noopt-v${VERSION}.wasm
  564. mv CardinalNative.data CardinalNative-noopt-v${VERSION}.data
  565. mv CardinalNative.js CardinalNative-noopt-v${VERSION}.js
  566. mv CardinalNative.wasm CardinalNative-noopt-v${VERSION}.wasm
  567. brotli -k -q 11 *.data *.html *.js *.wasm
  568. - name: Set sha8 (non-release)
  569. if: startsWith(github.ref, 'refs/tags/') != true
  570. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  571. - name: Set sha8 (release)
  572. if: startsWith(github.ref, 'refs/tags/')
  573. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  574. - name: Pack binaries
  575. if: steps.cache.outputs.cache-hit == 'true'
  576. run: |
  577. cd bin; zip -r -9 ../${{ github.event.repository.name }}-wasm-noopt-${{ github.event.pull_request.number || env.SHA8 }}.zip $(ls *.br *.html *.data *.js *.wasm-noopt) CardinalMini.lv2/modgui
  578. - uses: actions/upload-artifact@v3
  579. with:
  580. name: ${{ github.event.repository.name }}-wasm-noopt-${{ github.event.pull_request.number || env.SHA8 }}
  581. path: |
  582. *.zip
  583. - uses: softprops/action-gh-release@v1
  584. if: startsWith(github.ref, 'refs/tags/')
  585. with:
  586. tag_name: ${{ github.ref_name }}
  587. name: ${{ github.ref_name }}
  588. draft: false
  589. prerelease: false
  590. files: |
  591. *.zip
  592. windows:
  593. strategy:
  594. matrix:
  595. target: [win32, win64]
  596. runs-on: ubuntu-22.04
  597. steps:
  598. - uses: actions/checkout@v3
  599. with:
  600. submodules: recursive
  601. - name: Set up cache
  602. id: cache
  603. uses: actions/cache@v3
  604. with:
  605. path: |
  606. ~/PawPawBuilds
  607. src/Rack/dep/bin
  608. src/Rack/dep/include
  609. src/Rack/dep/lib
  610. src/Rack/dep/share
  611. src/Rack/dep/jansson-2.12
  612. src/Rack/dep/libarchive-3.4.3
  613. src/Rack/dep/libsamplerate-0.1.9
  614. src/Rack/dep/speexdsp-SpeexDSP-1.2rc3
  615. src/Rack/dep/zstd-1.4.5
  616. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  617. - name: Fix GitHub's mess
  618. run: |
  619. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  620. sudo apt-get update -qq
  621. sudo apt-get install -yqq --allow-downgrades libgd3/jammy
  622. sudo apt-get purge -yqq libclang* libgbm* libllvm* libmono* moby* mono* msbuild* php* libgdiplus libpcre2-posix3 libzip4
  623. sudo apt-get clean
  624. - name: Set up dependencies
  625. if: ${{ matrix.target == 'win32' }}
  626. run: |
  627. sudo dpkg --add-architecture i386
  628. sudo apt-get update -qq
  629. 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
  630. sudo apt-get clean
  631. - name: Set up dependencies
  632. if: ${{ matrix.target == 'win64' }}
  633. run: |
  634. sudo dpkg --add-architecture i386
  635. sudo apt-get update -qq
  636. 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
  637. sudo apt-get clean
  638. - name: Set up ccache
  639. uses: hendrikmuhs/ccache-action@v1.2
  640. with:
  641. key: ccache-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  642. - name: Build extra dependencies
  643. run: |
  644. ./deps/PawPaw/bootstrap-cardinal.sh ${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh ${{ matrix.target }}
  645. - name: Build cross-compiled (base)
  646. if: steps.cache.outputs.cache-hit == 'true'
  647. run: |
  648. export PATH="/usr/lib/ccache:${PATH}"
  649. pushd deps/PawPaw; source local.env ${{ matrix.target }}; popd
  650. make features
  651. make NOOPT=true -j $(nproc)
  652. - name: Build cross-compiled (carla)
  653. if: steps.cache.outputs.cache-hit == 'true'
  654. run: |
  655. export PATH="/usr/lib/ccache:${PATH}"
  656. pushd deps/PawPaw; source local.env ${{ matrix.target }}; popd
  657. make carla-win32 -j $(nproc)
  658. make -C carla EMBED_TARGET=true TESTING=true dist
  659. make -C carla EMBED_TARGET=true TESTING=true dist
  660. - name: Build cross-compiled (packaging)
  661. if: steps.cache.outputs.cache-hit == 'true'
  662. run: |
  663. pushd deps/PawPaw; source local.env ${{ matrix.target }}; popd
  664. xvfb-run ./utils/create-windows-installer.sh ${{ matrix.target }}
  665. make unzipfx
  666. - name: Set sha8 (non-release)
  667. if: startsWith(github.ref, 'refs/tags/') != true
  668. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  669. - name: Set sha8 (release)
  670. if: startsWith(github.ref, 'refs/tags/')
  671. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  672. - name: Pack binaries
  673. if: steps.cache.outputs.cache-hit == 'true'
  674. run: |
  675. pushd bin
  676. 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)
  677. popd
  678. 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
  679. - uses: actions/upload-artifact@v3
  680. with:
  681. name: ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  682. path: |
  683. Cardinal-*.exe
  684. Cardinal-*.zip
  685. - uses: softprops/action-gh-release@v1
  686. if: startsWith(github.ref, 'refs/tags/')
  687. with:
  688. tag_name: ${{ github.ref_name }}
  689. name: ${{ github.ref_name }}
  690. draft: false
  691. prerelease: false
  692. files: |
  693. Cardinal-*.exe
  694. Cardinal-*.zip
  695. source-tarball:
  696. runs-on: ubuntu-20.04
  697. steps:
  698. - uses: actions/checkout@v3
  699. with:
  700. submodules: recursive
  701. - name: Set up dependencies
  702. run: |
  703. sudo apt-get update -qq
  704. sudo apt-get install -yqq liblo-dev
  705. sudo apt-get clean
  706. - name: Create source tarball
  707. run: |
  708. make HEADLESS=true tarball
  709. make HEADLESS=true tarball+deps
  710. - name: Set sha8 (non-release)
  711. if: startsWith(github.ref, 'refs/tags/') != true
  712. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  713. - name: Set sha8 (release)
  714. if: startsWith(github.ref, 'refs/tags/')
  715. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  716. - uses: actions/upload-artifact@v3
  717. with:
  718. name: ${{ github.event.repository.name }}-source-${{ github.event.pull_request.number || env.SHA8 }}
  719. path: |
  720. /home/runner/cardinal*.tar.xz
  721. /home/runner/*/cardinal*.tar.xz
  722. /home/runner/*/*/cardinal*.tar.xz
  723. - uses: softprops/action-gh-release@v1
  724. if: startsWith(github.ref, 'refs/tags/')
  725. with:
  726. tag_name: ${{ github.ref_name }}
  727. name: ${{ github.ref_name }}
  728. draft: false
  729. prerelease: false
  730. files: |
  731. /home/runner/cardinal*.tar.xz
  732. /home/runner/*/cardinal*.tar.xz
  733. /home/runner/*/*/cardinal*.tar.xz
  734. plugin-validation:
  735. runs-on: ubuntu-20.04
  736. steps:
  737. - uses: actions/checkout@v3
  738. with:
  739. submodules: recursive
  740. - name: Set up cache
  741. id: cache
  742. uses: actions/cache@v3
  743. with:
  744. path: |
  745. src/Rack/dep/bin
  746. src/Rack/dep/include
  747. src/Rack/dep/lib
  748. src/Rack/dep/share
  749. src/Rack/dep/jansson-2.12
  750. src/Rack/dep/libarchive-3.4.3
  751. src/Rack/dep/libsamplerate-0.1.9
  752. src/Rack/dep/speexdsp-SpeexDSP-1.2rc3
  753. src/Rack/dep/zstd-1.4.5
  754. key: pluginval-v${{ env.CACHE_VERSION }}
  755. - name: Set up dependencies
  756. run: |
  757. # custom repos
  758. wget https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_11.1.0_all.deb
  759. sudo dpkg -i kxstudio-repos_11.1.0_all.deb
  760. sudo apt-get update -qq
  761. # build-deps
  762. sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev liblo-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev
  763. # runtime testing
  764. sudo apt-get install -yqq carla-git lilv-utils lv2-dev lv2lint kxstudio-lv2-extensions mod-lv2-extensions valgrind xvfb
  765. sudo apt-get clean
  766. # multiple jobs for building carla, deps and plugins
  767. - name: Build Cardinal (carla, deps and plugins)
  768. env:
  769. CFLAGS: -g
  770. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  771. LDFLAGS: -static-libgcc -static-libstdc++
  772. run: |
  773. make features
  774. make NOOPT=true SKIP_STRIPPING=true carla deps dgl plugins resources -j $(nproc)
  775. # single job for final build stage, otherwise we might get killed due to OOM
  776. - name: Build Cardinal (final build stage)
  777. env:
  778. CFLAGS: -g
  779. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  780. LDFLAGS: -static-libgcc -static-libstdc++
  781. run: |
  782. make features
  783. make NOOPT=true SKIP_STRIPPING=true -j 1 -C src jack
  784. make NOOPT=true -j 1
  785. ./dpf/utils/generate-ttl.sh
  786. - name: Run Cardinal self-tests
  787. run: |
  788. # --exit-on-first-error=yes
  789. xvfb-run valgrind \
  790. --gen-suppressions=all \
  791. --error-exitcode=255 \
  792. --leak-check=no \
  793. --track-origins=yes \
  794. --keep-debuginfo=yes \
  795. --suppressions=./dpf/utils/valgrind-dpf.supp \
  796. ./bin/Cardinal selftest
  797. - name: Validate LV2 ttl syntax
  798. run: |
  799. lv2_validate \
  800. /usr/lib/lv2/kx-meta/*.ttl \
  801. /usr/lib/lv2/kx-control-input-port-change-request.lv2/*.ttl \
  802. /usr/lib/lv2/kx-programs.lv2/*.ttl \
  803. /usr/lib/lv2/mod.lv2/*.ttl \
  804. /usr/lib/lv2/modgui.lv2/*.ttl \
  805. ./bin/*.lv2/*.ttl
  806. - name: Validate LV2 metadata and binaries
  807. run: |
  808. export LV2_PATH=/tmp/lv2-path
  809. mkdir ${LV2_PATH}
  810. mv bin/CardinalFX.lv2 bin/CardinalSynth.lv2 ${LV2_PATH}
  811. 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}
  812. xvfb-run lv2lint -s lv2_generate_ttl -l ld-linux-x86-64.so.2 -M nopack $(lv2ls)
  813. - name: Test LV2 plugin
  814. run: |
  815. export LV2_PATH=/tmp/lv2-path
  816. for p in $(lv2ls); do \
  817. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  818. xvfb-run valgrind \
  819. --error-exitcode=255 \
  820. --leak-check=no \
  821. --track-origins=yes \
  822. --keep-debuginfo=yes \
  823. --suppressions=./dpf/utils/valgrind-dpf.supp \
  824. /usr/lib/carla/carla-bridge-native lv2 "" ${p}; \
  825. done
  826. - name: Test VST2 plugin
  827. run: |
  828. for p in $(ls bin/*.vst/*.so); do \
  829. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  830. xvfb-run valgrind \
  831. --error-exitcode=255 \
  832. --leak-check=no \
  833. --track-origins=yes \
  834. --keep-debuginfo=yes \
  835. --suppressions=./dpf/utils/valgrind-dpf.supp \
  836. /usr/lib/carla/carla-bridge-native vst2 ./${p} ""; \
  837. done
  838. - name: Test VST3 plugin
  839. run: |
  840. for p in $(ls bin/ | grep vst3); do \
  841. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  842. xvfb-run valgrind \
  843. --error-exitcode=255 \
  844. --leak-check=no \
  845. --track-origins=yes \
  846. --keep-debuginfo=yes \
  847. --suppressions=./dpf/utils/valgrind-dpf.supp \
  848. /usr/lib/carla/carla-bridge-native vst3 ./bin/${p} ""; \
  849. done