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.

704 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 -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 meson 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 meson 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 meson
  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 meson 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 meson
  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 meson
  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/zstd-1.4.5
  190. key: macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  191. - name: Setup dependencies
  192. run: |
  193. brew install autoconf automake meson
  194. - name: Build extra dependencies
  195. run: |
  196. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  197. ./deps/PawPaw/bootstrap-cardinal.sh macos-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh macos-${{ matrix.target }}
  198. - name: Set up ccache
  199. if: steps.cache.outputs.cache-hit == 'true'
  200. uses: hendrikmuhs/ccache-action@v1.2
  201. with:
  202. key: ccache-macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  203. - name: Build macOS (base)
  204. if: steps.cache.outputs.cache-hit == 'true'
  205. run: |
  206. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  207. source deps/PawPaw/local.env macos-${{ matrix.target }}
  208. make features
  209. make NOOPT=true -j $(sysctl -n hw.logicalcpu)
  210. - name: Build macOS (AU using juce)
  211. if: steps.cache.outputs.cache-hit == 'true'
  212. run: |
  213. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  214. source deps/PawPaw/local.env macos-${{ matrix.target }}
  215. mkdir -p jucewrapper/build
  216. pushd jucewrapper/build; cmake -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd
  217. mv jucewrapper/build/*_artefacts/Release/AU/*.component bin/
  218. - name: Build macOS (packaging)
  219. if: steps.cache.outputs.cache-hit == 'true'
  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/zstd-1.4.5
  322. key: wasm-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  323. - name: Set up dependencies
  324. run: |
  325. sudo apt-get update -qq
  326. sudo apt-get install -yqq brotli gperf meson
  327. sudo apt-get clean
  328. [ -e ~/PawPawBuilds/emsdk ] || git clone https://github.com/emscripten-core/emsdk.git ~/PawPawBuilds/emsdk
  329. cd ~/PawPawBuilds/emsdk && ./emsdk install ${{ env.EMSCRIPTEN_VERSION }} && ./emsdk activate ${{ env.EMSCRIPTEN_VERSION }}
  330. - name: Build extra dependencies
  331. run: |
  332. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  333. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  334. ./deps/PawPaw/bootstrap-cardinal.sh wasm && ./deps/PawPaw/.cleanup.sh wasm
  335. - name: Build wasm cross-compiled
  336. if: steps.cache.outputs.cache-hit == 'true'
  337. run: |
  338. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  339. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  340. source deps/PawPaw/local.env wasm
  341. # FIXME send patch upstream, assuming this works..
  342. sed -i -e 's/defined(__riscv)/defined(__riscv) || defined(__EMSCRIPTEN__)/' plugins/surgext/surge/src/common/globals.h
  343. make features
  344. make HAVE_LIBLO=false NOOPT=true NOSIMD=${{ matrix.target == 'nosimd' }} -j $(nproc)
  345. - name: Build modgui
  346. if: steps.cache.outputs.cache-hit == 'true'
  347. run: |
  348. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  349. source ~/PawPawBuilds/emsdk/emsdk_env.sh
  350. source deps/PawPaw/local.env wasm
  351. make HAVE_LIBLO=false NOOPT=true NOSIMD=${{ matrix.target == 'nosimd' }} -j $(nproc) -C src/CardinalMiniSep modgui
  352. - name: Make wasm versioned and compress
  353. if: steps.cache.outputs.cache-hit == 'true'
  354. run: |
  355. ${{ matrix.target == 'nosimd' }} && export SUFFIX="-nosimd"
  356. VERSION=$(cat Makefile | awk 'sub("VERSION = ","")')
  357. cd bin
  358. sed -i "s/CardinalMini\./CardinalMini-v${VERSION}\./g" *.html *.js
  359. sed -i "s/CardinalNative\./CardinalNative-v${VERSION}\./g" *.html *.js
  360. sed -i "s/CardinalMini-nosimd\./CardinalMini-nosimd-v${VERSION}\./g" *.html *.js
  361. sed -i "s/CardinalNative-nosimd\./CardinalNative-nosimd-v${VERSION}\./g" *.html *.js
  362. mv CardinalMini.data CardinalMini${SUFFIX}-v${VERSION}.data
  363. mv CardinalMini.js CardinalMini${SUFFIX}-v${VERSION}.js
  364. mv CardinalMini.wasm CardinalMini${SUFFIX}-v${VERSION}.wasm
  365. mv CardinalNative.data CardinalNative${SUFFIX}-v${VERSION}.data
  366. mv CardinalNative.js CardinalNative${SUFFIX}-v${VERSION}.js
  367. mv CardinalNative.wasm CardinalNative${SUFFIX}-v${VERSION}.wasm
  368. brotli -k -q 11 *.data *.html *.js *.wasm
  369. - name: Set sha8 (non-release)
  370. if: startsWith(github.ref, 'refs/tags/') != true
  371. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  372. - name: Set sha8 (release)
  373. if: startsWith(github.ref, 'refs/tags/')
  374. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  375. - name: Pack binaries
  376. if: steps.cache.outputs.cache-hit == 'true'
  377. run: |
  378. 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
  379. - uses: actions/upload-artifact@v3
  380. with:
  381. name: ${{ github.event.repository.name }}-wasm-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  382. path: |
  383. *.zip
  384. - uses: softprops/action-gh-release@v1
  385. if: startsWith(github.ref, 'refs/tags/')
  386. with:
  387. tag_name: ${{ github.ref_name }}
  388. name: ${{ github.ref_name }}
  389. draft: false
  390. prerelease: false
  391. files: |
  392. *.zip
  393. windows:
  394. strategy:
  395. matrix:
  396. target: [win32, win64]
  397. runs-on: ubuntu-22.04
  398. steps:
  399. - uses: actions/checkout@v3
  400. with:
  401. submodules: recursive
  402. - name: Set up cache
  403. id: cache
  404. uses: actions/cache@v3
  405. with:
  406. path: |
  407. ~/PawPawBuilds
  408. src/Rack/dep/bin
  409. src/Rack/dep/include
  410. src/Rack/dep/lib
  411. src/Rack/dep/share
  412. src/Rack/dep/jansson-2.12
  413. src/Rack/dep/libarchive-3.4.3
  414. src/Rack/dep/libsamplerate-0.1.9
  415. src/Rack/dep/zstd-1.4.5
  416. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  417. - name: Fix GitHub's mess
  418. run: |
  419. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  420. sudo dpkg --add-architecture i386
  421. sudo apt-get update -qq
  422. sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386
  423. sudo apt-get clean
  424. - name: Set up dependencies
  425. if: ${{ matrix.target == 'win32' }}
  426. run: |
  427. 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
  428. sudo apt-get clean
  429. - name: Set up dependencies
  430. if: ${{ matrix.target == 'win64' }}
  431. run: |
  432. 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
  433. sudo apt-get clean
  434. - name: Set up ccache
  435. uses: hendrikmuhs/ccache-action@v1.2
  436. with:
  437. key: ccache-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  438. - name: Build extra dependencies
  439. run: |
  440. ./deps/PawPaw/bootstrap-cardinal.sh ${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh ${{ matrix.target }}
  441. - name: Build cross-compiled (base)
  442. if: steps.cache.outputs.cache-hit == 'true'
  443. run: |
  444. export PATH="/usr/lib/ccache:${PATH}"
  445. source deps/PawPaw/local.env ${{ matrix.target }}
  446. make features
  447. make NOOPT=true -j $(nproc)
  448. - name: Build cross-compiled (carla)
  449. if: steps.cache.outputs.cache-hit == 'true'
  450. run: |
  451. export PATH="/usr/lib/ccache:${PATH}"
  452. source deps/PawPaw/local.env ${{ matrix.target }}
  453. make carla-win32 -j $(nproc)
  454. make -C carla EMBED_TARGET=true TESTING=true dist
  455. make -C carla EMBED_TARGET=true TESTING=true dist
  456. - name: Build cross-compiled (packaging)
  457. if: steps.cache.outputs.cache-hit == 'true'
  458. run: |
  459. source deps/PawPaw/local.env ${{ matrix.target }}
  460. xvfb-run ./utils/create-windows-installer.sh ${{ matrix.target }}
  461. make unzipfx
  462. - name: Set sha8 (non-release)
  463. if: startsWith(github.ref, 'refs/tags/') != true
  464. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  465. - name: Set sha8 (release)
  466. if: startsWith(github.ref, 'refs/tags/')
  467. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  468. - name: Pack binaries
  469. if: steps.cache.outputs.cache-hit == 'true'
  470. run: |
  471. pushd bin
  472. 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)
  473. popd
  474. 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
  475. - uses: actions/upload-artifact@v3
  476. with:
  477. name: ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  478. path: |
  479. Cardinal-*.exe
  480. Cardinal-*.zip
  481. - uses: softprops/action-gh-release@v1
  482. if: startsWith(github.ref, 'refs/tags/')
  483. with:
  484. tag_name: ${{ github.ref_name }}
  485. name: ${{ github.ref_name }}
  486. draft: false
  487. prerelease: false
  488. files: |
  489. Cardinal-*.exe
  490. Cardinal-*.zip
  491. headless:
  492. runs-on: ubuntu-20.04
  493. steps:
  494. - uses: actions/checkout@v3
  495. with:
  496. submodules: recursive
  497. - name: Set up dependencies
  498. run: |
  499. sudo apt-get update -qq
  500. sudo apt-get remove -yqq libcairo2-dev libx11-dev libx11-dev libxext-dev
  501. sudo apt-get install -yqq liblo-dev
  502. sudo apt-get clean
  503. - name: Build linux (headless)
  504. run: |
  505. make HEADLESS=true features
  506. make HEADLESS=true -j $(nproc)
  507. lto:
  508. runs-on: ubuntu-20.04
  509. steps:
  510. - uses: actions/checkout@v3
  511. with:
  512. submodules: recursive
  513. - name: Set up dependencies
  514. run: |
  515. sudo apt-get update -qq
  516. 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
  517. sudo apt-get clean
  518. - name: Build linux (LTO)
  519. run: |
  520. make features
  521. make WITH_LTO=true -j $(nproc)
  522. sysdeps:
  523. runs-on: ubuntu-20.04
  524. steps:
  525. - uses: actions/checkout@v3
  526. with:
  527. submodules: recursive
  528. - name: Set up dependencies
  529. run: |
  530. sudo apt-get update -qq
  531. 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
  532. sudo apt-get clean
  533. - name: Build linux (sysdeps)
  534. run: |
  535. make features
  536. make SYSDEPS=true -j $(nproc)
  537. source-tarball:
  538. runs-on: ubuntu-20.04
  539. steps:
  540. - uses: actions/checkout@v3
  541. with:
  542. submodules: recursive
  543. - name: Set up dependencies
  544. run: |
  545. sudo apt-get update -qq
  546. sudo apt-get install -yqq liblo-dev
  547. sudo apt-get clean
  548. - name: Create source tarball
  549. run: |
  550. make HEADLESS=true tarball
  551. make HEADLESS=true tarball+deps
  552. - name: Set sha8 (non-release)
  553. if: startsWith(github.ref, 'refs/tags/') != true
  554. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  555. - name: Set sha8 (release)
  556. if: startsWith(github.ref, 'refs/tags/')
  557. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  558. - uses: actions/upload-artifact@v3
  559. with:
  560. name: ${{ github.event.repository.name }}-source-${{ github.event.pull_request.number || env.SHA8 }}
  561. path: |
  562. /home/runner/cardinal*.tar.xz
  563. /home/runner/*/cardinal*.tar.xz
  564. /home/runner/*/*/cardinal*.tar.xz
  565. - uses: softprops/action-gh-release@v1
  566. if: startsWith(github.ref, 'refs/tags/')
  567. with:
  568. tag_name: ${{ github.ref_name }}
  569. name: ${{ github.ref_name }}
  570. draft: false
  571. prerelease: false
  572. files: |
  573. /home/runner/cardinal*.tar.xz
  574. /home/runner/*/cardinal*.tar.xz
  575. /home/runner/*/*/cardinal*.tar.xz
  576. plugin-validation:
  577. runs-on: ubuntu-20.04
  578. steps:
  579. - uses: actions/checkout@v3
  580. with:
  581. submodules: recursive
  582. - name: Set up cache
  583. id: cache
  584. uses: actions/cache@v3
  585. with:
  586. path: |
  587. src/Rack/dep/bin
  588. src/Rack/dep/include
  589. src/Rack/dep/lib
  590. src/Rack/dep/share
  591. src/Rack/dep/jansson-2.12
  592. src/Rack/dep/libarchive-3.4.3
  593. src/Rack/dep/libsamplerate-0.1.9
  594. src/Rack/dep/zstd-1.4.5
  595. key: pluginval-v${{ env.CACHE_VERSION }}
  596. - name: Set up dependencies
  597. run: |
  598. # custom repos
  599. wget https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_11.1.0_all.deb
  600. sudo dpkg -i kxstudio-repos_11.1.0_all.deb
  601. sudo apt-get update -qq
  602. # build-deps
  603. sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev liblo-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev
  604. # runtime testing
  605. sudo apt-get install -yqq carla-git lilv-utils lv2-dev lv2lint kxstudio-lv2-extensions mod-lv2-extensions valgrind xvfb
  606. sudo apt-get clean
  607. # multiple jobs for building carla, deps and plugins
  608. - name: Build Cardinal (carla, deps and plugins)
  609. env:
  610. CFLAGS: -g
  611. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  612. LDFLAGS: -static-libgcc -static-libstdc++
  613. run: |
  614. make features
  615. make NOOPT=true SKIP_STRIPPING=true carla deps dgl plugins resources -j $(nproc)
  616. # single job for final build stage, otherwise we might get killed due to OOM
  617. - name: Build Cardinal (final build stage)
  618. env:
  619. CFLAGS: -g
  620. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  621. LDFLAGS: -static-libgcc -static-libstdc++
  622. run: |
  623. make features
  624. make NOOPT=true SKIP_STRIPPING=true -j 1 -C src jack
  625. make NOOPT=true -j 1
  626. ./dpf/utils/generate-ttl.sh
  627. - name: Run Cardinal self-tests
  628. run: |
  629. # --exit-on-first-error=yes
  630. xvfb-run valgrind \
  631. --gen-suppressions=all \
  632. --error-exitcode=255 \
  633. --leak-check=no \
  634. --track-origins=yes \
  635. --keep-debuginfo=yes \
  636. --suppressions=./dpf/utils/valgrind-dpf.supp \
  637. ./bin/Cardinal selftest
  638. - name: Validate LV2 ttl syntax
  639. run: |
  640. lv2_validate \
  641. /usr/lib/lv2/kx-meta/*.ttl \
  642. /usr/lib/lv2/kx-control-input-port-change-request.lv2/*.ttl \
  643. /usr/lib/lv2/kx-programs.lv2/*.ttl \
  644. /usr/lib/lv2/mod.lv2/*.ttl \
  645. /usr/lib/lv2/modgui.lv2/*.ttl \
  646. ./bin/*.lv2/*.ttl
  647. - name: Validate LV2 metadata and binaries
  648. run: |
  649. export LV2_PATH=/tmp/lv2-path
  650. mkdir ${LV2_PATH}
  651. mv bin/CardinalFX.lv2 bin/CardinalSynth.lv2 ${LV2_PATH}
  652. 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}
  653. xvfb-run lv2lint -s lv2_generate_ttl -l ld-linux-x86-64.so.2 -M nopack $(lv2ls)
  654. - name: Test LV2 plugin
  655. run: |
  656. export LV2_PATH=/tmp/lv2-path
  657. for p in $(lv2ls); do \
  658. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  659. xvfb-run valgrind \
  660. --error-exitcode=255 \
  661. --leak-check=no \
  662. --track-origins=yes \
  663. --keep-debuginfo=yes \
  664. --suppressions=./dpf/utils/valgrind-dpf.supp \
  665. /usr/lib/carla/carla-bridge-native lv2 "" ${p}; \
  666. done
  667. - name: Test VST2 plugin
  668. run: |
  669. for p in $(ls bin/*.vst/*.so); do \
  670. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  671. xvfb-run valgrind \
  672. --error-exitcode=255 \
  673. --leak-check=no \
  674. --track-origins=yes \
  675. --keep-debuginfo=yes \
  676. --suppressions=./dpf/utils/valgrind-dpf.supp \
  677. /usr/lib/carla/carla-bridge-native vst2 ./${p} ""; \
  678. done
  679. - name: Test VST3 plugin
  680. run: |
  681. for p in $(ls bin/ | grep vst3); do \
  682. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  683. xvfb-run valgrind \
  684. --error-exitcode=255 \
  685. --leak-check=no \
  686. --track-origins=yes \
  687. --keep-debuginfo=yes \
  688. --suppressions=./dpf/utils/valgrind-dpf.supp \
  689. /usr/lib/carla/carla-bridge-native vst3 ./bin/${p} ""; \
  690. done