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.

317 lines
11KB

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