jack2 codebase
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.

327 lines
12KB

  1. name: build
  2. on:
  3. push:
  4. branches:
  5. - '*'
  6. pull_request:
  7. branches:
  8. - '*'
  9. env:
  10. CACHE_VERSION: 3
  11. DEBIAN_FRONTEND: noninteractive
  12. HOMEBREW_NO_AUTO_UPDATE: 1
  13. PAWPAW_SKIP_LTO: 1
  14. PAWPAW_VERSION: 023bccdeffafc4212292072a1eba78d9e709510e
  15. jobs:
  16. # macOS native intel build
  17. macos:
  18. runs-on: macos-10.15
  19. steps:
  20. - uses: actions/checkout@v2
  21. with:
  22. submodules: recursive
  23. - name: Set up cache
  24. uses: actions/cache@v2
  25. with:
  26. path: |
  27. ~/PawPawBuilds
  28. key: macos-v${{ env.CACHE_VERSION }}
  29. - name: Set up dependencies
  30. run: |
  31. brew install cmake jq meson
  32. - name: Bootstrap macOS intel
  33. shell: bash
  34. run: |
  35. if [ ! -d PawPaw ]; then
  36. git clone https://github.com/DISTRHO/PawPaw.git
  37. git -C PawPaw checkout ${PAWPAW_VERSION}
  38. fi
  39. ./PawPaw/bootstrap-jack2.sh macos && ./PawPaw/.cleanup.sh macos
  40. - name: Build jack2
  41. shell: bash
  42. env:
  43. PAWPAW_SKIP_LTO: 1
  44. run: |
  45. pushd PawPaw && source local.env macos && popd
  46. python ./waf configure --platform=darwin --prefix=/usr/local --example-tools
  47. python ./waf build -j $(sysctl -n hw.logicalcpu)
  48. python ./waf install --destdir=$(pwd)/destdir
  49. - name: Set sha8
  50. id: slug
  51. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  52. - name: Generate macOS package
  53. shell: bash
  54. run: |
  55. ./macosx/generate-pkg.sh $(pwd)/destdir/usr/local ${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  56. - uses: actions/upload-artifact@v2
  57. with:
  58. name: jack2-macOS-intel-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  59. path: macosx/jack2-osx-*.pkg
  60. # macOS native universal build
  61. macos_universal:
  62. runs-on: macos-10.15
  63. steps:
  64. - uses: actions/checkout@v2
  65. with:
  66. submodules: recursive
  67. - name: Set up cache
  68. uses: actions/cache@v2
  69. with:
  70. path: |
  71. ~/PawPawBuilds
  72. key: macos-universal-v${{ env.CACHE_VERSION }}
  73. - name: Set up dependencies
  74. run: |
  75. brew install cmake jq meson
  76. - name: Fix up Xcode
  77. run: |
  78. sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
  79. sudo xcode-select -s /Applications/Xcode_12.3.app
  80. - name: Bootstrap macOS universal
  81. shell: bash
  82. run: |
  83. if [ ! -d PawPaw ]; then
  84. git clone https://github.com/DISTRHO/PawPaw.git
  85. git -C PawPaw checkout ${PAWPAW_VERSION}
  86. fi
  87. ./PawPaw/bootstrap-jack2.sh macos-universal && ./PawPaw/.cleanup.sh macos-universal
  88. - name: Build jack2
  89. shell: bash
  90. env:
  91. PAWPAW_SKIP_LTO: 1
  92. run: |
  93. pushd PawPaw && source local.env macos-universal && popd
  94. python ./waf configure --platform=darwin --prefix=/usr/local --example-tools
  95. python ./waf build -j $(sysctl -n hw.logicalcpu)
  96. python ./waf install --destdir=$(pwd)/destdir
  97. - name: Set sha8
  98. id: slug
  99. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  100. - name: Generate macOS package
  101. shell: bash
  102. run: |
  103. ./macosx/generate-pkg.sh $(pwd)/destdir/usr/local ${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  104. - uses: actions/upload-artifact@v2
  105. with:
  106. name: jack2-macOS-universal-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  107. path: macosx/jack2-osx-*.pkg
  108. # linux with win32 cross-compilation
  109. win32:
  110. runs-on: ubuntu-20.04
  111. steps:
  112. - uses: actions/checkout@v2
  113. with:
  114. submodules: recursive
  115. - name: Set up cache
  116. uses: actions/cache@v2
  117. with:
  118. path: |
  119. ~/PawPawBuilds
  120. key: win32-v${{ env.CACHE_VERSION }}
  121. - name: Restore debian packages cache
  122. run: |
  123. if [ -d ~/PawPawBuilds/debs ] && [ "$(ls ~/PawPawBuilds/debs | wc -l)" -ne 0 ]; then \
  124. sudo cp ~/PawPawBuilds/debs/*.deb /var/cache/apt/archives/; \
  125. fi
  126. - name: Fix GitHub's mess
  127. run: |
  128. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  129. sudo apt-get update -qq
  130. sudo apt-get install -yqq --allow-downgrades libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal
  131. - name: Set up dependencies
  132. run: |
  133. sudo dpkg --add-architecture i386
  134. sudo apt-get update -qq
  135. sudo apt-get install -y autopoint build-essential curl cmake jq llvm mingw-w64 qttools5-dev-tools xvfb \
  136. binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 wine-stable:i386
  137. - name: Cache debian packages
  138. run: |
  139. mkdir -p ~/PawPawBuilds/debs && \
  140. sudo mv /var/cache/apt/archives/*.deb ~/PawPawBuilds/debs/
  141. - name: Bootstrap win32 cross-compiled
  142. shell: bash
  143. run: |
  144. if [ ! -d PawPaw ]; then
  145. git clone https://github.com/DISTRHO/PawPaw.git
  146. git -C PawPaw checkout ${PAWPAW_VERSION}
  147. fi
  148. ./PawPaw/bootstrap-jack2.sh win32 && ./PawPaw/.cleanup.sh win32
  149. - name: Build jack2
  150. shell: bash
  151. env:
  152. PAWPAW_SKIP_LTO: 1
  153. run: |
  154. pushd PawPaw && source local.env win32 && popd
  155. ./waf configure --platform=win32 --prefix=$(pwd)/destdir --static --example-tools
  156. ./waf build -j $(nproc)
  157. ./waf install
  158. - name: Generate MSVC lib files
  159. shell: bash
  160. run: |
  161. pushd $(pwd)/destdir/lib
  162. llvm-dlltool -m i386 -D libjack.dll -d libjack.def -l libjack.lib
  163. llvm-dlltool -m i386 -D libjacknet.dll -d libjacknet.def -l libjacknet.lib
  164. llvm-dlltool -m i386 -D libjackserver.dll -d libjackserver.def -l libjackserver.lib
  165. popd
  166. - name: Set sha8
  167. id: slug
  168. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  169. - name: Generate Windows installer
  170. shell: bash
  171. run: |
  172. # Setup wine
  173. export WINEDLLOVERRIDES="mscoree,mshtml="
  174. export WINEPREFIX=$(pwd)/innosetup
  175. xvfb-run wineboot -u
  176. # Download and install innosetup
  177. curl -L https://jrsoftware.org/download.php/is.exe?site=2 -o is.exe
  178. xvfb-run wine is.exe /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent
  179. # create installer
  180. ln -sf $(pwd)/destdir windows/inno/win32
  181. pushd windows/inno
  182. echo "#define VERSION \"${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}\"" > version.iss
  183. xvfb-run wine ${WINEPREFIX}/drive_c/InnoSeup/ISCC.exe win32-mini.iss
  184. popd
  185. - uses: actions/upload-artifact@v2
  186. with:
  187. name: jack2-win32-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  188. path: windows/inno/jack2-*.exe
  189. # linux with win64 cross-compilation
  190. win64:
  191. runs-on: ubuntu-20.04
  192. steps:
  193. - uses: actions/checkout@v2
  194. with:
  195. submodules: recursive
  196. - name: Set up cache
  197. uses: actions/cache@v2
  198. with:
  199. path: |
  200. ~/PawPawBuilds
  201. key: win64-v${{ env.CACHE_VERSION }}
  202. - name: Restore debian packages cache
  203. run: |
  204. if [ -d ~/PawPawBuilds/debs ] && [ "$(ls ~/PawPawBuilds/debs | wc -l)" -ne 0 ]; then \
  205. sudo cp ~/PawPawBuilds/debs/*.deb /var/cache/apt/archives/; \
  206. fi
  207. - name: Fix GitHub's mess
  208. run: |
  209. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  210. sudo apt-get update -qq
  211. sudo apt-get install -yqq --allow-downgrades libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal
  212. - name: Set up dependencies
  213. run: |
  214. sudo dpkg --add-architecture i386
  215. sudo apt-get update -qq
  216. sudo apt-get install -y autopoint build-essential curl cmake jq llvm mingw-w64 qttools5-dev-tools xvfb \
  217. binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable
  218. - name: Cache debian packages
  219. run: |
  220. mkdir -p ~/PawPawBuilds/debs && \
  221. sudo mv /var/cache/apt/archives/*.deb ~/PawPawBuilds/debs/
  222. - name: Bootstrap win64 cross-compiled
  223. shell: bash
  224. run: |
  225. if [ ! -d PawPaw ]; then
  226. git clone https://github.com/DISTRHO/PawPaw.git
  227. git -C PawPaw checkout ${PAWPAW_VERSION}
  228. fi
  229. ./PawPaw/bootstrap-jack2.sh win64 && ./PawPaw/.cleanup.sh win64
  230. - name: Build jack2
  231. shell: bash
  232. env:
  233. PAWPAW_SKIP_LTO: 1
  234. run: |
  235. pushd PawPaw && source local.env win64 && popd
  236. export PATH+=":/usr/i686-w64-mingw32/bin"
  237. export LDFLAGS+="-L~/PawPawBuilds/targets/win64/lib32"
  238. ./waf configure --platform=win32 --prefix=$(pwd)/destdir --static --mixed --example-tools
  239. ./waf build -j $(nproc)
  240. ./waf install
  241. - name: Generate MSVC lib files
  242. shell: bash
  243. run: |
  244. # 32bit
  245. pushd $(pwd)/destdir/lib32
  246. llvm-dlltool -m i386 -D libjack.dll -d libjack.def -l libjack.lib
  247. popd
  248. # 64bit
  249. pushd $(pwd)/destdir/lib
  250. llvm-dlltool -m i386:x86-64 -D libjack64.dll -d libjack64.def -l libjack64.lib
  251. llvm-dlltool -m i386:x86-64 -D libjacknet64.dll -d libjacknet64.def -l libjacknet64.lib
  252. llvm-dlltool -m i386:x86-64 -D libjackserver64.dll -d libjackserver64.def -l libjackserver64.lib
  253. popd
  254. - name: Set sha8
  255. id: slug
  256. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  257. - name: Generate Windows installer
  258. shell: bash
  259. run: |
  260. # Setup wine
  261. export WINEDLLOVERRIDES="mscoree,mshtml="
  262. export WINEPREFIX=$(pwd)/innosetup
  263. xvfb-run wineboot -u
  264. # Download and install innosetup
  265. curl -L https://jrsoftware.org/download.php/is.exe?site=2 -o is.exe
  266. xvfb-run wine64 is.exe /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent
  267. # create installer
  268. ln -sf $(pwd)/destdir windows/inno/win64
  269. pushd windows/inno
  270. echo "#define VERSION \"${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}\"" > version.iss
  271. xvfb-run wine64 ${WINEPREFIX}/drive_c/InnoSeup/ISCC.exe win64-mini.iss
  272. popd
  273. - uses: actions/upload-artifact@v2
  274. with:
  275. name: jack2-win64-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  276. path: windows/inno/jack2-*.exe
  277. # ubuntu-20.04
  278. ubuntu_20_04:
  279. runs-on: ubuntu-20.04
  280. steps:
  281. - uses: actions/checkout@v2
  282. with:
  283. submodules: recursive
  284. - name: Set up cache
  285. uses: actions/cache@v2
  286. with:
  287. path: |
  288. ~/debs
  289. key: ubuntu-20.04-v${{ env.CACHE_VERSION }}
  290. - name: Restore debian packages cache
  291. run: |
  292. if [ -d ~/debs ] && [ "$(ls ~/debs | wc -l)" -ne 0 ]; then \
  293. sudo cp ~/debs/*.deb /var/cache/apt/archives/; \
  294. fi
  295. - name: Set up dependencies
  296. run: |
  297. sudo add-apt-repository -y ppa:ubuntustudio-ppa/backports
  298. sudo sed -i "s/# deb-src/deb-src/" /etc/apt/sources.list /etc/apt/sources.list.d/*.list
  299. sudo apt-get update -qq
  300. sudo apt-get build-dep jackd2
  301. sudo apt-get install devscripts
  302. - name: Cache debian packages
  303. run: |
  304. mkdir -p ~/debs && \
  305. sudo mv /var/cache/apt/archives/*.deb ~/debs/
  306. - name: Set sha8
  307. id: slug
  308. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  309. - name: Build jack2 packages
  310. shell: bash
  311. run: |
  312. apt-get source -d jackd2
  313. tar xf *.debian.tar.xz
  314. rm -rf debian/source
  315. dch -M -b -v "$(cat wscript | awk 'sub("^VERSION = ","")' | tr -d "'")~$(date +"%Y%m%d")git${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}" -D focal "automated build"
  316. debuild -rfakeroot --no-lintian || true
  317. - uses: actions/upload-artifact@v2
  318. with:
  319. name: jack2-ubuntu-20.04-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  320. path: ~/work/jack2/*.deb