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: 4
  5. CARDINAL_UNDER_WINE: 1
  6. CIBUILD: true
  7. EMSCRIPTEN_VERSION: 3.1.27
  8. LIBGL_ALWAYS_SOFTWARE: true
  9. PAWPAW_SKIP_LTO: 1
  10. PAWPAW_SKIP_GLIB: 1
  11. PAWPAW_SKIP_LV2: 1
  12. PAWPAW_SKIP_SAMPLERATE: 1
  13. jobs:
  14. linux:
  15. strategy:
  16. matrix:
  17. target: [aarch64, armhf, i386, riscv64, x86_64]
  18. runs-on: ubuntu-20.04
  19. steps:
  20. - uses: actions/checkout@v3
  21. with:
  22. submodules: recursive
  23. - name: Set up build cache
  24. id: cache
  25. uses: actions/cache@v3
  26. with:
  27. path: |
  28. ~/PawPawBuilds
  29. src/Rack/dep/bin
  30. src/Rack/dep/include
  31. src/Rack/dep/lib
  32. src/Rack/dep/share
  33. src/Rack/dep/jansson-2.12
  34. src/Rack/dep/libarchive-3.4.3
  35. src/Rack/dep/libsamplerate-0.1.9
  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 /etc/apt/sources.list.d/*.list
  41. sudo apt-get update -qq
  42. sudo apt-get purge -yqq git-man libclang* libgbm* libllvm* libmono* libnginx* moby* mono* nginx* perl php* libgdiplus libpcre2-posix3 libselinux1-dev libzip4
  43. sudo apt-get install -yqq --allow-downgrades autoconf/focal automake/focal build-essential/focal git/focal libgd3/focal libglib2.0-0/focal libglib2.0-dev/focal libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal pkg-config/focal
  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. sudo sed -i "s/deb mirror/deb [arch=amd64] mirror/" /etc/apt/sources.list
  52. 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
  53. 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
  54. 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
  55. sudo apt-get update -qq
  56. 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 meson qemu-user-static
  57. sudo apt-get clean
  58. - name: Setup dependencies (armhf)
  59. if: ${{ matrix.target == 'armhf' }}
  60. shell: bash
  61. run: |
  62. sudo dpkg --add-architecture armhf
  63. sudo sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list
  64. sudo sed -i "s/deb mirror/deb [arch=amd64] mirror/" /etc/apt/sources.list
  65. 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
  66. 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
  67. 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
  68. sudo apt-get update -qq
  69. 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 meson qemu-user-static
  70. sudo apt-get clean
  71. - name: Setup dependencies (i386)
  72. if: ${{ matrix.target == 'i386' }}
  73. shell: bash
  74. run: |
  75. sudo dpkg --add-architecture i386
  76. sudo apt-get update -qq
  77. 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 meson
  78. sudo apt-get clean
  79. - name: Setup dependencies (riscv64)
  80. if: ${{ matrix.target == 'riscv64' }}
  81. shell: bash
  82. run: |
  83. sudo dpkg --add-architecture riscv64
  84. sudo sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list
  85. sudo sed -i "s/deb mirror/deb [arch=amd64] mirror/" /etc/apt/sources.list
  86. 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
  87. 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
  88. 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
  89. sudo apt-get update -qq
  90. 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 meson qemu-user-static
  91. sudo apt-get clean
  92. - name: Setup dependencies (x86_64)
  93. if: ${{ matrix.target == 'x86_64' }}
  94. shell: bash
  95. run: |
  96. sudo apt-get update -qq
  97. 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 meson
  98. sudo apt-get clean
  99. - name: Set up ccache
  100. uses: hendrikmuhs/ccache-action@v1.2
  101. with:
  102. key: ccache-linux-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  103. - name: Build extra dependencies
  104. env:
  105. PKG_CONFIG_PATH: /usr/lib/${{ matrix.target }}-linux-gnu/pkgconfig
  106. run: |
  107. ./deps/PawPaw/bootstrap-cardinal.sh linux-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh linux-${{ matrix.target }}
  108. - name: Build linux
  109. run: |
  110. export PATH="/usr/lib/ccache:${PATH}"
  111. source deps/PawPaw/local.env linux-${{ matrix.target }}
  112. export PKG_CONFIG_PATH+=:/usr/lib/${{ matrix.target }}-linux-gnu/pkgconfig
  113. make features
  114. make HAVE_PULSEAUDIO=false NOOPT=true -j $(nproc)
  115. make unzipfx
  116. - name: Set sha8 (non-release)
  117. if: startsWith(github.ref, 'refs/tags/') != true
  118. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  119. - name: Set sha8 (release)
  120. if: startsWith(github.ref, 'refs/tags/')
  121. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  122. - name: Pack binaries
  123. run: |
  124. 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
  125. - uses: actions/upload-artifact@v3
  126. with:
  127. name: ${{ github.event.repository.name }}-linux-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  128. path: |
  129. *.tar.gz
  130. - uses: softprops/action-gh-release@v1
  131. if: startsWith(github.ref, 'refs/tags/')
  132. with:
  133. tag_name: ${{ github.ref_name }}
  134. name: ${{ github.ref_name }}
  135. draft: false
  136. prerelease: false
  137. files: |
  138. *.tar.gz
  139. linux-x86_64-debug:
  140. runs-on: ubuntu-20.04
  141. steps:
  142. - uses: actions/checkout@v3
  143. with:
  144. submodules: recursive
  145. - name: Set up dependencies
  146. run: |
  147. sudo apt-get update -qq
  148. 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 meson
  149. sudo apt-get clean
  150. - name: Build linux x86_64 (debug)
  151. env:
  152. LDFLAGS: -static-libgcc -static-libstdc++
  153. run: |
  154. make features
  155. # multiple jobs for building carla, deps and plugins
  156. make DEBUG=true carla deps dgl plugins resources -j $(nproc)
  157. # single job for final build stage, otherwise we might get killed due to OOM
  158. make DEBUG=true HAVE_PULSEAUDIO=false clap lv2 vst2 vst3 -j 1
  159. - name: Set sha8
  160. id: slug
  161. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  162. - name: Pack binaries
  163. run: |
  164. 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
  165. - uses: actions/upload-artifact@v3
  166. with:
  167. name: ${{ github.event.repository.name }}-linux-x86_64-debug-${{ github.event.pull_request.number || env.SHA8 }}
  168. path: |
  169. *.tar.gz
  170. macos:
  171. strategy:
  172. matrix:
  173. target: [universal-10.15]
  174. runs-on: macos-11
  175. steps:
  176. - uses: actions/checkout@v3
  177. with:
  178. submodules: recursive
  179. - name: Set up cache
  180. id: cache
  181. uses: actions/cache@v3
  182. with:
  183. path: |
  184. ~/PawPawBuilds
  185. src/Rack/dep/bin
  186. src/Rack/dep/include
  187. src/Rack/dep/lib
  188. src/Rack/dep/share
  189. src/Rack/dep/jansson-2.12
  190. src/Rack/dep/libarchive-3.4.3
  191. src/Rack/dep/libsamplerate-0.1.9
  192. src/Rack/dep/zstd-1.4.5
  193. key: macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  194. - name: Setup dependencies
  195. run: |
  196. brew install autoconf automake meson
  197. - name: Build extra dependencies
  198. run: |
  199. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  200. ./deps/PawPaw/bootstrap-cardinal.sh macos-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh macos-${{ matrix.target }}
  201. - name: Set up ccache
  202. if: steps.cache.outputs.cache-hit == 'true'
  203. uses: hendrikmuhs/ccache-action@v1.2
  204. with:
  205. key: ccache-macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  206. - name: Build macOS (base)
  207. if: steps.cache.outputs.cache-hit == 'true'
  208. run: |
  209. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  210. source deps/PawPaw/local.env macos-${{ matrix.target }}
  211. make features
  212. make NOOPT=true -j $(sysctl -n hw.logicalcpu)
  213. - name: Build macOS (AU using juce)
  214. if: steps.cache.outputs.cache-hit == 'true'
  215. run: |
  216. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  217. source deps/PawPaw/local.env macos-${{ matrix.target }}
  218. mkdir -p jucewrapper/build
  219. pushd jucewrapper/build; cmake -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd
  220. mv jucewrapper/build/*_artefacts/Release/AU/*.component bin/
  221. - name: Build macOS (packaging)
  222. if: steps.cache.outputs.cache-hit == 'true'
  223. run: |
  224. source deps/PawPaw/local.env macos-${{ matrix.target }}
  225. ./utils/create-macos-installer.sh
  226. - name: Set sha8 (non-release)
  227. if: startsWith(github.ref, 'refs/tags/') != true
  228. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  229. - name: Set sha8 (release)
  230. if: startsWith(github.ref, 'refs/tags/')
  231. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  232. - name: Rename macOS bundle
  233. if: steps.cache.outputs.cache-hit == 'true'
  234. run: |
  235. mv ${{ github.event.repository.name }}-macOS.pkg ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.pkg
  236. - uses: actions/upload-artifact@v3
  237. with:
  238. name: ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  239. path: |
  240. ${{ github.event.repository.name }}-*.pkg
  241. - uses: softprops/action-gh-release@v1
  242. if: startsWith(github.ref, 'refs/tags/')
  243. with:
  244. tag_name: ${{ github.ref_name }}
  245. name: ${{ github.ref_name }}
  246. draft: false
  247. prerelease: false
  248. files: |
  249. ${{ github.event.repository.name }}-*.pkg
  250. modaudio:
  251. strategy:
  252. matrix:
  253. include:
  254. - name: modduo
  255. target: modduo-static
  256. extraflags: MODDUO=true
  257. - name: modduox
  258. target: modduox-static
  259. - name: moddwarf
  260. target: moddwarf
  261. runs-on: ubuntu-20.04
  262. steps:
  263. - uses: actions/checkout@v3
  264. with:
  265. submodules: recursive
  266. - name: Set up cache
  267. uses: actions/cache@v3
  268. id: mpb-cache
  269. with:
  270. path: |
  271. ~/mod-workdir
  272. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  273. - name: Set up dependencies
  274. run: |
  275. sudo apt-get update -qq
  276. 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
  277. sudo apt-get install -yqq pandoc texlive-latex-recommended texlive-latex-extra
  278. sudo apt-get clean
  279. - name: Bootstrap toolchain
  280. if: steps.mpb-cache.outputs.cache-hit != 'true'
  281. run: |
  282. git clone --depth=1 https://github.com/moddevices/mod-plugin-builder.git deps/mod-plugin-builder
  283. sed -i "s/CT_LOG_PROGRESS_BAR=y/CT_LOG_PROGRESS_BAR=n/" deps/mod-plugin-builder/toolchain/*.config
  284. $(pwd)/deps/mod-plugin-builder/bootstrap.sh ${{ matrix.target }} minimal && $(pwd)/deps/mod-plugin-builder/.clean-install.sh ${{ matrix.target }}
  285. - name: Build for modaudio
  286. if: steps.mpb-cache.outputs.cache-hit == 'true'
  287. run: |
  288. make HEADLESS=true ${{ matrix.name }}-features
  289. make HEADLESS=true ${{ matrix.extraflags }} ${{ matrix.name }} -j $(nproc)
  290. - name: Set sha8
  291. id: slug
  292. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  293. - name: Pack binaries
  294. if: steps.mpb-cache.outputs.cache-hit == 'true'
  295. run: |
  296. 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)
  297. - uses: actions/upload-artifact@v3
  298. with:
  299. name: ${{ github.event.repository.name }}-${{ matrix.name }}-${{ github.event.pull_request.number || env.SHA8 }}
  300. path: |
  301. *.tar.gz
  302. wasm:
  303. strategy:
  304. matrix:
  305. target: [simd, nosimd]
  306. runs-on: ubuntu-22.04
  307. steps:
  308. - uses: actions/checkout@v3
  309. with:
  310. submodules: recursive
  311. - name: Set up cache
  312. id: cache
  313. uses: actions/cache@v3
  314. with:
  315. path: |
  316. ~/PawPawBuilds
  317. src/Rack/dep/bin
  318. src/Rack/dep/include
  319. src/Rack/dep/lib
  320. src/Rack/dep/share
  321. src/Rack/dep/jansson-2.12
  322. src/Rack/dep/libarchive-3.4.3
  323. src/Rack/dep/libsamplerate-0.1.9
  324. src/Rack/dep/zstd-1.4.5
  325. key: wasm-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  326. - name: Set up dependencies
  327. run: |
  328. sudo apt-get update -qq
  329. sudo apt-get install -yqq brotli gperf meson
  330. sudo apt-get clean
  331. [ -e ~/PawPawBuilds/emsdk ] || git clone https://github.com/emscripten-core/emsdk.git ~/PawPawBuilds/emsdk
  332. cd ~/PawPawBuilds/emsdk && ./emsdk install ${{ env.EMSCRIPTEN_VERSION }} && ./emsdk activate ${{ env.EMSCRIPTEN_VERSION }}
  333. - name: Build extra dependencies
  334. run: |
  335. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  336. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  337. ./deps/PawPaw/bootstrap-cardinal.sh wasm && ./deps/PawPaw/.cleanup.sh wasm
  338. - name: Build wasm cross-compiled
  339. if: steps.cache.outputs.cache-hit == 'true'
  340. run: |
  341. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  342. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  343. source deps/PawPaw/local.env wasm
  344. # FIXME send patch upstream, assuming this works..
  345. sed -i -e 's/defined(__riscv)/defined(__riscv) || defined(__EMSCRIPTEN__)/' plugins/surgext/surge/src/common/globals.h
  346. make features
  347. make HAVE_LIBLO=false NOOPT=true NOSIMD=${{ matrix.target == 'nosimd' }} -j $(nproc)
  348. - name: Build modgui
  349. if: steps.cache.outputs.cache-hit == 'true'
  350. run: |
  351. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  352. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  353. source deps/PawPaw/local.env wasm
  354. make HAVE_LIBLO=false NOOPT=true NOSIMD=${{ matrix.target == 'nosimd' }} -j $(nproc) -C src/CardinalMiniSep modgui
  355. - name: Make wasm versioned and compress
  356. if: steps.cache.outputs.cache-hit == 'true'
  357. run: |
  358. ${{ matrix.target == 'nosimd' }} && export SUFFIX="-nosimd"
  359. VERSION=$(cat Makefile | awk 'sub("VERSION = ","")')
  360. cd bin
  361. sed -i "s/CardinalMini\./CardinalMini-v${VERSION}\./g" *.html *.js
  362. sed -i "s/CardinalNative\./CardinalNative-v${VERSION}\./g" *.html *.js
  363. sed -i "s/CardinalMini-nosimd\./CardinalMini-nosimd-v${VERSION}\./g" *.html *.js
  364. sed -i "s/CardinalNative-nosimd\./CardinalNative-nosimd-v${VERSION}\./g" *.html *.js
  365. mv CardinalMini.data CardinalMini${SUFFIX}-v${VERSION}.data
  366. mv CardinalMini.js CardinalMini${SUFFIX}-v${VERSION}.js
  367. mv CardinalMini.wasm CardinalMini${SUFFIX}-v${VERSION}.wasm
  368. mv CardinalNative.data CardinalNative${SUFFIX}-v${VERSION}.data
  369. mv CardinalNative.js CardinalNative${SUFFIX}-v${VERSION}.js
  370. mv CardinalNative.wasm CardinalNative${SUFFIX}-v${VERSION}.wasm
  371. brotli -k -q 11 *.data *.html *.js *.wasm
  372. - name: Set sha8 (non-release)
  373. if: startsWith(github.ref, 'refs/tags/') != true
  374. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  375. - name: Set sha8 (release)
  376. if: startsWith(github.ref, 'refs/tags/')
  377. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  378. - name: Pack binaries
  379. if: steps.cache.outputs.cache-hit == 'true'
  380. run: |
  381. 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) CardinalMini.lv2/modgui
  382. - uses: actions/upload-artifact@v3
  383. with:
  384. name: ${{ github.event.repository.name }}-wasm-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  385. path: |
  386. *.zip
  387. - uses: softprops/action-gh-release@v1
  388. if: startsWith(github.ref, 'refs/tags/')
  389. with:
  390. tag_name: ${{ github.ref_name }}
  391. name: ${{ github.ref_name }}
  392. draft: false
  393. prerelease: false
  394. files: |
  395. *.zip
  396. windows:
  397. strategy:
  398. matrix:
  399. target: [win32, win64]
  400. runs-on: ubuntu-22.04
  401. steps:
  402. - uses: actions/checkout@v3
  403. with:
  404. submodules: recursive
  405. - name: Set up cache
  406. id: cache
  407. uses: actions/cache@v3
  408. with:
  409. path: |
  410. ~/PawPawBuilds
  411. src/Rack/dep/bin
  412. src/Rack/dep/include
  413. src/Rack/dep/lib
  414. src/Rack/dep/share
  415. src/Rack/dep/jansson-2.12
  416. src/Rack/dep/libarchive-3.4.3
  417. src/Rack/dep/libsamplerate-0.1.9
  418. src/Rack/dep/zstd-1.4.5
  419. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  420. - name: Fix GitHub's mess
  421. run: |
  422. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  423. sudo dpkg --add-architecture i386
  424. sudo apt-get update -qq
  425. sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386
  426. sudo apt-get clean
  427. - name: Set up dependencies
  428. if: ${{ matrix.target == 'win32' }}
  429. run: |
  430. sudo apt-get install -yqq binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 wine-stable:i386 gperf meson qttools5-dev qttools5-dev-tools xvfb
  431. sudo apt-get clean
  432. - name: Set up dependencies
  433. if: ${{ matrix.target == 'win64' }}
  434. run: |
  435. sudo apt-get install -yqq binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable gperf meson qttools5-dev qttools5-dev-tools xvfb
  436. sudo apt-get clean
  437. - name: Set up ccache
  438. uses: hendrikmuhs/ccache-action@v1.2
  439. with:
  440. key: ccache-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  441. - name: Build extra dependencies
  442. run: |
  443. ./deps/PawPaw/bootstrap-cardinal.sh ${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh ${{ matrix.target }}
  444. - name: Build cross-compiled (base)
  445. if: steps.cache.outputs.cache-hit == 'true'
  446. run: |
  447. export PATH="/usr/lib/ccache:${PATH}"
  448. source deps/PawPaw/local.env ${{ matrix.target }}
  449. make features
  450. make NOOPT=true -j $(nproc)
  451. - name: Build cross-compiled (carla)
  452. if: steps.cache.outputs.cache-hit == 'true'
  453. run: |
  454. export PATH="/usr/lib/ccache:${PATH}"
  455. source deps/PawPaw/local.env ${{ matrix.target }}
  456. make carla-win32 -j $(nproc)
  457. make -C carla EMBED_TARGET=true TESTING=true dist
  458. make -C carla EMBED_TARGET=true TESTING=true dist
  459. - name: Build cross-compiled (packaging)
  460. if: steps.cache.outputs.cache-hit == 'true'
  461. run: |
  462. source deps/PawPaw/local.env ${{ matrix.target }}
  463. xvfb-run ./utils/create-windows-installer.sh ${{ matrix.target }}
  464. make unzipfx
  465. - name: Set sha8 (non-release)
  466. if: startsWith(github.ref, 'refs/tags/') != true
  467. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  468. - name: Set sha8 (release)
  469. if: startsWith(github.ref, 'refs/tags/')
  470. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  471. - name: Pack binaries
  472. if: steps.cache.outputs.cache-hit == 'true'
  473. run: |
  474. pushd bin
  475. 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)
  476. popd
  477. 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
  478. - uses: actions/upload-artifact@v3
  479. with:
  480. name: ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  481. path: |
  482. Cardinal-*.exe
  483. Cardinal-*.zip
  484. - uses: softprops/action-gh-release@v1
  485. if: startsWith(github.ref, 'refs/tags/')
  486. with:
  487. tag_name: ${{ github.ref_name }}
  488. name: ${{ github.ref_name }}
  489. draft: false
  490. prerelease: false
  491. files: |
  492. Cardinal-*.exe
  493. Cardinal-*.zip
  494. headless:
  495. runs-on: ubuntu-20.04
  496. steps:
  497. - uses: actions/checkout@v3
  498. with:
  499. submodules: recursive
  500. - name: Set up dependencies
  501. run: |
  502. sudo apt-get update -qq
  503. sudo apt-get remove -yqq libcairo2-dev libx11-dev libx11-dev libxext-dev
  504. sudo apt-get install -yqq liblo-dev
  505. sudo apt-get clean
  506. - name: Build linux (headless)
  507. run: |
  508. make HEADLESS=true features
  509. make HEADLESS=true -j $(nproc)
  510. lto:
  511. runs-on: ubuntu-20.04
  512. steps:
  513. - uses: actions/checkout@v3
  514. with:
  515. submodules: recursive
  516. - name: Set up dependencies
  517. run: |
  518. sudo apt-get update -qq
  519. 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
  520. sudo apt-get clean
  521. - name: Build linux (LTO)
  522. run: |
  523. make features
  524. make WITH_LTO=true -j $(nproc) native
  525. sysdeps:
  526. runs-on: ubuntu-20.04
  527. steps:
  528. - uses: actions/checkout@v3
  529. with:
  530. submodules: recursive
  531. - name: Set up dependencies
  532. run: |
  533. sudo apt-get update -qq
  534. 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
  535. sudo apt-get clean
  536. - name: Build linux (sysdeps)
  537. run: |
  538. make features
  539. make SYSDEPS=true -j $(nproc)
  540. source-tarball:
  541. runs-on: ubuntu-20.04
  542. steps:
  543. - uses: actions/checkout@v3
  544. with:
  545. submodules: recursive
  546. - name: Set up dependencies
  547. run: |
  548. sudo apt-get update -qq
  549. sudo apt-get install -yqq liblo-dev
  550. sudo apt-get clean
  551. - name: Create source tarball
  552. run: |
  553. make HEADLESS=true tarball
  554. make HEADLESS=true tarball+deps
  555. - name: Set sha8 (non-release)
  556. if: startsWith(github.ref, 'refs/tags/') != true
  557. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  558. - name: Set sha8 (release)
  559. if: startsWith(github.ref, 'refs/tags/')
  560. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  561. - uses: actions/upload-artifact@v3
  562. with:
  563. name: ${{ github.event.repository.name }}-source-${{ github.event.pull_request.number || env.SHA8 }}
  564. path: |
  565. /home/runner/cardinal*.tar.xz
  566. /home/runner/*/cardinal*.tar.xz
  567. /home/runner/*/*/cardinal*.tar.xz
  568. - uses: softprops/action-gh-release@v1
  569. if: startsWith(github.ref, 'refs/tags/')
  570. with:
  571. tag_name: ${{ github.ref_name }}
  572. name: ${{ github.ref_name }}
  573. draft: false
  574. prerelease: false
  575. files: |
  576. /home/runner/cardinal*.tar.xz
  577. /home/runner/*/cardinal*.tar.xz
  578. /home/runner/*/*/cardinal*.tar.xz
  579. plugin-validation:
  580. runs-on: ubuntu-20.04
  581. steps:
  582. - uses: actions/checkout@v3
  583. with:
  584. submodules: recursive
  585. - name: Set up cache
  586. id: cache
  587. uses: actions/cache@v3
  588. with:
  589. path: |
  590. src/Rack/dep/bin
  591. src/Rack/dep/include
  592. src/Rack/dep/lib
  593. src/Rack/dep/share
  594. src/Rack/dep/jansson-2.12
  595. src/Rack/dep/libarchive-3.4.3
  596. src/Rack/dep/libsamplerate-0.1.9
  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