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.

173 lines
6.2KB

  1. name: build
  2. on:
  3. push:
  4. branches:
  5. - '*'
  6. pull_request:
  7. branches:
  8. - '*'
  9. env:
  10. CACHE_VERSION: 20240930
  11. PAWPAW_VERSION: a9ab736dc297b2055536c71cddf1c79711d420bb
  12. PAWPAW_SKIP_LTO: 1
  13. PAWPAW_SKIP_GLIB: 1
  14. PAWPAW_SKIP_LV2: 1
  15. jobs:
  16. macos:
  17. strategy:
  18. matrix:
  19. target: [intel, universal]
  20. runs-on: macos-13
  21. steps:
  22. - uses: actions/checkout@v4
  23. with:
  24. submodules: recursive
  25. - name: Set up cache
  26. uses: actions/cache@v4
  27. with:
  28. path: |
  29. ~/PawPawBuilds
  30. key: macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  31. - name: Set up dependencies
  32. run: |
  33. brew install cmake jq meson
  34. - name: Bootstrap dependencies
  35. shell: bash
  36. run: |
  37. if [ ! -d PawPaw ]; then
  38. git clone https://github.com/DISTRHO/PawPaw.git
  39. git -C PawPaw checkout ${PAWPAW_VERSION}
  40. fi
  41. ./PawPaw/.github/workflows/bootstrap-deps.sh macos-${{ matrix.target }}
  42. ./PawPaw/bootstrap-jack2.sh macos-${{ matrix.target }}
  43. ./PawPaw/.cleanup.sh macos-${{ matrix.target }}
  44. - name: Build jack2
  45. shell: bash
  46. run: |
  47. pushd PawPaw && source local.env macos-${{ matrix.target }} && popd
  48. python ./waf configure --platform=darwin --prefix=/usr/local
  49. python ./waf build -j $(sysctl -n hw.logicalcpu)
  50. python ./waf install --destdir=$(pwd)/destdir
  51. - name: Set sha8 (non-release)
  52. if: startsWith(github.ref, 'refs/tags/') != true
  53. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  54. - name: Set sha8 (release)
  55. if: startsWith(github.ref, 'refs/tags/')
  56. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  57. - name: Generate macOS package
  58. shell: bash
  59. run: |
  60. ./macosx/generate-pkg.sh $(pwd)/destdir/usr/local ${{ github.event.pull_request.number || env.SHA8 }}
  61. - uses: actions/upload-artifact@v4
  62. with:
  63. name: jack2-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  64. path: macosx/jack2-osx-*.pkg
  65. windows:
  66. strategy:
  67. matrix:
  68. target: [win32, win64]
  69. runs-on: ubuntu-22.04
  70. steps:
  71. - uses: actions/checkout@v4
  72. with:
  73. submodules: recursive
  74. - name: Set up cache
  75. uses: actions/cache@v4
  76. with:
  77. path: |
  78. ~/PawPawBuilds
  79. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  80. - name: Restore debian packages cache
  81. shell: bash
  82. run: |
  83. if [ -d ~/PawPawBuilds/debs ] && [ "$(ls ~/PawPawBuilds/debs | wc -l)" -ne 0 ]; then
  84. sudo cp ~/PawPawBuilds/debs/*.deb /var/cache/apt/archives/;
  85. fi
  86. - name: Fix GitHub's mess
  87. shell: bash
  88. run: |
  89. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  90. sudo dpkg --add-architecture i386
  91. sudo apt-get update -qq
  92. sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386
  93. - name: Set up dependencies
  94. shell: bash
  95. run: |
  96. if [ ! -d PawPaw ]; then
  97. git clone https://github.com/DISTRHO/PawPaw.git
  98. git -C PawPaw checkout ${PAWPAW_VERSION}
  99. fi
  100. sudo ./PawPaw/.github/workflows/bootstrap-deps.sh ${{ matrix.target }}
  101. sudo apt-get install -y build-essential llvm xvfb wine-stable
  102. - name: Cache debian packages
  103. shell: bash
  104. run: |
  105. mkdir -p ~/PawPawBuilds/debs
  106. sudo mv /var/cache/apt/archives/*.deb ~/PawPawBuilds/debs/
  107. - name: Bootstrap dependencies
  108. shell: bash
  109. run: |
  110. ./PawPaw/bootstrap-jack2.sh ${{ matrix.target }}
  111. ./PawPaw/.cleanup.sh ${{ matrix.target }}
  112. - name: Build jack2
  113. shell: bash
  114. run: |
  115. pushd PawPaw && source local.env ${{ matrix.target }} && popd
  116. export PATH+=":/usr/i686-w64-mingw32/bin"
  117. export LDFLAGS+="-L~/PawPawBuilds/targets/win64/lib32"
  118. ./waf configure --platform=win32 --prefix=$(pwd)/destdir --static ${{ matrix.target == 'win64' && '--mixed' || '' }}
  119. ./waf build -j $(nproc)
  120. ./waf install
  121. - name: Generate MSVC lib files
  122. if: ${{ matrix.target == 'win32' }}
  123. shell: bash
  124. run: |
  125. pushd $(pwd)/destdir/lib
  126. llvm-dlltool -m i386 -D libjack.dll -d libjack.def -l libjack.lib
  127. llvm-dlltool -m i386 -D libjacknet.dll -d libjacknet.def -l libjacknet.lib
  128. llvm-dlltool -m i386 -D libjackserver.dll -d libjackserver.def -l libjackserver.lib
  129. popd
  130. - name: Generate MSVC lib files
  131. if: ${{ matrix.target == 'win64' }}
  132. shell: bash
  133. run: |
  134. # 32bit
  135. pushd $(pwd)/destdir/lib32
  136. llvm-dlltool -m i386 -D libjack.dll -d libjack.def -l libjack.lib
  137. popd
  138. # 64bit
  139. pushd $(pwd)/destdir/lib
  140. llvm-dlltool -m i386:x86-64 -D libjack64.dll -d libjack64.def -l libjack64.lib
  141. llvm-dlltool -m i386:x86-64 -D libjacknet64.dll -d libjacknet64.def -l libjacknet64.lib
  142. llvm-dlltool -m i386:x86-64 -D libjackserver64.dll -d libjackserver64.def -l libjackserver64.lib
  143. popd
  144. - name: Set sha8 (non-release)
  145. if: startsWith(github.ref, 'refs/tags/') != true
  146. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  147. - name: Set sha8 (release)
  148. if: startsWith(github.ref, 'refs/tags/')
  149. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  150. - name: Generate Windows installer
  151. shell: bash
  152. run: |
  153. # Setup wine
  154. export WINEDLLOVERRIDES="mscoree,mshtml="
  155. export WINEPREFIX=$(pwd)/innosetup
  156. xvfb-run wineboot -u
  157. # Download and install innosetup
  158. curl -L https://jrsoftware.org/download.php/is.exe?site=2 -o is.exe
  159. xvfb-run wine is.exe /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent
  160. # create installer
  161. ln -sf $(pwd)/destdir windows/inno/${{ matrix.target }}
  162. pushd windows/inno
  163. echo "#define VERSION \"${{ github.event.pull_request.number || env.SHA8 }}\"" > version.iss
  164. xvfb-run wine ${WINEPREFIX}/drive_c/InnoSeup/ISCC.exe ${{ matrix.target }}-mini.iss
  165. popd
  166. - uses: actions/upload-artifact@v4
  167. with:
  168. name: jack2-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  169. path: windows/inno/jack2-*.exe